Skip to contentSkip to conversation

i40e: add check for null vsi

PATCH New Avinash Dayanand 2 participants 4 messages Feb 18, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 8/14 i40e: add check for null vsi

From: John Underwood <[email protected]>

Return from i40e_vsi_reinit_setup() if vsi param is NULL. This makes this code consistent with all the other code that checks for NULL before using one of the VSI pointers accessed with an indexed variable. (Indexed VSI pointers are intentionally set to NULL in i40e_vsi_clear() and i40e_remove().

v2: change patch title

Change-ID I3bc8b909c70fd2439334eeae994d151f61480985
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_main.c +6 -1
index 2a02f93..3c910ef 100644
@@ -9579,10 +9579,15 @@ vector_setup_out:
  **/
 static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)
 {
-	struct i40e_pf *pf = vsi->back;
+	struct i40e_pf *pf;
 	u8 enabled_tc;
 	int ret;
 
+	if (!vsi)
+		return NULL;
+
+	pf = vsi->back;
+
 	i40e_put_lump(pf->qp_pile, vsi->base_queue, vsi->idx);
 	i40e_vsi_clear_rings(vsi);
 
Signature · 1 line
2.1.0
#1 lore raw

PATCH v2 12/14 i40e: suspend scheduling during driver unload

From: Pandi Kumar Maharajan <[email protected]>

We need to suspend scheduling or any pending service task during driver unload process, so that new task will not be scheduled. This patch sets the suspend flag bit during reload which avoids service task execution.

v2: change patch title

Change-ID I017c57b5d6656564556e3c5387da671369a572ac
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +1 -0
index 7388c1a..50c2c71 100644
@@ -11211,6 +11211,7 @@ static void i40e_remove(struct pci_dev *pdev)
 	i40e_write_rx_ctl(hw, I40E_PFQF_HENA(1), 0);
 
 	/* no more scheduling of any task */
+	set_bit(__I40E_SUSPENDED, &pf->state);
 	set_bit(__I40E_DOWN, &pf->state);
 	del_timer_sync(&pf->service_timer);
 	cancel_work_sync(&pf->service_task);
Signature · 1 line
2.1.0
#2 lore raw

PATCH v2 12/14 i40e: suspend scheduling during driver unload

Quoted 14 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Avinash Dayanand
Sent: Thursday, February 18, 2016 9:19 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [v2 next PATCH S29 12/14] i40e: suspend scheduling during driver unload

From: Pandi Kumar Maharajan <[email protected]>

We need to suspend scheduling or any pending service task during driver unload process, so that new task will not be scheduled. This patch sets the suspend flag bit during reload which avoids service task execution.

Quoted 7 lines

v2: change patch title

Change-ID I017c57b5d6656564556e3c5387da671369a572ac
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
 1 file changed, 1 insertion(+)

Code changes properly applied

#3 lore raw

PATCH v2 8/14 i40e: add check for null vsi

In reply to Avinash Dayanand
Quoted 16 lines

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Avinash Dayanand
Sent: Thursday, February 18, 2016 9:19 AM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [v2 next PATCH S29 08/14] i40e: add check for null vsi

From: John Underwood <[email protected]>

Return from i40e_vsi_reinit_setup() if vsi param is NULL.
This makes this code consistent with all the other code that checks for NULL before using one of the VSI pointers accessed with an indexed variable. (Indexed VSI pointers are intentionally set to NULL in i40e_vsi_clear() and i40e_remove().

Quoted 7 lines

v2: change patch title

Change-ID I3bc8b909c70fd2439334eeae994d151f61480985
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Code changes properly applied