1. 07 3月, 2015 22 次提交
  2. 06 3月, 2015 12 次提交
    • S
      e1000: add dummy allocator to fix race condition between mtu change and netpoll · 08e83316
      Sabrina Dubroca 提交于
      There is a race condition between e1000_change_mtu's cleanups and
      netpoll, when we change the MTU across jumbo size:
      
      Changing MTU frees all the rx buffers:
          e1000_change_mtu -> e1000_down -> e1000_clean_all_rx_rings ->
              e1000_clean_rx_ring
      
      Then, close to the end of e1000_change_mtu:
          pr_info -> ... -> netpoll_poll_dev -> e1000_clean ->
              e1000_clean_rx_irq -> e1000_alloc_rx_buffers -> e1000_alloc_frag
      
      And when we come back to do the rest of the MTU change:
          e1000_up -> e1000_configure -> e1000_configure_rx ->
              e1000_alloc_jumbo_rx_buffers
      
      alloc_jumbo finds the buffers already != NULL, since data (shared with
      page in e1000_rx_buffer->rxbuf) has been re-alloc'd, but it's garbage,
      or at least not what is expected when in jumbo state.
      
      This results in an unusable adapter (packets don't get through), and a
      NULL pointer dereference on the next call to e1000_clean_rx_ring
      (other mtu change, link down, shutdown):
      
      BUG: unable to handle kernel NULL pointer dereference at           (null)
      IP: [<ffffffff81194d6e>] put_compound_page+0x7e/0x330
      
          [...]
      
      Call Trace:
       [<ffffffff81195445>] put_page+0x55/0x60
       [<ffffffff815d9f44>] e1000_clean_rx_ring+0x134/0x200
       [<ffffffff815da055>] e1000_clean_all_rx_rings+0x45/0x60
       [<ffffffff815df5e0>] e1000_down+0x1c0/0x1d0
       [<ffffffff811e2260>] ? deactivate_slab+0x7f0/0x840
       [<ffffffff815e21bc>] e1000_change_mtu+0xdc/0x170
       [<ffffffff81647050>] dev_set_mtu+0xa0/0x140
       [<ffffffff81664218>] do_setlink+0x218/0xac0
       [<ffffffff814459e9>] ? nla_parse+0xb9/0x120
       [<ffffffff816652d0>] rtnl_newlink+0x6d0/0x890
       [<ffffffff8104f000>] ? kvm_clock_read+0x20/0x40
       [<ffffffff810a2068>] ? sched_clock_cpu+0xa8/0x100
       [<ffffffff81663802>] rtnetlink_rcv_msg+0x92/0x260
      
      By setting the allocator to a dummy version, netpoll can't mess up our
      rx buffers.  The allocator is set back to a sane value in
      e1000_configure_rx.
      
      Fixes: edbbb3ca ("e1000: implement jumbo receive with partial descriptors")
      Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      08e83316
    • E
      e1000: call netif_carrier_off early on down · f9c029db
      Eliezer Tamir 提交于
      When bringing down an interface netif_carrier_off() should be
      one the first things we do, since this will prevent the stack
      from queuing more packets to this interface.
      This operation is very fast, and should make the device behave
      much nicer when trying to bring down an interface under load.
      
      Also, this would Do The Right Thing (TM) if this device has some
      sort of fail-over teaming and redirect traffic to the other IF.
      
      Move netif_carrier_off as early as possible.
      Signed-off-by: NEliezer Tamir <eliezer.tamir@linux.intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      f9c029db
    • A
      igb: Make arrays on stack static const to avoid reallocation · b23c0cc5
      Alexander Duyck 提交于
      While addressing the pin problem I noticed that all of the pin register
      values where having to be pushed onto the stack each time the function was
      called.  To avoid that I am making them static const so that they should
      only need to be allocated once and we can avoid all the instructions to get
      them onto the stack..
      
      size before:
         text	   data	    bss	    dec	    hex	filename
       161477	  10512	      8	 171997	  29fdd	drivers/net/ethernet/intel/igb/igb.ko
      
      size after:
         text	   data	    bss	    dec	    hex	filename
       161205	  10512	      8	 171725	  29ecd	drivers/net/ethernet/intel/igb/igb.ko
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      b23c0cc5
    • A
      igb: Fix warning pin may be used uninitialized · e357f0aa
      Alexander Duyck 提交于
      When building the kernel using the gcc 4.8.3 compiler included in Fedora 20
      I was repeatedly seeing the warning:
      
       drivers/net/ethernet/intel/igb/igb_ptp.c: In function ‘igb_ptp_feature_enable_i210’:
       drivers/net/ethernet/intel/igb/igb_ptp.c:395:21: warning: ‘pin’ may be used uninitialized in this function
       [-Wmaybe-uninitialized]
         tssdp &= ~ts_sdp_en[pin];
                           ^
       drivers/net/ethernet/intel/igb/igb_ptp.c:471:6: note: ‘pin’ was declared here
         int pin;
             ^
      
      To resolve it I am assigning the pin a value of -1 when it is instantiated.
      Signed-off-by: NAlexander Duyck <alexander.h.duyck@redhat.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      e357f0aa
    • Y
      e1000e: remove calls to ioremap/unmap for NVM addr · 1103a631
      Yanir Lubetkin 提交于
      Starting I219, the NVM will not be mapped to its own BAR, but to an
      address region in another bar.  The mapping/unmapping is relevant
      to older HW only.
      
      CC: John W Linville <linville@tuxdriver.com>
      Reported-by: NJohn W Linville <linville@tuxdriver.com>
      Signed-off-by: NYanir Lubetkin <yanirx.lubetkin@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      1103a631
    • Y
      e1000e: fix obscure comments · 9d17ce49
      Yanir Lubetkin 提交于
      The interface to the device flash was modified in i219 and later HW.
      This patch better describes the change and the impact on the driver.
      
      CC: John W Linville <linville@tuxdriver.com>
      Reported-by: NJohn W Linville <linville@tuxdriver.com>
      Signed-off-by: NYanir Lubetkin <yanirx.lubetkin@intel.com>
      Tested-by: NAaron Brown <aaron.f.brown@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      9d17ce49
    • S
      rocker: implement IPv4 fib offloading · c1beeef7
      Scott Feldman 提交于
      The driver implements ndo_switch_fib_ipv4_add/del ops to add/del/mod IPv4
      routes to/from switchdev device.  Once a route is added to the device, and the
      route's nexthops are resolved to neighbor MAC address, the device will forward
      matching pkts rather than the kernel.  This offloads the L3 forwarding path
      from the kernel to the device.  Note that control and management planes are
      still mananged by Linux; only the data plane is offloaded.  Standard routing
      control protocols such as OSPF and BGP run on Linux and manage the kernel's FIB
      via standard rtm netlink msgs...nothing changes here.
      
      A new hash table is added to rocker to track neighbors.  The driver listens for
      neighbor updates events using netevent notifier NETEVENT_NEIGH_UPDATE.  Any ARP
      table updates for ports on this device are recorded in this table.  Routes
      installed to the device with nexthops that reference neighbors in this table
      are "qualified".  In the case of a route with nexthops not resolved in the
      table, the kernel is asked to resolve the nexthop.
      
      The driver uses fib_info->fib_priority for the priority field in rocker's
      unicast routing table.
      
      The device can only forward to pkts matching route dst to resolved nexthops.
      Currently, the device only supports single-path routes (i.e. routes with one
      nexthop).  Equal Cost Multipath (ECMP) route support will be added in followup
      patches.
      
      This patch is driver support for unicast IPv4 routing only.  Followup patches
      will add driver and infrastructure for IPv6 routing and multicast routing.
      Signed-off-by: NScott Feldman <sfeldma@gmail.com>
      Signed-off-by: NJiri Pirko <jiri@resnulli.us>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c1beeef7
    • E
      tg3: use napi_complete_done() · 24d2e4a5
      Eric Dumazet 提交于
      Using napi_complete_done() instead of napi_complete() allows
      us to use /sys/class/net/ethX/gro_flush_timeout
      
      GRO layer can aggregate more packets if the flush is delayed a bit,
      without having to set too big coalescing parameters that impact
      latencies.
      
      Tested:
      
      lpx:~# echo 0 >/sys/class/net/eth1/gro_flush_timeout
      
      lpx:~# sar -n DEV 1 10 | grep eth1
      10:36:25 AM      eth1  81290.00  40617.00 120479.67   2777.01      0.00      0.00      0.00
      10:36:26 AM      eth1  81283.00  40608.00 120481.81   2778.13      0.00      0.00      1.00
      10:36:27 AM      eth1  81304.00  40639.00 120518.42   2778.28      0.00      0.00      0.00
      10:36:28 AM      eth1  81255.00  40605.00 120437.34   2775.95      0.00      0.00      1.00
      10:36:29 AM      eth1  81306.00  40630.00 120521.44   2777.70      0.00      0.00      0.00
      10:36:30 AM      eth1  81286.00  40564.00 120480.20   2773.31      0.00      0.00      0.00
      10:36:31 AM      eth1  81256.00  40599.00 120438.81   2776.27      0.00      0.00      0.00
      10:36:32 AM      eth1  81287.00  40594.00 120480.69   2776.69      0.00      0.00      0.00
      10:36:33 AM      eth1  81279.00  40601.00 120478.53   2775.84      0.00      0.00      0.00
      10:36:34 AM      eth1  81277.00  40610.00 120476.94   2776.25      0.00      0.00      0.00
      Average:         eth1  81282.30  40606.70 120479.39   2776.54      0.00      0.00      0.20
      
      lpx:~# echo 13000 >/sys/class/net/eth1/gro_flush_timeout
      
      lpx:~# sar -n DEV 1 10 | grep eth1
      10:36:43 AM      eth1  81257.00   7747.00 120437.44    530.00      0.00      0.00      0.00
      10:36:44 AM      eth1  81278.00   7748.00 120480.00    529.85      0.00      0.00      0.00
      10:36:45 AM      eth1  81282.00   7752.00 120479.09    531.09      0.00      0.00      0.00
      10:36:46 AM      eth1  81282.00   7751.00 120478.80    530.90      0.00      0.00      0.00
      10:36:47 AM      eth1  81276.00   7745.00 120478.31    529.64      0.00      0.00      0.00
      10:36:48 AM      eth1  81278.00   7747.00 120478.50    529.81      0.00      0.00      0.00
      10:36:49 AM      eth1  81282.00   7749.00 120478.88    530.01      0.00      0.00      0.00
      10:36:50 AM      eth1  81284.00   7751.00 120481.52    530.20      0.00      0.00      0.00
      10:36:51 AM      eth1  81299.00   7769.00 120481.74    533.81      0.00      0.00      0.00
      10:36:52 AM      eth1  81281.00   7748.00 120478.62    529.96      0.00      0.00      0.00
      Average:         eth1  81279.90   7750.70 120475.29    530.53      0.00      0.00      0.00
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Acked-by: NMichael Chan <mchan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      24d2e4a5
    • J
      i40e: Fix mismatching type for ioremap_len · e815665e
      Jeff Kirsher 提交于
      As pointed out by Ben Hutchings, ioremap uses unsigned long as
      its parameter type, so we should be using that instead of u32
      or int.
      Reported-by: NBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e815665e
    • H
      cxgb4: Try and provide an RDMA CIQ per cpu · f36e58e5
      Hariprasad Shenai 提交于
      To allow for better scalability on systems with large core counts, we
      will try and allocate enough RDMA Concentrator IQs and MSI/X vectors as
      we have cores. If we cannot get enough MSI/X vectors, fall back to the
      minimum required: 1 per adapter rx channel.
      
      Also clean up cxgb_enable_msix() to make it readable and correct a bug
      where the vectors are not correctly assigned if the driver doesn't get
      the full amount requested.
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f36e58e5
    • H
      cxgb4: Move offload Rx queue allocation to separate function · 1c6a5b0e
      Hariprasad Shenai 提交于
      Adds a common function for all Rx queue allocation.
      Signed-off-by: NHariprasad Shenai <hariprasad@chelsio.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1c6a5b0e
    • S
      i40e/i40evf: Version bump · d3866a07
      Sravanthi Tangeda 提交于
      Bump i40e to 1.2.11 and i40evf to 1.2.5
      
      Change-ID: Ie13375941606b0a027e5b5dbc235f5f5f03b75c8
      Signed-off-by: NSravanthi Tangeda <sravanthi.tangeda@intel.com>
      Tested-by: NJim Young <james.m.young@intel.com>
      Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
      d3866a07
  3. 05 3月, 2015 6 次提交