1. 23 Jan, 2014 9 commits
    • Dominic Curran's avatar
      tuntap: Fix for a race in accessing numqueues · fa35864e
      Dominic Curran authored
      A patch for fixing a race between queue selection and changing queues
      was introduced in commit 92bb73ea("tuntap: fix a possible race between
      queue selection and changing queues").
      
      The fix was to prevent the driver from re-reading the tun->numqueues
      more than once within tun_select_queue() using ACCESS_ONCE().
      
      We have been experiancing 'Divide-by-zero' errors in tun_net_xmit()
      since we moved from 3.6 to 3.10, and believe that they come from a
      simular source where the value of tun->numqueues changes to zero
      between the first and a subsequent read of tun->numqueues.
      
      The fix is a simular use of ACCESS_ONCE(), as well as a multiply
      instead of a divide in the if statement.
      Signed-off-by: default avatarDominic Curran <dominic.curran@citrix.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Maxim Krasnyansky <maxk@qti.qualcomm.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Acked-by: default avatarMax Krasnyansky <maxk@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fa35864e
    • Toshiaki Makita's avatar
      bridge: Remove unnecessary vlan_put_tag in br_handle_vlan · bdf4351b
      Toshiaki Makita authored
      br_handle_vlan() pushes HW accelerated vlan tag into skbuff when outgoing
      port is the bridge device.
      This is unnecessary because __netif_receive_skb_core() can handle skbs
      with HW accelerated vlan tag. In current implementation,
      __netif_receive_skb_core() needs to extract the vlan tag embedded in skb
      data. This could cause low network performance especially when receiving
      frames at a high frame rate on the bridge device.
      Signed-off-by: default avatarToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Acked-by: default avatarVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bdf4351b
    • Christoph Paasch's avatar
      tcp: metrics: Fix rcu-race when deleting multiple entries · 00ca9c5b
      Christoph Paasch authored
      In bbf852b9 I introduced the tmlist, which allows to delete
      multiple entries from the cache that match a specified destination if no
      source-IP is specified.
      
      However, as the cache is an RCU-list, we should not create this tmlist, as
      it will change the tcpm_next pointer of the element that will be deleted
      and so a thread iterating over the cache's entries while holding the
      RCU-lock might get "redirected" to this tmlist.
      
      This patch fixes this, by reverting back to the old behavior prior to
      bbf852b9, which means that we simply change the tcpm_next
      pointer of the previous element (pp) to jump over the one we are
      deleting.
      The difference is that we call kfree_rcu() directly on the cache entry,
      which allows us to delete multiple entries from the list.
      
      Fixes: bbf852b9 (tcp: metrics: Delete all entries matching a certain destination)
      Signed-off-by: default avatarChristoph Paasch <christoph.paasch@uclouvain.be>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      00ca9c5b
    • David S. Miller's avatar
      Merge branch 'bonding' · 7705b104
      David S. Miller authored
      Ding Tianhong says:
      
      ====================
      bonding: fix primary problem for bonding
      
      If the slave's name changed, and the bond params primary is exist,
      the bond should deal with the situation in two ways:
      
      1) If the slave was the primary slave yet, clean the primary slave
         and reselect active slave.
      2) If the slave's new name is as same as bond primary, set the slave
         as primary slave and reselect active slave.
      
      If the new primary is not matching any slave in the bond, the bond should
      record it to params, clean the primary slave and select a new active slave.
      
      Update bonding.txt for primary description.
      
      v2.1->v1: Because there are too many indentions and useless verification, so rewrite
      	  the logic for updating the primary slave.
      	  Modify some comments for to clean the typos.
      
      v3->v2.1: Veaceslav disagree the first patch and modify the logic for it
      	  (bonding: update the primary slave when changing slave's name)
      	  and resend it himself (bonding: handle slave's name change with primary_slave logic),
      	  so remove the first patch and send the last two patches.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7705b104
    • dingtianhong's avatar
    • dingtianhong's avatar
      bonding: clean the primary slave if there is no slave matching new primary · c59ab673
      dingtianhong authored
      If the new primay is not matching any slave in the bond, the bond should
      record it to params, clean the primary slave and select a new active slave.
      Signed-off-by: default avatarDing Tianhong <dingtianhong@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c59ab673
    • Daniel Borkmann's avatar
      net: vxlan: convert to act as a pernet subsystem · 783c1463
      Daniel Borkmann authored
      As per suggestion from Eric W. Biederman, vxlan should be using
      {un,}register_pernet_subsys() instead of {un,}register_pernet_device()
      to ensure the vxlan_net structure is initialized before and cleaned
      up after all network devices in a given network namespace i.e. when
      dealing with network notifiers. This is similarly handeled already in
      commit 91e2ff35 ("net: Teach vlans to cleanup as a pernet subsystem")
      and, thus, improves upon fd27e0d4 ("net: vxlan: do not use vxlan_net
      before checking event type"). Just as in 91e2ff35, we do not need
      to explicitly handle deletion of vxlan devices as network namespace
      exit calls dellink on all remaining virtual devices, and
      rtnl_link_unregister() calls dellink on all outstanding devices in that
      network namespace, so we can entirely drop the pernet exit operation
      as well. Moreover, on vxlan module exit, rcu_barrier() is called by
      netns since commit 3a765eda ("netns: Add an explicit rcu_barrier
      to unregister_pernet_{device|subsys}"), so this may be omitted. Tested
      with various scenarios and works well on my side.
      Suggested-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      783c1463
    • Harry Mason's avatar
      sch_htb: let skb->priority refer to non-leaf class · 29824310
      Harry Mason authored
      If the class in skb->priority is not a leaf, apply filters from the
      selected class, not the qdisc. This lets netfilter or user space
      partially classify the packet.
      Signed-off-by: default avatarHarry Mason <harry.mason@smoothwall.net>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      29824310
    • Neil Horman's avatar
      af_packet: Add Queue mapping mode to af_packet fanout operation · 2d36097d
      Neil Horman authored
      This patch adds a queue mapping mode to the fanout operation of af_packet
      sockets.  This allows user space af_packet users to better filter on flows
      ingressing and egressing via a specific hardware queue, and avoids the potential
      packet reordering that can occur when FANOUT_CPU is being used and irq affinity
      varies.
      
      Tested successfully by myself.  applies to net-next
      Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      CC: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d36097d
  2. 22 Jan, 2014 31 commits