1. 16 Feb, 2016 23 commits
  2. 12 Feb, 2016 12 commits
  3. 11 Feb, 2016 5 commits
    • David S. Miller's avatar
      Merge branch 'net-mitigate-kmem_free-slowpath' · 3134b9f0
      David S. Miller authored
      Jesper Dangaard Brouer says:
      
      ====================
      net: mitigating kmem_cache free slowpath
      
      This patchset is the first real use-case for kmem_cache bulk _free_.
      The use of bulk _alloc_ is NOT included in this patchset. The full use
      have previously been posted here [1].
      
      The bulk free side have the largest benefit for the network stack
      use-case, because network stack is hitting the kmem_cache/SLUB
      slowpath when freeing SKBs, due to the amount of outstanding SKBs.
      This is solved by using the new API kmem_cache_free_bulk().
      
      Introduce new API napi_consume_skb(), that hides/handles bulk freeing
      for the caller.  The drivers simply need to use this call when freeing
      SKBs in NAPI context, e.g. replacing their calles to dev_kfree_skb() /
      dev_consume_skb_any().
      
      Driver ixgbe is the first user of this new API.
      
      [1] http://thread.gmane.org/gmane.linux.network/384302/focus=397373
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3134b9f0
    • Jesper Dangaard Brouer's avatar
      ixgbe: bulk free SKBs during TX completion cleanup cycle · a3a8749d
      Jesper Dangaard Brouer authored
      There is an opportunity to bulk free SKBs during reclaiming of
      resources after DMA transmit completes in ixgbe_clean_tx_irq.  Thus,
      bulk freeing at this point does not introduce any added latency.
      
      Simply use napi_consume_skb() which were recently introduced.  The
      napi_budget parameter is needed by napi_consume_skb() to detect if it
      is called from netpoll.
      
      Benchmarking IPv4-forwarding, on CPU i7-4790K @4.2GHz (no turbo boost)
       Single CPU/flow numbers: before: 1982144 pps ->  after : 2064446 pps
       Improvement: +82302 pps, -20 nanosec, +4.1%
       (SLUB and GCC version 5.1.1 20150618 (Red Hat 5.1.1-4))
      
      Joint work with Alexander Duyck.
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a3a8749d
    • Jesper Dangaard Brouer's avatar
      net: bulk free SKBs that were delay free'ed due to IRQ context · 15fad714
      Jesper Dangaard Brouer authored
      The network stack defers SKBs free, in-case free happens in IRQ or
      when IRQs are disabled. This happens in __dev_kfree_skb_irq() that
      writes SKBs that were free'ed during IRQ to the softirq completion
      queue (softnet_data.completion_queue).
      
      These SKBs are naturally delayed, and cleaned up during NET_TX_SOFTIRQ
      in function net_tx_action().  Take advantage of this a use the skb
      defer and flush API, as we are already in softirq context.
      
      For modern drivers this rarely happens. Although most drivers do call
      dev_kfree_skb_any(), which detects the situation and calls
      __dev_kfree_skb_irq() when needed.  This due to netpoll can call from
      IRQ context.
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      15fad714
    • Jesper Dangaard Brouer's avatar
      net: bulk free infrastructure for NAPI context, use napi_consume_skb · 795bb1c0
      Jesper Dangaard Brouer authored
      Discovered that network stack were hitting the kmem_cache/SLUB
      slowpath when freeing SKBs.  Doing bulk free with kmem_cache_free_bulk
      can speedup this slowpath.
      
      NAPI context is a bit special, lets take advantage of that for bulk
      free'ing SKBs.
      
      In NAPI context we are running in softirq, which gives us certain
      protection.  A softirq can run on several CPUs at once.  BUT the
      important part is a softirq will never preempt another softirq running
      on the same CPU.  This gives us the opportunity to access per-cpu
      variables in softirq context.
      
      Extend napi_alloc_cache (before only contained page_frag_cache) to be
      a struct with a small array based stack for holding SKBs.  Introduce a
      SKB defer and flush API for accessing this.
      
      Introduce napi_consume_skb() as replacement for e.g. dev_consume_skb_any()
      when running in NAPI context.  A small trick to handle/detect if we
      are called from netpoll is to see if budget is 0.  In that case, we
      need to invoke dev_consume_skb_irq().
      
      Joint work with Alexander Duyck.
      Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      795bb1c0
    • David S. Miller's avatar
      Merge branch 'virtio_net-ethtool-validation' · 18ac5590
      David S. Miller authored
      Nikolay Aleksandrov says:
      
      ====================
      virtio_net: better ethtool setting validation
      
      This small set is a follow-up for the recent patches that added ethtool
      get/set settings. Patch 1 changes the speed validation routine to check
      if the speed is between 0 and INT_MAX (or SPEED_UNKNOWN) and patch 2 adds
      port validation to virtio_net and better validation comment.
      
      This set is on top of Michael's patch which explains that speeds from 0
      to INT_MAX are valid:
      http://patchwork.ozlabs.org/patch/578911/
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      18ac5590