1. 06 6月, 2014 6 次提交
  2. 05 6月, 2014 1 次提交
  3. 04 6月, 2014 7 次提交
  4. 03 6月, 2014 22 次提交
  5. 02 6月, 2014 4 次提交
    • J
      bridge: notify user space after fdb update · c65c7a30
      Jon Maxwell 提交于
      There has been a number incidents recently where customers running KVM have
      reported that VM hosts on different Hypervisors are unreachable. Based on
      pcap traces we found that the bridge was broadcasting the ARP request out
      onto the network. However some NICs have an inbuilt switch which on occasions
      were broadcasting the VMs ARP request back through the physical NIC on the
      Hypervisor. This resulted in the bridge changing ports and incorrectly learning
      that the VMs mac address was external. As a result the ARP reply was directed
      back onto the external network and VM never updated it's ARP cache. This patch
      will notify the bridge command, after a fdb has been updated to identify such
      port toggling.
      Signed-off-by: NJon Maxwell <jmaxwell37@gmail.com>
      Reviewed-by: NJiri Pirko <jiri@resnulli.us>
      Acked-by: NToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Acked-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c65c7a30
    • A
    • N
      net: fix wrong mac_len calculation for vlans · 4b9b1cdf
      Nikolay Aleksandrov 提交于
      After 1e785f48 ("net: Start with correct mac_len in
      skb_network_protocol") skb->mac_len is used as a start of the
      calculation in skb_network_protocol() but that is not always correct. If
      skb->protocol == 8021Q/AD, usually the vlan header is already inserted
      in the skb (i.e. vlan reorder hdr == 0). Usually when the packet enters
      dev_hard_xmit it has mac_len == 0 so we take 2 bytes from the
      destination mac address (skb->data + VLAN_HLEN) as a type in
      skb_network_protocol() and return vlan_depth == 4. In the case where TSO is
      off, then the mac_len is set but it's == 18 (ETH_HLEN + VLAN_HLEN), so
      skb_network_protocol() returns a type from inside the packet and
      offset == 22. Also make vlan_depth unsigned as suggested before.
      As suggested by Eric Dumazet, move the while() loop in the if() so we
      can avoid additional testing in fast path.
      
      Here are few netperf tests + debug printk's to illustrate:
      cat netperf.tso-on.reorder-on.bugged
      - Vlan -> device (reorder on, default, this case is okay)
      MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
      192.168.3.1 () port 0 AF_INET
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.00    7111.54
      [   81.605435] skb->len 65226 skb->gso_size 1448 skb->proto 0x800
      skb->mac_len 0 vlan_depth 0 type 0x800
      
      - Vlan -> device (reorder off, bad)
      cat netperf.tso-on.reorder-off.bugged
      MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
      192.168.3.1 () port 0 AF_INET
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.00     241.35
      [  204.578332] skb->len 1518 skb->gso_size 0 skb->proto 0x8100
      skb->mac_len 0 vlan_depth 4 type 0x5301
      0x5301 are the last two bytes of the destination mac.
      
      And if we stop TSO, we may get even the following:
      [   83.343156] skb->len 2966 skb->gso_size 1448 skb->proto 0x8100
      skb->mac_len 18 vlan_depth 22 type 0xb84
      Because mac_len already accounts for VLAN_HLEN.
      
      After the fix:
      cat netperf.tso-on.reorder-off.fixed
      MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to
      192.168.3.1 () port 0 AF_INET
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    10.01    5001.46
      [   81.888489] skb->len 65230 skb->gso_size 1448 skb->proto 0x8100
      skb->mac_len 0 vlan_depth 18 type 0x800
      
      CC: Vlad Yasevich <vyasevic@redhat.com>
      CC: Eric Dumazet <eric.dumazet@gmail.com>
      CC: Daniel Borkman <dborkman@redhat.com>
      CC: David S. Miller <davem@davemloft.net>
      
      Fixes:1e785f48 ("net: Start with correct mac_len in
      skb_network_protocol")
      Signed-off-by: NNikolay Aleksandrov <nikolay@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b9b1cdf
    • L
      Linux 3.15-rc8 · fad01e86
      Linus Torvalds 提交于
      fad01e86