1. 08 6月, 2016 2 次提交
    • A
      net/sched: cls_flower: Introduce support in SKIP SW flag · e69985c6
      Amir Vadai 提交于
      In order to make a filter processed only by hardware, skip_sw flag
      should be supplied. This is an addition to the already existing skip_hw
      flag (filter will be processed by software only). If no flag is
      specified, filter will be processed by both software and hardware.
      
      If only hardware offloaded filters exist, fl_classify() will return
      without doing anything.
      
      A following userspace patch will be sent once kernel patch is accepted.
      
      Example:
      
      tc filter add dev enp0s9 protocol ip prio 20 parent ffff: \
      	flower \
      		ip_proto 6 \
      		indev enp0s9 \
      		skip_sw \
      	action skbedit mark 0x1234
      Signed-off-by: NAmir Vadai <amirva@mellanox.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Acked-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e69985c6
    • E
      net: get rid of spin_trylock() in net_tx_action() · 3bcb846c
      Eric Dumazet 提交于
      Note: Tom Herbert posted almost same patch 3 months back, but for
      different reasons.
      
      The reasons we want to get rid of this spin_trylock() are :
      
      1) Under high qdisc pressure, the spin_trylock() has almost no
      chance to succeed.
      
      2) We loop multiple times in softirq handler, eventually reaching
      the max retry count (10), and we schedule ksoftirqd.
      
      Since we want to adhere more strictly to ksoftirqd being waked up in
      the future (https://lwn.net/Articles/687617/), better avoid spurious
      wakeups.
      
      3) calls to __netif_reschedule() dirty the cache line containing
      q->next_sched, slowing down the owner of qdisc.
      
      4) RT kernels can not use the spin_trylock() here.
      
      With help of busylock, we get the qdisc spinlock fast enough, and
      the trylock trick brings only performance penalty.
      
      Depending on qdisc setup, I observed a gain of up to 19 % in qdisc
      performance (1016600 pps instead of 853400 pps, using prio+tbf+fq_codel)
      
      ("mpstat -I SCPU 1" is much happier now)
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Cc: Tom Herbert <tom@herbertland.com>
      Acked-by: NTom Herbert <tom@herbertland.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3bcb846c
  2. 06 6月, 2016 1 次提交
    • M
      net: disable fragment reassembly if high_thresh is zero · 30759219
      Michal Kubeček 提交于
      Before commit 6d7b857d ("net: use lib/percpu_counter API for
      fragmentation mem accounting"), setting the reassembly high threshold
      to 0 prevented fragment reassembly as first fragment would be always
      evicted before second could be added to the queue. While inefficient,
      some users apparently relied on this method.
      
      Since the commit mentioned above, a percpu counter is used for
      reassembly memory accounting and high batch size avoids taking slow path
      in most common scenarios. As a result, a whole full sized packet can be
      reassembled without the percpu counter's main counter changing its value
      so that even with high_thresh set to 0, fragmented packets can be still
      reassembled and processed.
      
      Add explicit check preventing reassembly if high threshold is zero.
      Signed-off-by: NMichal Kubecek <mkubecek@suse.cz>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      30759219
  3. 05 6月, 2016 11 次提交
  4. 04 6月, 2016 9 次提交
  5. 03 6月, 2016 1 次提交
  6. 01 6月, 2016 5 次提交
  7. 30 5月, 2016 4 次提交
    • S
      net: l2tp: Make l2tp_ip6 namespace aware · 0e6b5259
      Shmulik Ladkani 提交于
      l2tp_ip6 tunnel and session lookups were still using init_net, although
      the l2tp core infrastructure already supports lookups keyed by 'net'.
      
      As a result, l2tp_ip6_recv discarded packets for tunnels/sessions
      created in namespaces other than the init_net.
      
      Fix, by using dev_net(skb->dev) or sock_net(sk) where appropriate.
      Signed-off-by: NShmulik Ladkani <shmulik.ladkani@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0e6b5259
    • B
      ieee802154: fix logic error in ieee802154_llsec_parse_dev_addr · 421eeea1
      Baozeng Ding 提交于
      Fix a logic error to avoid potential null pointer dereference.
      Signed-off-by: NBaozeng Ding <sploving1@gmail.com>
      Reviewed-by: Stefan Schmidt<stefan@osg.samsung.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      421eeea1
    • A
      net/lapb: tuse %*ph to dump buffers · 0d08df6c
      Andy Shevchenko 提交于
      Use %*ph specifier to dump small buffers in hex format instead doing this
      byte-by-byte.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0d08df6c
    • A
      fou: add Kconfig options for IPv6 support · fabb13db
      Arnd Bergmann 提交于
      A previous patch added the fou6.ko module, but that failed to link
      in a couple of configurations:
      
      net/built-in.o: In function `ip6_tnl_encap_add_fou_ops':
      net/ipv6/fou6.c:88: undefined reference to `ip6_tnl_encap_add_ops'
      net/ipv6/fou6.c:94: undefined reference to `ip6_tnl_encap_add_ops'
      net/ipv6/fou6.c:97: undefined reference to `ip6_tnl_encap_del_ops'
      net/built-in.o: In function `ip6_tnl_encap_del_fou_ops':
      net/ipv6/fou6.c:106: undefined reference to `ip6_tnl_encap_del_ops'
      net/ipv6/fou6.c:107: undefined reference to `ip6_tnl_encap_del_ops'
      
      If CONFIG_IPV6=m, ip6_tnl_encap_add_ops/ip6_tnl_encap_del_ops
      are in a module, but fou6.c can still be built-in, and that
      obviously fails to link.
      
      Also, if CONFIG_IPV6=y, but CONFIG_IPV6_TUNNEL=m or
      CONFIG_IPV6_TUNNEL=n, the same problem happens for a different
      reason.
      
      This adds two new silent Kconfig symbols to work around both
      problems:
      
      - CONFIG_IPV6_FOU is now always set to 'm' if either CONFIG_NET_FOU=m
        or CONFIG_IPV6=m
      - CONFIG_IPV6_FOU_TUNNEL is set implicitly when IPV6_FOU is enabled
        and NET_FOU_IP_TUNNELS is also turned out, and it will ensure
        that CONFIG_IPV6_TUNNEL is also available.
      
      The options could be made user-visible as well, to give additional
      room for configuration, but it seems easier not to bother users
      with more choice here.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: aa3463d6 ("fou: Add encap ops for IPv6 tunnels")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fabb13db
  8. 28 5月, 2016 1 次提交
    • A
      remove lots of IS_ERR_VALUE abuses · 287980e4
      Arnd Bergmann 提交于
      Most users of IS_ERR_VALUE() in the kernel are wrong, as they
      pass an 'int' into a function that takes an 'unsigned long'
      argument. This happens to work because the type is sign-extended
      on 64-bit architectures before it gets converted into an
      unsigned type.
      
      However, anything that passes an 'unsigned short' or 'unsigned int'
      argument into IS_ERR_VALUE() is guaranteed to be broken, as are
      8-bit integers and types that are wider than 'unsigned long'.
      
      Andrzej Hajda has already fixed a lot of the worst abusers that
      were causing actual bugs, but it would be nice to prevent any
      users that are not passing 'unsigned long' arguments.
      
      This patch changes all users of IS_ERR_VALUE() that I could find
      on 32-bit ARM randconfig builds and x86 allmodconfig. For the
      moment, this doesn't change the definition of IS_ERR_VALUE()
      because there are probably still architecture specific users
      elsewhere.
      
      Almost all the warnings I got are for files that are better off
      using 'if (err)' or 'if (err < 0)'.
      The only legitimate user I could find that we get a warning for
      is the (32-bit only) freescale fman driver, so I did not remove
      the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
      For 9pfs, I just worked around one user whose calling conventions
      are so obscure that I did not dare change the behavior.
      
      I was using this definition for testing:
      
       #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
             unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
      
      which ends up making all 16-bit or wider types work correctly with
      the most plausible interpretation of what IS_ERR_VALUE() was supposed
      to return according to its users, but also causes a compile-time
      warning for any users that do not pass an 'unsigned long' argument.
      
      I suggested this approach earlier this year, but back then we ended
      up deciding to just fix the users that are obviously broken. After
      the initial warning that caused me to get involved in the discussion
      (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
      asked me to send the whole thing again.
      
      [ Updated the 9p parts as per Al Viro  - Linus ]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Link: https://lkml.org/lkml/2016/1/7/363
      Link: https://lkml.org/lkml/2016/5/27/486
      Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      287980e4
  9. 26 5月, 2016 6 次提交