[v2] net/ice: fix FDIR flag issue
diff mbox series

Message ID 1579606931-77414-1-git-send-email-beilei.xing@intel.com
State Accepted
Delegated to: xiaolong ye
Headers show
Series
  • [v2] net/ice: fix FDIR flag issue
Related show

Checks

Context Check Description
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Beilei Xing Jan. 21, 2020, 11:42 a.m. UTC
If there's no mark action when creating a FDIR rule,
there shouldn't be FDIR flags in mbuf.

Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
Fixes: bd984f155f49 ("net/ice/base: support FDIR")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
---

V2 change:
 - Code refine.

 drivers/net/ice/base/ice_fdir.c   | 2 +-
 drivers/net/ice/base/ice_fdir.h   | 1 +
 drivers/net/ice/ice_fdir_filter.c | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

Comments

Ye Xiaolong Jan. 22, 2020, 8:08 a.m. UTC | #1
On 01/21, Beilei Xing wrote:
>If there's no mark action when creating a FDIR rule,
>there shouldn't be FDIR flags in mbuf.
>
>Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
>Fixes: bd984f155f49 ("net/ice/base: support FDIR")
>Cc: stable@dpdk.org
>
>Signed-off-by: Beilei Xing <beilei.xing@intel.com>
>Acked-by: Qi Zhang <qi.z.zhang@intel.com>
>---
>
>V2 change:
> - Code refine.
>
> drivers/net/ice/base/ice_fdir.c   | 2 +-
> drivers/net/ice/base/ice_fdir.h   | 1 +
> drivers/net/ice/ice_fdir_filter.c | 1 +
> 3 files changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c
>index 87fa0af..20d64f8 100644
>--- a/drivers/net/ice/base/ice_fdir.c
>+++ b/drivers/net/ice/base/ice_fdir.c
>@@ -418,7 +418,7 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input,
> 	fdir_fltr_ctx.swap = ICE_FXD_FLTR_QW1_SWAP_NOT_SET;
> 	fdir_fltr_ctx.comp_q = ICE_FXD_FLTR_QW0_COMP_Q_ZERO;
> 	fdir_fltr_ctx.comp_report = ICE_FXD_FLTR_QW0_COMP_REPORT_SW;
>-	fdir_fltr_ctx.fdid_prio = 3;
>+	fdir_fltr_ctx.fdid_prio = input->fdid_prio;
> 	fdir_fltr_ctx.desc_prof = 1;
> 	fdir_fltr_ctx.desc_prof_prio = 3;
> 	ice_set_fd_desc_val(&fdir_fltr_ctx, fdesc);
>diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h
>index db1f835..c811f76 100644
>--- a/drivers/net/ice/base/ice_fdir.h
>+++ b/drivers/net/ice/base/ice_fdir.h
>@@ -202,6 +202,7 @@ struct ice_fdir_fltr {
> 	u8 cnt_ena;
> 	u8 fltr_status;
> 	u16 cnt_index;
>+	u8 fdid_prio;
> 	u32 fltr_id;
> };
> 
>diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
>index fa87074..42b9628 100644
>--- a/drivers/net/ice/ice_fdir_filter.c
>+++ b/drivers/net/ice/ice_fdir_filter.c
>@@ -1504,6 +1504,7 @@ ice_fdir_parse_action(struct ice_adapter *ad,
> 
> 			mark_spec = actions->conf;
> 			filter->input.fltr_id = mark_spec->id;
>+			filter->input.fdid_prio = ICE_FXD_FLTR_QW1_FDID_PRI_ONE;
> 			break;
> 		case RTE_FLOW_ACTION_TYPE_COUNT:
> 			counter_num++;
>-- 
>2.7.4
>

Applied to dpdk-next-net-intel, Thanks.

Patch
diff mbox series

diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c
index 87fa0af..20d64f8 100644
--- a/drivers/net/ice/base/ice_fdir.c
+++ b/drivers/net/ice/base/ice_fdir.c
@@ -418,7 +418,7 @@  ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input,
 	fdir_fltr_ctx.swap = ICE_FXD_FLTR_QW1_SWAP_NOT_SET;
 	fdir_fltr_ctx.comp_q = ICE_FXD_FLTR_QW0_COMP_Q_ZERO;
 	fdir_fltr_ctx.comp_report = ICE_FXD_FLTR_QW0_COMP_REPORT_SW;
-	fdir_fltr_ctx.fdid_prio = 3;
+	fdir_fltr_ctx.fdid_prio = input->fdid_prio;
 	fdir_fltr_ctx.desc_prof = 1;
 	fdir_fltr_ctx.desc_prof_prio = 3;
 	ice_set_fd_desc_val(&fdir_fltr_ctx, fdesc);
diff --git a/drivers/net/ice/base/ice_fdir.h b/drivers/net/ice/base/ice_fdir.h
index db1f835..c811f76 100644
--- a/drivers/net/ice/base/ice_fdir.h
+++ b/drivers/net/ice/base/ice_fdir.h
@@ -202,6 +202,7 @@  struct ice_fdir_fltr {
 	u8 cnt_ena;
 	u8 fltr_status;
 	u16 cnt_index;
+	u8 fdid_prio;
 	u32 fltr_id;
 };
 
diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index fa87074..42b9628 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1504,6 +1504,7 @@  ice_fdir_parse_action(struct ice_adapter *ad,
 
 			mark_spec = actions->conf;
 			filter->input.fltr_id = mark_spec->id;
+			filter->input.fdid_prio = ICE_FXD_FLTR_QW1_FDID_PRI_ONE;
 			break;
 		case RTE_FLOW_ACTION_TYPE_COUNT:
 			counter_num++;