* [PATCH net 0/2] bnx2x: Bug fixes patch series
@ 2013-10-27 11:06 Yuval Mintz
2013-10-27 11:07 ` [PATCH net 1/2] bnx2x: prevent FW assert on low mem during unload Yuval Mintz
2013-10-27 11:07 ` [PATCH net 2/2] bnx2x: Disable VF access on PF removal Yuval Mintz
0 siblings, 2 replies; 3+ messages in thread
From: Yuval Mintz @ 2013-10-27 11:06 UTC (permalink / raw)
To: davem, netdev; +Cc: dmitry, ariele, eilong
Hi Dave,
This series contains 2 unrelated fixes:
1. FW asserts during unload might be encountered if specific memory
allocations fail during load.
2. SR-IOV related, fixes a crash that will occour if the driver were to
be rmmoded and then re-probed while there are both assigned and unassigned
VFs originating from the same PF.
Please consider applying these patches to `net'.
Thanks,
Yuval Mintz
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH net 1/2] bnx2x: prevent FW assert on low mem during unload
2013-10-27 11:06 [PATCH net 0/2] bnx2x: Bug fixes patch series Yuval Mintz
@ 2013-10-27 11:07 ` Yuval Mintz
2013-10-27 11:07 ` [PATCH net 2/2] bnx2x: Disable VF access on PF removal Yuval Mintz
1 sibling, 0 replies; 3+ messages in thread
From: Yuval Mintz @ 2013-10-27 11:07 UTC (permalink / raw)
To: davem, netdev; +Cc: dmitry, ariele, eilong, Yuval Mintz
From: Dmitry Kravkov <dmitry@broadcom.com>
Buffers for FW statistics were allocated at an inappropriate time; In a machine
where the driver encounters problems allocating all of its queues, the driver
would still create FW requests for the statistics of the non-existing queues.
The wrong order of memory allocation could lead to zeroed statistics messages
being sent, leading to fw assert in case function 0 was down.
This changes the order of allocations, guaranteeing that statistic requests will
only be generated for actual queues.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Ariel Elior <ariele@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 4ab4c89..74d6486 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2545,10 +2545,6 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
}
}
- /* Allocated memory for FW statistics */
- if (bnx2x_alloc_fw_stats_mem(bp))
- LOAD_ERROR_EXIT(bp, load_error0);
-
/* need to be done after alloc mem, since it's self adjusting to amount
* of memory available for RSS queues
*/
@@ -2558,6 +2554,10 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
LOAD_ERROR_EXIT(bp, load_error0);
}
+ /* Allocated memory for FW statistics */
+ if (bnx2x_alloc_fw_stats_mem(bp))
+ LOAD_ERROR_EXIT(bp, load_error0);
+
/* request pf to initialize status blocks */
if (IS_VF(bp)) {
rc = bnx2x_vfpf_init(bp);
@@ -2812,8 +2812,8 @@ load_error1:
if (IS_PF(bp))
bnx2x_clear_pf_load(bp);
load_error0:
- bnx2x_free_fp_mem(bp);
bnx2x_free_fw_stats_mem(bp);
+ bnx2x_free_fp_mem(bp);
bnx2x_free_mem(bp);
return rc;
--
1.8.1.227.g44fe835
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH net 2/2] bnx2x: Disable VF access on PF removal
2013-10-27 11:06 [PATCH net 0/2] bnx2x: Bug fixes patch series Yuval Mintz
2013-10-27 11:07 ` [PATCH net 1/2] bnx2x: prevent FW assert on low mem during unload Yuval Mintz
@ 2013-10-27 11:07 ` Yuval Mintz
1 sibling, 0 replies; 3+ messages in thread
From: Yuval Mintz @ 2013-10-27 11:07 UTC (permalink / raw)
To: davem, netdev; +Cc: dmitry, ariele, eilong, Yuval Mintz
From: Ariel Elior <ariele@broadcom.com>
When the bnx2x driver is rmmoded, if VFs of a given PF will be assigned
to a VM then that PF will be unable to call `pci_disable_sriov()'.
If for that same PF there would also exist unassigned VFs in the hypervisor,
the result will be that after the removal there will still be virtual PCI
functions on the hypervisor.
If the bnx2x module were to be re-inserted, the result will be that the VFs
on the hypervisor will be re-probed directly following the PF's probe, even
though that in regular loading flow sriov is only enabled once PF is loaded.
The probed VF will then try to access its bar, causing a PCI error as the HW
is not in a state enabling such a request.
This patch adds a missing disablement procedure to the PF's removal, one that
sets registers viewable to the VF to indicate that the VFs have no permission
to access the bar, thus resulting in probe errors instead of PCI errors.
Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index bf08ad6..5e07efb 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -2018,6 +2018,8 @@ failed:
void bnx2x_iov_remove_one(struct bnx2x *bp)
{
+ int vf_idx;
+
/* if SRIOV is not enabled there's nothing to do */
if (!IS_SRIOV(bp))
return;
@@ -2026,6 +2028,18 @@ void bnx2x_iov_remove_one(struct bnx2x *bp)
pci_disable_sriov(bp->pdev);
DP(BNX2X_MSG_IOV, "sriov disabled\n");
+ /* disable access to all VFs */
+ for (vf_idx = 0; vf_idx < bp->vfdb->sriov.total; vf_idx++) {
+ bnx2x_pretend_func(bp,
+ HW_VF_HANDLE(bp,
+ bp->vfdb->sriov.first_vf_in_pf +
+ vf_idx));
+ DP(BNX2X_MSG_IOV, "disabling internal access for vf %d\n",
+ bp->vfdb->sriov.first_vf_in_pf + vf_idx);
+ bnx2x_vf_enable_internal(bp, 0);
+ bnx2x_pretend_func(bp, BP_ABS_FUNC(bp));
+ }
+
/* free vf database */
__bnx2x_iov_free_vfdb(bp);
}
@@ -3197,7 +3211,7 @@ int bnx2x_enable_sriov(struct bnx2x *bp)
* the "acquire" messages to appear on the VF PF channel.
*/
DP(BNX2X_MSG_IOV, "about to call enable sriov\n");
- pci_disable_sriov(bp->pdev);
+ bnx2x_disable_sriov(bp);
rc = pci_enable_sriov(bp->pdev, req_vfs);
if (rc) {
BNX2X_ERR("pci_enable_sriov failed with %d\n", rc);
--
1.8.1.227.g44fe835
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-27 11:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-27 11:06 [PATCH net 0/2] bnx2x: Bug fixes patch series Yuval Mintz
2013-10-27 11:07 ` [PATCH net 1/2] bnx2x: prevent FW assert on low mem during unload Yuval Mintz
2013-10-27 11:07 ` [PATCH net 2/2] bnx2x: Disable VF access on PF removal Yuval Mintz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).