netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-04-04 (ice)
@ 2023-04-04 17:23 Tony Nguyen
  2023-04-04 17:23 ` [PATCH net 1/2] ice: fix wrong fallback logic for FDIR Tony Nguyen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tony Nguyen @ 2023-04-04 17:23 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev; +Cc: Tony Nguyen

This series contains updates to ice driver only.

Simei adjusts error path on adding VF Flow Director filters that were
not releasing all resources.

Lingyu adds setting/resetting of VF Flow Director filters counters
during initialization.

The following are changes since commit 218c597325f4faf7b7a6049233a30d7842b5b2dc:
  net: stmmac: fix up RX flow hash indirection table when setting channels
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE

Lingyu Liu (1):
  ice: Reset FDIR counter in FDIR init stage

Simei Su (1):
  ice: fix wrong fallback logic for FDIR

 .../ethernet/intel/ice/ice_virtchnl_fdir.c    | 23 ++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

-- 
2.38.1


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

* [PATCH net 1/2] ice: fix wrong fallback logic for FDIR
  2023-04-04 17:23 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-04-04 (ice) Tony Nguyen
@ 2023-04-04 17:23 ` Tony Nguyen
  2023-04-04 17:23 ` [PATCH net 2/2] ice: Reset FDIR counter in FDIR init stage Tony Nguyen
  2023-04-06  0:30 ` [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-04-04 (ice) patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Tony Nguyen @ 2023-04-04 17:23 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Simei Su, anthony.l.nguyen, Rafal Romanowski

From: Simei Su <simei.su@intel.com>

When adding a FDIR filter, if ice_vc_fdir_set_irq_ctx returns failure,
the inserted fdir entry will not be removed and if ice_vc_fdir_write_fltr
returns failure, the fdir context info for irq handler will not be cleared
which may lead to inconsistent or memory leak issue. This patch refines
failure cases to resolve this issue.

Fixes: 1f7ea1cd6a37 ("ice: Enable FDIR Configure for AVF")
Signed-off-by: Simei Su <simei.su@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
index 5fd75e75772e..4d007d8c2540 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
@@ -1871,7 +1871,7 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg)
 		v_ret = VIRTCHNL_STATUS_SUCCESS;
 		stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE;
 		dev_dbg(dev, "VF %d: set FDIR context failed\n", vf->vf_id);
-		goto err_free_conf;
+		goto err_rem_entry;
 	}
 
 	ret = ice_vc_fdir_write_fltr(vf, conf, true, is_tun);
@@ -1880,15 +1880,16 @@ int ice_vc_add_fdir_fltr(struct ice_vf *vf, u8 *msg)
 		stat->status = VIRTCHNL_FDIR_FAILURE_RULE_NORESOURCE;
 		dev_err(dev, "VF %d: writing FDIR rule failed, ret:%d\n",
 			vf->vf_id, ret);
-		goto err_rem_entry;
+		goto err_clr_irq;
 	}
 
 exit:
 	kfree(stat);
 	return ret;
 
-err_rem_entry:
+err_clr_irq:
 	ice_vc_fdir_clear_irq_ctx(vf);
+err_rem_entry:
 	ice_vc_fdir_remove_entry(vf, conf, conf->flow_id);
 err_free_conf:
 	devm_kfree(dev, conf);
-- 
2.38.1


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

* [PATCH net 2/2] ice: Reset FDIR counter in FDIR init stage
  2023-04-04 17:23 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-04-04 (ice) Tony Nguyen
  2023-04-04 17:23 ` [PATCH net 1/2] ice: fix wrong fallback logic for FDIR Tony Nguyen
@ 2023-04-04 17:23 ` Tony Nguyen
  2023-04-06  0:30 ` [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-04-04 (ice) patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Tony Nguyen @ 2023-04-04 17:23 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, netdev
  Cc: Lingyu Liu, anthony.l.nguyen, Junfeng Guo, Rafal Romanowski

From: Lingyu Liu <lingyu.liu@intel.com>

Reset the FDIR counters when FDIR inits. Without this patch,
when VF initializes or resets, all the FDIR counters are not
cleaned, which may cause unexpected behaviors for future FDIR
rule create (e.g., rule conflict).

Fixes: 1f7ea1cd6a37 ("ice: Enable FDIR Configure for AVF")
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Lingyu Liu <lingyu.liu@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 .../net/ethernet/intel/ice/ice_virtchnl_fdir.c   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
index 4d007d8c2540..daa6a1e894cf 100644
--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_fdir.c
@@ -541,6 +541,21 @@ static void ice_vc_fdir_rem_prof_all(struct ice_vf *vf)
 	}
 }
 
+/**
+ * ice_vc_fdir_reset_cnt_all - reset all FDIR counters for this VF FDIR
+ * @fdir: pointer to the VF FDIR structure
+ */
+static void ice_vc_fdir_reset_cnt_all(struct ice_vf_fdir *fdir)
+{
+	enum ice_fltr_ptype flow;
+
+	for (flow = ICE_FLTR_PTYPE_NONF_NONE;
+	     flow < ICE_FLTR_PTYPE_MAX; flow++) {
+		fdir->fdir_fltr_cnt[flow][0] = 0;
+		fdir->fdir_fltr_cnt[flow][1] = 0;
+	}
+}
+
 /**
  * ice_vc_fdir_has_prof_conflict
  * @vf: pointer to the VF structure
@@ -1998,6 +2013,7 @@ void ice_vf_fdir_init(struct ice_vf *vf)
 	spin_lock_init(&fdir->ctx_lock);
 	fdir->ctx_irq.flags = 0;
 	fdir->ctx_done.flags = 0;
+	ice_vc_fdir_reset_cnt_all(fdir);
 }
 
 /**
-- 
2.38.1


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

* Re: [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-04-04 (ice)
  2023-04-04 17:23 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-04-04 (ice) Tony Nguyen
  2023-04-04 17:23 ` [PATCH net 1/2] ice: fix wrong fallback logic for FDIR Tony Nguyen
  2023-04-04 17:23 ` [PATCH net 2/2] ice: Reset FDIR counter in FDIR init stage Tony Nguyen
@ 2023-04-06  0:30 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-04-06  0:30 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, pabeni, edumazet, netdev

Hello:

This series was applied to netdev/net.git (main)
by Tony Nguyen <anthony.l.nguyen@intel.com>:

On Tue,  4 Apr 2023 10:23:04 -0700 you wrote:
> This series contains updates to ice driver only.
> 
> Simei adjusts error path on adding VF Flow Director filters that were
> not releasing all resources.
> 
> Lingyu adds setting/resetting of VF Flow Director filters counters
> during initialization.
> 
> [...]

Here is the summary with links:
  - [net,1/2] ice: fix wrong fallback logic for FDIR
    https://git.kernel.org/netdev/net/c/b4a01ace20f5
  - [net,2/2] ice: Reset FDIR counter in FDIR init stage
    https://git.kernel.org/netdev/net/c/83c911dc5e0e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-04-06  0:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-04 17:23 [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-04-04 (ice) Tony Nguyen
2023-04-04 17:23 ` [PATCH net 1/2] ice: fix wrong fallback logic for FDIR Tony Nguyen
2023-04-04 17:23 ` [PATCH net 2/2] ice: Reset FDIR counter in FDIR init stage Tony Nguyen
2023-04-06  0:30 ` [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates 2023-04-04 (ice) patchwork-bot+netdevbpf

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).