1. 30 7月, 2015 1 次提交
  2. 23 7月, 2015 3 次提交
  3. 29 6月, 2015 1 次提交
    • M
      bnx2x: fix DMA API usage · 8031612d
      Michal Schmidt 提交于
      With CONFIG_DMA_API_DEBUG=y bnx2x triggers the error "DMA-API: device
      driver frees DMA memory with wrong function".
      On archs where PAGE_SIZE > SGE_PAGE_SIZE it also triggers "DMA-API:
      device driver frees DMA memory with different size".
      
      Fix this by making the mapping and unmapping symmetric:
       - Do not map the whole pool page at once. Instead map the
         SGE_PAGE_SIZE-sized pieces individually, so they can be unmapped in
         the same manner.
       - What's mapped using dma_map_page() must be unmapped using
         dma_unmap_page().
      
      Tested on ppc64.
      
      Fixes: 4cace675 ("bnx2x: Alloc 4k fragment for each rx ring buffer element")
      Signed-off-by: NMichal Schmidt <mschmidt@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8031612d
  4. 02 6月, 2015 1 次提交
    • G
      bnx2x: Alloc 4k fragment for each rx ring buffer element · 4cace675
      Gabriel Krisman Bertazi 提交于
      The driver allocates one page for each buffer on the rx ring, which is
      too much on architectures like ppc64 and can cause unexpected allocation
      failures when the system is under stress.  Now, we keep a memory pool
      per queue, and if the architecture's PAGE_SIZE is greater than 4k, we
      fragment pages and assign each 4k segment to a ring element, which
      reduces the overall memory consumption on such architectures.  This
      helps avoiding errors like the example below:
      
      [bnx2x_alloc_rx_sge:435(eth1)]Can't alloc sge
      [c00000037ffeb900] [d000000075eddeb4] .bnx2x_alloc_rx_sge+0x44/0x200 [bnx2x]
      [c00000037ffeb9b0] [d000000075ee0b34] .bnx2x_fill_frag_skb+0x1ac/0x460 [bnx2x]
      [c00000037ffebac0] [d000000075ee11f0] .bnx2x_tpa_stop+0x160/0x2e8 [bnx2x]
      [c00000037ffebb90] [d000000075ee1560] .bnx2x_rx_int+0x1e8/0xc30 [bnx2x]
      [c00000037ffebcd0] [d000000075ee2084] .bnx2x_poll+0xdc/0x3d8 [bnx2x] (unreliable)
      Signed-off-by: NGabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
      Acked-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Reviewed-by: NLino Sanfilippo <LinoSanfilippo@gmx.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4cace675
  5. 30 4月, 2015 1 次提交
  6. 20 9月, 2014 2 次提交
  7. 23 8月, 2014 1 次提交
    • D
      bnx2x: Utilize FW 7.10.51 · e42780b6
      Dmitry Kravkov 提交于
       - (L2) In some multi-function configurations, inter-PF and inter-VF
         Tx switching is incorrectly enabled.
      
       - (L2) Wrong assert code in FLR final cleanup in case it is sent not
         after FLR.
      
       - (L2) Chip may stall in very rare cases under heavy traffic with FW GRO
         enabled.
      
       - (L2) VF malicious notification error fixes.
      
       - (L2) Default gre tunnel to IPGRE which allows proper RSS for IPGRE packets,
         L2GRE traffic will reach single queue.
      
       - (FCoE) Fix data being placed in wrong buffer when corrupt FCoE frame is
         received.
      
       - (FCoE) Burst of FIP packets with destination MAC of ALL-FCF_MACs
         causes FCoE traffic to stop.
      Signed-off-by: NDmitry Kravkov <Dmitry.Kravkov@qlogic.com>
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NAriel Elior <Ariel.Elior@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e42780b6
  8. 31 5月, 2014 1 次提交
  9. 04 4月, 2014 1 次提交
    • J
      net: bnx2x: include irq.h for irqreturn_t definitions · df1efc2d
      Josh Boyer 提交于
      The bnx2x driver fails to build on ARM with:
      
      In file included from drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:28:0:
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h:243:1: error: unknown type name 'irqreturn_t'
       irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance);
       ^
      drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h:251:1: error: unknown type name 'irqreturn_t'
       irqreturn_t bnx2x_interrupt(int irq, void *dev_instance);
       ^
      
      Nothing in bnx2x_link.c or bnx2x_cmn.h is explicitly including the irq
      definitions, so we add an include of linux/irq.h to pick them up.
      Signed-off-by: NJosh Boyer <jwboyer@fedoraproject.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      df1efc2d
  10. 26 2月, 2014 1 次提交
    • J
      bnx2x: Remove hidden flow control goto from BNX2X_ALLOC macros · cd2b0389
      Joe Perches 提交于
      BNX2X_ALLOC macros use "goto alloc_mem_err"
      so these labels appear unused in some functions.
      
      Expand these macros in-place via coccinelle and
      some typing.
      
      Update the macros to use statement expressions
      and remove the BNX2X_ALLOC macro.
      
      This adds some > 80 char lines.
      
      $ cat bnx2x_pci_alloc.cocci
      @@
      expression e1;
      expression e2;
      expression e3;
      @@
      -	BNX2X_PCI_ALLOC(e1, e2, e3);
      +	e1 = BNX2X_PCI_ALLOC(e2, e3); if (!e1) goto alloc_mem_err;
      
      @@
      expression e1;
      expression e2;
      expression e3;
      @@
      -	BNX2X_PCI_FALLOC(e1, e2, e3);
      +	e1 = BNX2X_PCI_FALLOC(e2, e3); if (!e1) goto alloc_mem_err;
      
      @@
      expression e1;
      expression e2;
      @@
      -	BNX2X_ALLOC(e1, e2);
      +	e1 = kzalloc(e2, GFP_KERNEL); if (!e1) goto alloc_mem_err;
      
      @@
      expression e1;
      expression e2;
      expression e3;
      @@
      -	kzalloc(sizeof(e1) * e2, e3)
      +	kcalloc(e2, sizeof(e1), e3)
      
      @@
      expression e1;
      expression e2;
      expression e3;
      @@
      -	kzalloc(e1 * sizeof(e2), e3)
      +	kcalloc(e1, sizeof(e2), e3)
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cd2b0389
  11. 17 2月, 2014 1 次提交
  12. 13 2月, 2014 1 次提交
  13. 05 2月, 2014 1 次提交
  14. 14 1月, 2014 1 次提交
    • S
      bnx2x: namespace and dead code cleanups · a8f47eb7
      stephen hemminger 提交于
      Fix a bunch of whole lot of namespace issues with the Broadcom bnx2x driver
      found by running 'make namespacecheck'
      
       * global variables must be prefixed with bnx2x_
          naming a variable int_mode, or num_queue is invitation to disaster
      
       * make local functions static
      
       * move some inline's used in one file out of header
         (this driver has a bad case of inline-itis)
      
       * remove resulting dead code fallout
       	 bnx2x_pfc_statistic,
      	 bnx2x_emac_get_pfc_stat
       	 bnx2x_init_vlan_mac_obj,
         Looks like vlan mac support in this driver was a botch from day one
         either never worked, or not implemented or missing support functions
      
      Compile tested only.
      Signed-off-by: NStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a8f47eb7
  15. 11 1月, 2014 1 次提交
    • J
      net: core: explicitly select a txq before doing l2 forwarding · f663dd9a
      Jason Wang 提交于
      Currently, the tx queue were selected implicitly in ndo_dfwd_start_xmit(). The
      will cause several issues:
      
      - NETIF_F_LLTX were removed for macvlan, so txq lock were done for macvlan
        instead of lower device which misses the necessary txq synchronization for
        lower device such as txq stopping or frozen required by dev watchdog or
        control path.
      - dev_hard_start_xmit() was called with NULL txq which bypasses the net device
        watchdog.
      - dev_hard_start_xmit() does not check txq everywhere which will lead a crash
        when tso is disabled for lower device.
      
      Fix this by explicitly introducing a new param for .ndo_select_queue() for just
      selecting queues in the case of l2 forwarding offload. netdev_pick_tx() was also
      extended to accept this parameter and dev_queue_xmit_accel() was used to do l2
      forwarding transmission.
      
      With this fixes, NETIF_F_LLTX could be preserved for macvlan and there's no need
      to check txq against NULL in dev_hard_start_xmit(). Also there's no need to keep
      a dedicated ndo_dfwd_start_xmit() and we can just reuse the code of
      dev_queue_xmit() to do the transmission.
      
      In the future, it was also required for macvtap l2 forwarding support since it
      provides a necessary synchronization method.
      
      Cc: John Fastabend <john.r.fastabend@intel.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: e1000-devel@lists.sourceforge.net
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NNeil Horman <nhorman@tuxdriver.com>
      Acked-by: NJohn Fastabend <john.r.fastabend@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f663dd9a
  16. 06 9月, 2013 1 次提交
  17. 30 8月, 2013 1 次提交
  18. 02 8月, 2013 1 次提交
    • Y
      bnx2x: Revising locking scheme for MAC configuration · 8b09be5f
      Yuval Mintz 提交于
      On very rare occasions, repeated load/unload stress test in the presence of
      our storage driver (bnx2i/bnx2fc) causes a kernel panic in bnx2x code
      (NULL pointer dereference). Stack traces indicate the issue happens during MAC
      configuration; thorough code review showed that indeed several races exist
      in which one thread can iterate over the list of configured MACs while another
      deletes entries from the same list.
      
      This patch adds a varient on the single-writer/Multiple-reader lock mechanism -
      It utilizes an already exsiting bottom-half lock, using it so that Whenever
      a writer is unable to continue due to the existence of another writer/reader,
      it pends its request for future deliverance.
      The writer / last readers will check for the existence of such requests and
      perform them instead of the original initiator.
      This prevents the writer from having to sleep while waiting for the lock
      to be accessible, which might cause deadlocks given the locks already
      held by the writer.
      
      Another result of this patch is that setting of Rx Mode is now made in
      sleepable context - Setting of Rx Mode is made under a bottom-half lock, which
      was always nontrivial for the bnx2x driver, as the HW/FW configuration requires
      wait for completions.
      Since sleep was impossible (due to the sleepless-context), various mechanisms
      were utilized to prevent the calling thread from sleep, but the truth was that
      when the caller thread (i.e, the one calling ndo_set_rx_mode()) returned, the
      Rx mode was still not set in HW/FW.
      
      bnx2x_set_rx_mode() will now overtly schedule for the Rx changes to be
      configured by the sp_rtnl_task which hold the RTNL lock and is sleepable
      context.
      Signed-off-by: NYuval Mintz <yuvalmin@broadcom.com>
      Signed-off-by: NAriel Elior <ariele@broadcom.com>
      Signed-off-by: NEilon Greenstein <eilong@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8b09be5f
  19. 20 6月, 2013 2 次提交
  20. 03 6月, 2013 4 次提交
  21. 25 4月, 2013 1 次提交
    • Y
      bnx2x: Prevent NULL pointer dereference in kdump · ecf01c22
      Yuval Mintz 提交于
      In scenarios in which a previous driver was removed without proper cleanup
      (e.g., kdump), it is possible for the chip to generate an interrupt without
      any apparent reason once interrupts are requested.
      
      Due to an erroneous initialization of resources, some of the bnx2x structs
      which are required for interrupt handling are initialized only after an
      interface's interrupt is requested from the OS.
      
      As a result, once such a spurious interrupt occurs, it will cause a NULL
      pointer dereference - the driver will access those structs in its interrupt
      handling routine.
      
      This patch change the interrupt request scheme so that bnx2x would only
      request interrupts from the kernel after it has finished initializing
      all the inner structs required for interrupt handling.
      Signed-off-by: NYuval Mintz <yuvalmin@broadcom.com>
      Signed-off-by: NAriel Elior <ariele@broadcom.com>
      Signed-off-by: NEilon Greenstein <eilong@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ecf01c22
  22. 21 3月, 2013 1 次提交
  23. 19 3月, 2013 1 次提交
  24. 18 3月, 2013 1 次提交
  25. 12 3月, 2013 1 次提交
  26. 06 3月, 2013 1 次提交
  27. 24 1月, 2013 5 次提交
  28. 16 1月, 2013 2 次提交