Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net] i40e: Fix oops at i40e_rebuild()
@ 2021-02-18 21:55 Arkadiusz Kubalewski
  2021-03-22 23:50 ` Brelinski, TonyX
  0 siblings, 1 reply; 2+ messages in thread
From: Arkadiusz Kubalewski @ 2021-02-18 21:55 UTC (permalink / raw)
  To: intel-wired-lan

Setup TC before the i40e_setup_pf_switch() call.
Memory must be inititalized for all the queues
before using its resources.

Previously it could be possible that a call:
xdp_rxq_info_reg(&rx_ring->xdp_rxq, rx_ring->netdev,
rx_ring->queue_index, rx_ring->q_vector->napi.napi_id);
was made with q_vector being null.

Oops could show up with the following sequence:
- no driver loaded
- FW LLDP agent is on (flag disable-fw-lldp:off)
- link is up
- DCB configured with number of Traffic Classes that will not divide
  completely the default number of queues (usually cpu cores)
- driver load
- set private flag: disable-fw-lldp:on

Fixes: 4b208eaa8078 ("i40e: Add init and default config of software based DCB")
Fixes: b02e5a0ebb17 ("xsk: Propagate napi_id to XDP socket Rx path")
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 65fed08..a9fdaee 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -10574,12 +10574,6 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
 		goto end_core_reset;
 	}
 
-	if (!lock_acquired)
-		rtnl_lock();
-	ret = i40e_setup_pf_switch(pf, reinit);
-	if (ret)
-		goto end_unlock;
-
 #ifdef CONFIG_I40E_DCB
 	/* Enable FW to write a default DCB config on link-up
 	 * unless I40E_FLAG_TC_MQPRIO was enabled or DCB
@@ -10608,6 +10602,11 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
 	}
 
 #endif /* CONFIG_I40E_DCB */
+	if (!lock_acquired)
+		rtnl_lock();
+	ret = i40e_setup_pf_switch(pf, reinit);
+	if (ret)
+		goto end_unlock;
 
 	/* The driver only wants link up/down and module qualification
 	 * reports from firmware.  Note the negative logic.

base-commit: acad41d948db537ceac9d50c132653d82222343c
-- 
2.18.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Intel-wired-lan] [PATCH net] i40e: Fix oops at i40e_rebuild()
  2021-02-18 21:55 [Intel-wired-lan] [PATCH net] i40e: Fix oops at i40e_rebuild() Arkadiusz Kubalewski
@ 2021-03-22 23:50 ` Brelinski, TonyX
  0 siblings, 0 replies; 2+ messages in thread
From: Brelinski, TonyX @ 2021-03-22 23:50 UTC (permalink / raw)
  To: intel-wired-lan

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Arkadiusz Kubalewski
> Sent: Thursday, February 18, 2021 1:56 PM
> To: intel-wired-lan at lists.osuosl.org
> Cc: Loktionov, Aleksandr <aleksandr.loktionov@intel.com>
> Subject: [Intel-wired-lan] [PATCH net] i40e: Fix oops at i40e_rebuild()
> 
> Setup TC before the i40e_setup_pf_switch() call.
> Memory must be inititalized for all the queues before using its resources.
> 
> Previously it could be possible that a call:
> xdp_rxq_info_reg(&rx_ring->xdp_rxq, rx_ring->netdev, rx_ring-
> >queue_index, rx_ring->q_vector->napi.napi_id); was made with q_vector
> being null.
> 
> Oops could show up with the following sequence:
> - no driver loaded
> - FW LLDP agent is on (flag disable-fw-lldp:off)
> - link is up
> - DCB configured with number of Traffic Classes that will not divide
>   completely the default number of queues (usually cpu cores)
> - driver load
> - set private flag: disable-fw-lldp:on
> 
> Fixes: 4b208eaa8078 ("i40e: Add init and default config of software based
> DCB")
> Fixes: b02e5a0ebb17 ("xsk: Propagate napi_id to XDP socket Rx path")
> Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_main.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)

Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> A Contingent Worker at Intel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-22 23:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-18 21:55 [Intel-wired-lan] [PATCH net] i40e: Fix oops at i40e_rebuild() Arkadiusz Kubalewski
2021-03-22 23:50 ` Brelinski, TonyX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox