1. 21 9月, 2017 8 次提交
    • P
      udp: do rmem bulk free even if the rx sk queue is empty · 0d4a6608
      Paolo Abeni 提交于
      The commit 6b229cf7 ("udp: add batching to udp_rmem_release()")
      reduced greatly the cacheline contention between the BH and the US
      reader batching the rmem updates in most scenarios.
      
      Such optimization is explicitly avoided if the US reader is faster
      then BH processing.
      
      My fault, I initially suggested this kind of behavior due to concerns
      of possible regressions with small sk_rcvbuf values. Tests showed
      such concerns are misplaced, so this commit relaxes the condition
      for rmem bulk updates, obtaining small but measurable performance
      gain in the scenario described above.
      Signed-off-by: NPaolo Abeni <pabeni@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0d4a6608
    • J
      virtio-net: support XDP_REDIRECT · 186b3c99
      Jason Wang 提交于
      This patch tries to add XDP_REDIRECT for virtio-net. The changes are
      not complex as we could use exist XDP_TX helpers for most of the
      work. The rest is passing the XDP_TX to NAPI handler for implementing
      batching.
      
      Cc: John Fastabend <john.fastabend@gmail.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      186b3c99
    • J
      virtio-net: add packet len average only when needed during XDP · 31240345
      Jason Wang 提交于
      There's no need to add packet len average in the case of XDP_PASS
      since it will be done soon after skb is created.
      
      Cc: John Fastabend <john.fastabend@gmail.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      31240345
    • J
      virtio-net: remove unnecessary parameter of virtnet_xdp_xmit() · 9457642a
      Jason Wang 提交于
      CC: John Fastabend <john.fastabend@gmail.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9457642a
    • E
      net: dsa: lan9303: Add adjust_link() method · 4d6a78b4
      Egil Hjelmeland 提交于
      Make the driver react to device tree "fixed-link" declaration on CPU port.
      
      - turn off autonegotiation
      - force speed 10 or 100 mb/s
      - force duplex mode
      Signed-off-by: NEgil Hjelmeland <privat@egil-hjelmeland.no>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4d6a78b4
    • V
      bridge: also trigger RTM_NEWLINK when interface is released from bridge · 00ba4cb3
      Vincent Bernat 提交于
      Currently, when an interface is released from a bridge via
      ioctl(), we get a RTM_DELLINK event through netlink:
      
      Deleted 2: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
          link/ether 6e:23:c2:54:3a:b3
      
      Userspace has to interpret that as a removal from the bridge, not as a
      complete removal of the interface. When an bridged interface is
      completely removed, we get two events:
      
      Deleted 2: dummy0: <BROADCAST,NOARP> mtu 1500 master bridge0 state DOWN
          link/ether 6e:23:c2:54:3a:b3
      Deleted 2: dummy0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default
          link/ether 6e:23:c2:54:3a:b3 brd ff:ff:ff:ff:ff:ff
      
      In constrast, when an interface is released from a bond, we get a
      RTM_NEWLINK with only the new characteristics (no master):
      
      3: dummy1: <BROADCAST,NOARP,SLAVE,UP,LOWER_UP> mtu 1500 qdisc noqueue master bond0 state UNKNOWN group default
          link/ether ae:dc:7a:8c:9a:3c brd ff:ff:ff:ff:ff:ff
      3: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
          link/ether ae:dc:7a:8c:9a:3c brd ff:ff:ff:ff:ff:ff
      4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
          link/ether ae:dc:7a:8c:9a:3c brd ff:ff:ff:ff:ff:ff
      3: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noqueue state DOWN group default
          link/ether ae:dc:7a:8c:9a:3c brd ff:ff:ff:ff:ff:ff
      3: dummy1: <BROADCAST,NOARP> mtu 1500 qdisc noqueue state DOWN group default
          link/ether ca:c8:7b:66:f8:25 brd ff:ff:ff:ff:ff:ff
      4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
          link/ether ae:dc:7a:8c:9a:3c brd ff:ff:ff:ff:ff:ff
      
      Userland may be confused by the fact we say a link is deleted while
      its characteristics are only modified. A first solution would have
      been to turn the RTM_DELLINK event in del_nbp() into a RTM_NEWLINK
      event. However, maybe some piece of userland is relying on this
      RTM_DELLINK to detect when a bridged interface is released. Instead,
      we also emit a RTM_NEWLINK event once the interface is
      released (without master info).
      
      Deleted 2: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
          link/ether 8a:bb:e7:94:b1:f8
      2: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
          link/ether 8a:bb:e7:94:b1:f8 brd ff:ff:ff:ff:ff:ff
      
      This is done only when using ioctl(). When using Netlink, such an
      event is already automatically emitted in do_setlink().
      Signed-off-by: NVincent Bernat <vincent@bernat.im>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      00ba4cb3
    • Z
      macvlan: code refine to check data before using · 07850a4f
      Zhang Shengju 提交于
      This patch checks data first at one place, return if it's null.
      Signed-off-by: NZhang Shengju <zhangshengju@cmss.chinamobile.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      07850a4f
    • X
      ipv6: Use ipv6_authlen for len in ipv6_skip_exthdr · d4e1b299
      Xiang Gao 提交于
      In ipv6_skip_exthdr, the lengh of AH header is computed manually
      as (hp->hdrlen+2)<<2. However, in include/linux/ipv6.h, a macro
      named ipv6_authlen is already defined for exactly the same job. This
      commit replaces the manual computation code with the macro.
      Signed-off-by: NXiang Gao <qasdfgtyuiop@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d4e1b299
  2. 20 9月, 2017 32 次提交