[v2] net/ice: support mark only action for FDIR

Message ID 1586877073-450369-1-git-send-email-simei.su@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers
Series [v2] net/ice: support mark only action for FDIR |

Checks

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

Commit Message

Simei Su April 14, 2020, 3:11 p.m. UTC
  This patch fixes issue that doesn't support mark only case.
Mark only action is equal to mark + passthru action.

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

Signed-off-by: Simei Su <simei.su@intel.com>
---
 drivers/net/ice/ice_fdir_filter.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
  

Comments

Qi Zhang April 30, 2020, 9:19 a.m. UTC | #1
> -----Original Message-----
> From: Su, Simei <simei.su@intel.com>
> Sent: Tuesday, April 14, 2020 11:11 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>
> Cc: dev@dpdk.org; Cao, Yahui <yahui.cao@intel.com>; Su, Simei
> <simei.su@intel.com>; stable@dpdk.org
> Subject: [PATCH v2] net/ice: support mark only action for FDIR
> 
> This patch fixes issue that doesn't support mark only case.
> Mark only action is equal to mark + passthru action.
> 
> Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Simei Su <simei.su@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  
Xiaolong Ye May 6, 2020, 5:27 a.m. UTC | #2
On 04/30, Zhang, Qi Z wrote:
>
>
>> -----Original Message-----
>> From: Su, Simei <simei.su@intel.com>
>> Sent: Tuesday, April 14, 2020 11:11 PM
>> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>
>> Cc: dev@dpdk.org; Cao, Yahui <yahui.cao@intel.com>; Su, Simei
>> <simei.su@intel.com>; stable@dpdk.org
>> Subject: [PATCH v2] net/ice: support mark only action for FDIR
>> 
>> This patch fixes issue that doesn't support mark only case.
>> Mark only action is equal to mark + passthru action.
>> 
>> Fixes: f5cafa961fae ("net/ice: add flow director create and destroy")
>> Cc: stable@dpdk.org
>> 
>> Signed-off-by: Simei Su <simei.su@intel.com>
>
>Acked-by: Qi Zhang <qi.z.zhang@intel.com>
>

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

Patch

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 1a85d6c..77c6ebb 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1539,7 +1539,7 @@ 
 		}
 	}
 
-	if (dest_num == 0 || dest_num >= 2) {
+	if (dest_num >= 2) {
 		rte_flow_error_set(error, EINVAL,
 			   RTE_FLOW_ERROR_TYPE_ACTION, actions,
 			   "Unsupported action combination");
@@ -1560,6 +1560,18 @@ 
 		return -rte_errno;
 	}
 
+	if (dest_num + mark_num + counter_num == 0) {
+		rte_flow_error_set(error, EINVAL,
+			   RTE_FLOW_ERROR_TYPE_ACTION, actions,
+			   "Emtpy action");
+		return -rte_errno;
+	}
+
+	/* set default action to PASSTHRU mode, in "mark/count only" case. */
+	if (dest_num == 0)
+		filter->input.dest_ctl =
+			ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER;
+
 	return 0;
 }