DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ice: fix removal of FDIR profile
@ 2019-11-05  3:05 Wang ShougangX
  2019-11-07  3:29 ` Ye Xiaolong
  0 siblings, 1 reply; 2+ messages in thread
From: Wang ShougangX @ 2019-11-05  3:05 UTC (permalink / raw)
  To: dev; +Cc: qiming.yang, beilei.xing, Wang ShougangX, stable

The removal of FDIR profile should start from ICE_FLTR_PTYPE_NONF_IPV4_UDP.

Fixes: 109e8e06249e ("net/ice: configure HW flow director rule")
Cc: stable@dpdk.org

Signed-off-by: Wang ShougangX <shougangx.wang@intel.com>
---
 drivers/net/ice/ice_fdir_filter.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 736ccd54e..e426c1431 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -159,6 +159,10 @@ ice_fdir_prof_alloc(struct ice_hw *hw)
 		if (!hw->fdir_prof)
 			return -ENOMEM;
 	}
+
+	/* To avoid wild pointer, unused field pointer should be NULL */
+	hw->fdir_prof[ICE_FLTR_PTYPE_NONF_NONE] = NULL;
+
 	for (ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
 	     ptype < ICE_FLTR_PTYPE_MAX;
 	     ptype++) {
@@ -177,6 +181,7 @@ ice_fdir_prof_alloc(struct ice_hw *hw)
 	     fltr_ptype++)
 		rte_free(hw->fdir_prof[fltr_ptype]);
 	rte_free(hw->fdir_prof);
+	hw->fdir_prof = NULL;
 	return -ENOMEM;
 }
 
@@ -573,7 +578,7 @@ ice_fdir_prof_rm_all(struct ice_pf *pf)
 {
 	enum ice_fltr_ptype ptype;
 
-	for (ptype = ICE_FLTR_PTYPE_NONF_NONE;
+	for (ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
 	     ptype < ICE_FLTR_PTYPE_MAX;
 	     ptype++) {
 		ice_fdir_prof_rm(pf, ptype, false);
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] net/ice: fix removal of FDIR profile
  2019-11-05  3:05 [dpdk-dev] [PATCH] net/ice: fix removal of FDIR profile Wang ShougangX
@ 2019-11-07  3:29 ` Ye Xiaolong
  0 siblings, 0 replies; 2+ messages in thread
From: Ye Xiaolong @ 2019-11-07  3:29 UTC (permalink / raw)
  To: Wang ShougangX; +Cc: dev, qiming.yang, beilei.xing, stable

On 11/05, Wang ShougangX wrote:
>The removal of FDIR profile should start from ICE_FLTR_PTYPE_NONF_IPV4_UDP.
>
>Fixes: 109e8e06249e ("net/ice: configure HW flow director rule")
>Cc: stable@dpdk.org
>
>Signed-off-by: Wang ShougangX <shougangx.wang@intel.com>
>---
> drivers/net/ice/ice_fdir_filter.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
>index 736ccd54e..e426c1431 100644
>--- a/drivers/net/ice/ice_fdir_filter.c
>+++ b/drivers/net/ice/ice_fdir_filter.c
>@@ -159,6 +159,10 @@ ice_fdir_prof_alloc(struct ice_hw *hw)
> 		if (!hw->fdir_prof)
> 			return -ENOMEM;
> 	}
>+
>+	/* To avoid wild pointer, unused field pointer should be NULL */
>+	hw->fdir_prof[ICE_FLTR_PTYPE_NONF_NONE] = NULL;
>+
> 	for (ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
> 	     ptype < ICE_FLTR_PTYPE_MAX;
> 	     ptype++) {
>@@ -177,6 +181,7 @@ ice_fdir_prof_alloc(struct ice_hw *hw)
> 	     fltr_ptype++)
> 		rte_free(hw->fdir_prof[fltr_ptype]);
> 	rte_free(hw->fdir_prof);
>+	hw->fdir_prof = NULL;

Above two changes are irrelevant to this commit, you should add them into 
your wild pointer fix.

Besides, I'd suggest to submit your related fixes in a patchset with a cover
letter for the convenience of review.

Thanks,
Xiaolong

> 	return -ENOMEM;
> }
> 
>@@ -573,7 +578,7 @@ ice_fdir_prof_rm_all(struct ice_pf *pf)
> {
> 	enum ice_fltr_ptype ptype;
> 
>-	for (ptype = ICE_FLTR_PTYPE_NONF_NONE;
>+	for (ptype = ICE_FLTR_PTYPE_NONF_IPV4_UDP;
> 	     ptype < ICE_FLTR_PTYPE_MAX;
> 	     ptype++) {
> 		ice_fdir_prof_rm(pf, ptype, false);
>-- 
>2.17.1
>

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

end of thread, other threads:[~2019-11-07  3:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05  3:05 [dpdk-dev] [PATCH] net/ice: fix removal of FDIR profile Wang ShougangX
2019-11-07  3:29 ` Ye Xiaolong

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