diff mbox

[net,2/5] bnx2x: Correct number of MSI-X vectors for VFs

Message ID 1388939634-19948-3-git-send-email-yuvalmin@broadcom.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Yuval Mintz Jan. 5, 2014, 4:33 p.m. UTC
From: Michal Kalderon <michals@broadcom.com>

Number of VFs in PCIe configuration space is zero-based. Driver incorrectly
sets the number of VFs to be larger by one than what actually is feasible by
HW, which might cause later VFs to fail to allocate their MSI-X interrupts.

Signed-off-by: Michal Kalderon <michals@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Eric Dumazet Jan. 6, 2014, 4:28 p.m. UTC | #1
Caught this with latest net-next tree :

Does this ring a bell to you guys ?


[   27.339221] BUG: sleeping function called from invalid context at include/linux/netdevice.h:486
[   27.347927] in_atomic(): 1, irqs_disabled(): 0, pid: 5672, name: ethtool
[   27.354628] 1 lock held by ethtool/5672:
[   27.354629]  #0:  (rtnl_mutex){+.+.+.}, at: [<ffffffff814f3b97>] rtnl_lock+0x17/0x20
[   27.354641] CPU: 6 PID: 5672 Comm: ethtool Not tainted 3.13.0-dbg-DEV #430
[   27.354644]  0000000000000000 ffff880656881aa8 ffffffff81594454 0000000000000002
[   27.354648]  ffff88065d7f4ad0 ffff880656881ac8 ffffffff810c37af ffff880656881ac8
[   27.354651]  ffff880c50df8000 ffff880656881b18 ffffffffa00b8c18 ffff880c50df0940
[   27.354655] Call Trace:
[   27.354661]  [<ffffffff81594454>] dump_stack+0x4e/0x68
[   27.354666]  [<ffffffff810c37af>] __might_sleep+0xdf/0x110
[   27.354680]  [<ffffffffa00b8c18>] bnx2x_napi_disable.isra.84+0x58/0x130 [bnx2x]
[   27.354689]  [<ffffffffa00bdf65>] bnx2x_netif_stop+0x25/0x40 [bnx2x]
[   27.354696]  [<ffffffffa009123d>] bnx2x_chip_cleanup+0x24d/0x630 [bnx2x]
[   27.354700]  [<ffffffff810a2c55>] ? del_timer_sync+0x5/0xd0
[   27.354708]  [<ffffffffa00c0b40>] bnx2x_nic_unload+0x1f0/0x7f0 [bnx2x]
[   27.354714]  [<ffffffff8118e1af>] ? might_fault+0x5f/0xb0
[   27.354722]  [<ffffffffa00c3a0c>] bnx2x_reload_if_running+0x2c/0x50 [bnx2x]
[   27.354730]  [<ffffffffa00c57e4>] bnx2x_set_ringparam+0x2a4/0x400 [bnx2x]
[   27.354735]  [<ffffffff814ea242>] dev_ethtool+0x752/0x1b30
[   27.354741]  [<ffffffff810e3e1d>] ? trace_hardirqs_on+0xd/0x10
[   27.354743]  [<ffffffff814f3b97>] ? rtnl_lock+0x17/0x20
[   27.354747]  [<ffffffff814fa31d>] dev_ioctl+0x25d/0x5a0
[   27.354752]  [<ffffffff814c9746>] compat_sock_ioctl+0x4e6/0xa50
[   27.354757]  [<ffffffff815a0334>] ? __do_page_fault+0x2c4/0x560
[   27.354763]  [<ffffffff81224c08>] compat_sys_ioctl+0xc8/0x1500
[   27.354765]  [<ffffffff814c832b>] ? sock_map_fd+0x4b/0x70
[   27.354768]  [<ffffffff8159c989>] ? retint_swapgs+0xe/0x13
[   27.354771]  [<ffffffff810e3d45>] ? trace_hardirqs_on_caller+0x105/0x1d0
[   27.354774]  [<ffffffff813207ad>] ? trace_hardirqs_off_thunk+0x3a/0x3c
[   27.354779]  [<ffffffff815a65e5>] sysenter_dispatch+0x7/0x1f
[   27.354781]  [<ffffffff8132076e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[   28.096865] bnx2x 0000:03:00.0 eth0: using MSI-X  IRQs: sp 41  fp[0] 43 ... fp[3] 46
[   28.211869] bnx2x 0000:03:00.0 eth0: NIC Link is Up, 10000 Mbps full duplex, Flow control: ON - receive


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ariel Elior Jan. 6, 2014, 4:35 p.m. UTC | #2
> -----Original Message-----

> From: Eric Dumazet [mailto:eric.dumazet@gmail.com]

> Sent: Monday, January 06, 2014 6:28 PM

> To: Yuval Mintz

> Cc: davem@davemloft.net; netdev@vger.kernel.org; Ariel Elior; Michal

> Kalderon

> Subject: [BUG] bnx2x : lockdep assertion

> 

> Caught this with latest net-next tree :

> 

> Does this ring a bell to you guys ?

> 


Hi Eric,
This was introduced by the low latency patch which added a 'might_sleep()' to napi_disable a while ago.
There is a fix in the works.
Thanks,
Ariel
Eric Dumazet Jan. 6, 2014, 4:49 p.m. UTC | #3
On Mon, 2014-01-06 at 16:35 +0000, Ariel Elior wrote:

> Hi Eric,
> This was introduced by the low latency patch which added a 'might_sleep()' to napi_disable a while ago.
> There is a fix in the works.
> Thanks,

Hmm, commit 80c33ddd31d0e801953 is 3 months old.

Do you have an idea of ETA for the fix ?

Thanks !


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 2e46c28..ddd95b9 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -3202,13 +3202,16 @@  int bnx2x_enable_sriov(struct bnx2x *bp)
 		bnx2x_iov_static_resc(bp, vf);
 	}
 
-	/* prepare msix vectors in VF configuration space */
+	/* prepare msix vectors in VF configuration space - the value in the
+	 * PCI configuration space should be the index of the last entry,
+	 * namely one less than the actual size of the table
+	 */
 	for (vf_idx = first_vf; vf_idx < first_vf + req_vfs; vf_idx++) {
 		bnx2x_pretend_func(bp, HW_VF_HANDLE(bp, vf_idx));
 		REG_WR(bp, PCICFG_OFFSET + GRC_CONFIG_REG_VF_MSIX_CONTROL,
-		       num_vf_queues);
+		       num_vf_queues - 1);
 		DP(BNX2X_MSG_IOV, "set msix vec num in VF %d cfg space to %d\n",
-		   vf_idx, num_vf_queues);
+		   vf_idx, num_vf_queues - 1);
 	}
 	bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));