1. 12 2月, 2016 7 次提交
    • E
      fou: enable LCO in FOU and GUE · 06f62292
      Edward Cree 提交于
      Signed-off-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      06f62292
    • E
      net: udp: always set up for CHECKSUM_PARTIAL offload · d75f1306
      Edward Cree 提交于
      If the dst device doesn't support it, it'll get fixed up later anyway
       by validate_xmit_skb().  Also, this allows us to take advantage of LCO
       to avoid summing the payload multiple times.
      Signed-off-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d75f1306
    • E
      net: local checksum offload for encapsulation · 179bc67f
      Edward Cree 提交于
      The arithmetic properties of the ones-complement checksum mean that a
       correctly checksummed inner packet, including its checksum, has a ones
       complement sum depending only on whatever value was used to initialise
       the checksum field before checksumming (in the case of TCP and UDP,
       this is the ones complement sum of the pseudo header, complemented).
      Consequently, if we are going to offload the inner checksum with
       CHECKSUM_PARTIAL, we can compute the outer checksum based only on the
       packed data not covered by the inner checksum, and the initial value of
       the inner checksum field.
      Signed-off-by: NEdward Cree <ecree@solarflare.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      179bc67f
    • E
      tcp/dccp: better use of ephemeral ports in bind() · ea8add2b
      Eric Dumazet 提交于
      Implement strategy used in __inet_hash_connect() in opposite way :
      
      Try to find a candidate using odd ports, then fallback to even ports.
      
      We no longer disable BH for whole traversal, but one bucket at a time.
      We also use cond_resched() to yield cpu to other tasks if needed.
      
      I removed one indentation level and tried to mirror the loop we have
      in __inet_hash_connect() and variable names to ease code maintenance.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ea8add2b
    • E
      tcp/dccp: better use of ephemeral ports in connect() · 1580ab63
      Eric Dumazet 提交于
      In commit 07f4c900 ("tcp/dccp: try to not exhaust ip_local_port_range
      in connect()"), I added a very simple heuristic, so that we got better
      chances to use even ports, and allow bind() users to have more available
      slots.
      
      It gave nice results, but with more than 200,000 TCP sessions on a typical
      server, the ~30,000 ephemeral ports are still a rare resource.
      
      I chose to go a step further, by looking at all even ports, and if none
      was available, fallback to odd ports.
      
      The companion patch does the same in bind(), but in opposite way.
      
      I've seen exec times of up to 30ms on busy servers, so I no longer
      disable BH for the whole traversal, but only for each hash bucket.
      I also call cond_resched() to be gentle to other tasks.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1580ab63
    • J
      net: bulk free SKBs that were delay free'ed due to IRQ context · 15fad714
      Jesper Dangaard Brouer 提交于
      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: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      15fad714
    • J
      net: bulk free infrastructure for NAPI context, use napi_consume_skb · 795bb1c0
      Jesper Dangaard Brouer 提交于
      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: NJesper Dangaard Brouer <brouer@redhat.com>
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      795bb1c0
  2. 11 2月, 2016 26 次提交
  3. 10 2月, 2016 7 次提交