1. 26 9月, 2017 9 次提交
  2. 23 9月, 2017 6 次提交
  3. 22 9月, 2017 19 次提交
  4. 21 9月, 2017 6 次提交
    • F
      net: dsa: Utilize dsa_slave_dev_check() · 53bade8a
      Florian Fainelli 提交于
      Instead of open coding the check.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      53bade8a
    • E
      net: change skb->mac_header when Generic XDP calls adjust_head · 92dd5452
      Edward Cree 提交于
      Since XDP's view of the packet includes the MAC header, moving the start-
       of-packet with bpf_xdp_adjust_head needs to also update the offset of the
       MAC header (which is relative to skb->head, not to the skb->data that was
       changed).
      Without this, tcpdump sees packets starting from the old MAC header rather
       than the new one, at least in my tests on the loopback device.
      
      Fixes: b5cdae32 ("net: Generic XDP")
      Signed-off-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      92dd5452
    • D
      Revert "bridge: also trigger RTM_NEWLINK when interface is released from bridge" · eccaa9e5
      David S. Miller 提交于
      This reverts commit 00ba4cb3.
      
      Discussion with David Ahern determined that this change is
      actually not needed.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eccaa9e5
    • M
      net: compat: assert the size of cmsg copied in is as expected · c2a64bb9
      Meng Xu 提交于
      The actual length of cmsg fetched in during the second loop
      (i.e., kcmsg - kcmsg_base) could be different from what we
      get from the first loop (i.e., kcmlen).
      
      The main reason is that the two get_user() calls in the two
      loops (i.e., get_user(ucmlen, &ucmsg->cmsg_len) and
      __get_user(ucmlen, &ucmsg->cmsg_len)) could cause ucmlen
      to have different values even they fetch from the same userspace
      address, as user can race to change the memory content in
      &ucmsg->cmsg_len across fetches.
      
      Although in the second loop, the sanity check
      if ((char *)kcmsg_base + kcmlen - (char *)kcmsg < CMSG_ALIGN(tmp))
      is inplace, it only ensures that the cmsg fetched in during the
      second loop does not exceed the length of kcmlen, but not
      necessarily equal to kcmlen. But indicated by the assignment
      kmsg->msg_controllen = kcmlen, we should enforce that.
      
      This patch adds this additional sanity check and ensures that
      what is recorded in kmsg->msg_controllen is the actual cmsg length.
      Signed-off-by: NMeng Xu <mengxu.gatech@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c2a64bb9
    • 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
    • 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