Skip to contentSkip to conversation

net/ice: support mark only action for FDIR

PATCH Superseded Simei Su 3 participants 8 messages Apr 2, 2020 – May 6, 2020 Network drivers

lore
Share & tools
lore

Simei Su

author
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/ice/ice_fdir_filter.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/net/ice/ice_fdir_filter.c +12 -1
index a082a13..8acdb1a 100644
@@ -1469,6 +1469,10 @@
 	uint32_t counter_num = 0;
 	int ret;
 
+	/* set default action to PASSTHRU mode, in the case of MARK only. */
+	filter->input.dest_ctl =
+		ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER;
+
 	for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
 		switch (actions->type) {
 		case RTE_FLOW_ACTION_TYPE_VOID:
@@ -1533,7 +1537,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");
@@ -1554,6 +1558,13 @@
 		return -rte_errno;
 	}
 
+	if (dest_num + mark_num == 0) {
+		rte_flow_error_set(error, EINVAL,
+			RTE_FLOW_ERROR_TYPE_ACTION, actions,
+			"Emtpy action");
+		return -rte_errno;
+	}
+
 	return 0;
 }
 
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 26 lines

-----Original Message-----
From: Su, Simei <[email protected]>
Sent: Thursday, April 2, 2020 2:56 PM
To: Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; Su, Simei <[email protected]>; [email protected]
Subject: [PATCH] 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")
---
 drivers/net/ice/ice_fdir_filter.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/net/ice/ice_fdir_filter.c +0 -0
index a082a13..8acdb1a 100644

drivers/net/ice/ice_fdir_filter.c line 1474

Quoted 6 lines
drivers/net/ice/ice_fdir_filter.c +3 -0
@@ -1469,6 +1469,10 @@
 	uint32_t counter_num = 0;
 	int ret;
 
+	/* set default action to PASSTHRU mode, in the case of MARK only. */
+	filter->input.dest_ctl =
+		ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER;

Should we also consider the case "Count only",
I will suggest move above code to after all the action has been iterated and all criteria check has passed Then only set destination to PASSTHROUGH for no destination case.

If (dest_num == 0)

	filter->input.dest_ctl = ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER;
Quoted 29 lines
drivers/net/ice/ice_fdir_filter.c +2 -1
+
 	for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
 		switch (actions->type) {
 		case RTE_FLOW_ACTION_TYPE_VOID:
@@ -1533,7 +1537,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"); @@ -1554,6 +1558,13

@@

drivers/net/ice/ice_fdir_filter.c +7 -1
 		return -rte_errno;
 	}
 
+	if (dest_num + mark_num == 0) {
+		rte_flow_error_set(error, EINVAL,
+			RTE_FLOW_ERROR_TYPE_ACTION, actions,
+			"Emtpy action");
+		return -rte_errno;
+	}
+
 	return 0;
 }
 
--

1.8.3.1

author
#2 lore raw

Hi, Qi

Quoted 38 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Tuesday, April 14, 2020 3:49 PM
To: Su, Simei <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; [email protected]
Subject: RE: [PATCH] net/ice: support mark only action for FDIR

Quoted 29 lines

-----Original Message-----
From: Su, Simei <[email protected]>
Sent: Thursday, April 2, 2020 2:56 PM
To: Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; Su, Simei <[email protected]>; [email protected]
Subject: [PATCH] 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")
---
 drivers/net/ice/ice_fdir_filter.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/net/ice/ice_fdir_filter.c +0 -0
index a082a13..8acdb1a 100644
@@ -1469,6 +1469,10 @@
 	uint32_t counter_num = 0;
 	int ret;
 
Quoted 7 lines

drivers/net/ice/ice_fdir_filter.c line 1474

Quoted 3 lines
drivers/net/ice/ice_fdir_filter.c +3 -0
+	/* set default action to PASSTHRU mode, in the case of MARK only. */
+	filter->input.dest_ctl =
+		ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER;

Should we also consider the case "Count only", I will suggest move above code to after all the action has been iterated and all criteria check has passed Then only set destination to PASSTHROUGH for no destination case.

I don't know whether the case "Count only" should fail or means passthru + count. In my code, I return error when in the case "count only":

    	if (dest_num + mark_num == 0) {
		    rte_flow_error_set(error, EINVAL,
			   RTE_FLOW_ERROR_TYPE_ACTION, actions,
			   "Emtpy action");
		    return -rte_errno;
        }

So I want to confirm how to define "count only" case here, your suggestion code seems "count only" means "count + passthru" ?

Thanks
Simei

Quoted 35 lines

If (dest_num == 0)

	filter->input.dest_ctl =

ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER;

drivers/net/ice/ice_fdir_filter.c line 1543

Quoted 13 lines
drivers/net/ice/ice_fdir_filter.c +2 -1
+
 	for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
 		switch (actions->type) {
 		case RTE_FLOW_ACTION_TYPE_VOID:
@@ -1533,7 +1537,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"); @@ -1554,6 +1558,13

@@

Quoted 15 lines
drivers/net/ice/ice_fdir_filter.c +7 -1
 		return -rte_errno;
 	}
 
+	if (dest_num + mark_num == 0) {
+		rte_flow_error_set(error, EINVAL,
+			RTE_FLOW_ERROR_TYPE_ACTION, actions,
+			"Emtpy action");
+		return -rte_errno;
+	}
+
 	return 0;
 }
 
--

1.8.3.1

#3 lore raw
Quoted 59 lines

-----Original Message-----
From: Su, Simei <[email protected]>
Sent: Tuesday, April 14, 2020 5:12 PM
To: Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; [email protected]
Subject: RE: [PATCH] net/ice: support mark only action for FDIR

Hi, Qi

Quoted 40 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Tuesday, April 14, 2020 3:49 PM
To: Su, Simei <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; [email protected]
Subject: RE: [PATCH] net/ice: support mark only action for FDIR

Quoted 30 lines

-----Original Message-----
From: Su, Simei <[email protected]>
Sent: Thursday, April 2, 2020 2:56 PM
To: Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; Su, Simei <[email protected]>; [email protected]
Subject: [PATCH] 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: [email protected]

---
 drivers/net/ice/ice_fdir_filter.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/net/ice/ice_fdir_filter.c +0 -0
index a082a13..8acdb1a 100644
@@ -1469,6 +1469,10 @@
 uint32_t counter_num = 0;
 int ret;
 
Quoted 8 lines

drivers/net/ice/ice_fdir_filter.c line 1474

Quoted 4 lines
drivers/net/ice/ice_fdir_filter.c +4 -0
+/* set default action to PASSTHRU mode, in the case of MARK only.
+*/
+filter->input.dest_ctl =
+ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER;

Should we also consider the case "Count only", I will suggest move above code to after all the action has been iterated and all criteria check has passed Then only set destination to PASSTHROUGH for no

Quoted 4 lines

destination case.

I don't know whether the case "Count only" should fail or means passthru +
count.

It is the case that user may just want to count a number of the packets that match a specific pattern and don't care which destination it reached.,
Though I don't know if this could be a real usage, but I didn't think its necessary to reject this configure, and allow "count only" keep it consistent with "mark only" make the code easy to understand.

Quoted 49 lines

In my code, I return error when in the case "count only":

    if (dest_num + mark_num == 0) {
    rte_flow_error_set(error, EINVAL,
   RTE_FLOW_ERROR_TYPE_ACTION, actions,
   "Emtpy action");
    return -rte_errno;
        }

So I want to confirm how to define "count only" case here, your suggestion
code seems "count only" means "count + passthru" ?

Thanks
Simei

Quoted 32 lines

If (dest_num == 0)
filter->input.dest_ctl =
ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER;

drivers/net/ice/ice_fdir_filter.c line 1543

Quoted 12 lines
drivers/net/ice/ice_fdir_filter.c +1 -0
+
 for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {

switch (actions->type) { case RTE_FLOW_ACTION_TYPE_VOID:

drivers/net/ice/ice_fdir_filter.c +1 -1
@@ -1533,7 +1537,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"); @@ -1554,6 +1558,13

@@

Quoted 13 lines

return -rte_errno;
}

drivers/net/ice/ice_fdir_filter.c +5 -1
+if (dest_num + mark_num == 0) {
+rte_flow_error_set(error, EINVAL,
+RTE_FLOW_ERROR_TYPE_ACTION, actions, "Emtpy action"); return
+-rte_errno; }
+
 return 0;
 }
 
--

1.8.3.1

author
#4 lore raw
Quoted 72 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Tuesday, April 14, 2020 8:51 PM
To: Su, Simei <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; [email protected]
Subject: RE: [PATCH] net/ice: support mark only action for FDIR

Quoted 61 lines

-----Original Message-----
From: Su, Simei <[email protected]>
Sent: Tuesday, April 14, 2020 5:12 PM
To: Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; [email protected]
Subject: RE: [PATCH] net/ice: support mark only action for FDIR

Hi, Qi

Quoted 40 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Tuesday, April 14, 2020 3:49 PM
To: Su, Simei <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; [email protected]
Subject: RE: [PATCH] net/ice: support mark only action for FDIR

Quoted 30 lines

-----Original Message-----
From: Su, Simei <[email protected]>
Sent: Thursday, April 2, 2020 2:56 PM
To: Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; Su, Simei <[email protected]>; [email protected]
Subject: [PATCH] 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: [email protected]

---
 drivers/net/ice/ice_fdir_filter.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/net/ice/ice_fdir_filter.c +0 -0
index a082a13..8acdb1a 100644
@@ -1469,6 +1469,10 @@
 uint32_t counter_num = 0;
 int ret;
 
Quoted 9 lines

drivers/net/ice/ice_fdir_filter.c line 1474

Quoted 4 lines
drivers/net/ice/ice_fdir_filter.c +4 -0
+/* set default action to PASSTHRU mode, in the case of MARK only.
+*/
+filter->input.dest_ctl =
+ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER;

Should we also consider the case "Count only", I will suggest move above code to after all the action has been iterated and all criteria check has passed Then only set destination to PASSTHROUGH for no

destination case.

Quoted 9 lines
Quoted 2 lines

I don't know whether the case "Count only" should fail or means
passthru + count.

It is the case that user may just want to count a number of the packets that match a specific pattern and don't care which destination it reached., Though I don't know if this could be a real usage, but I didn't think its necessary to reject this configure, and allow "count only" keep it consistent with "mark only" make the code easy to understand.

Ok, got your idea. Thanks, Qi.

Br
Simei

Quoted 49 lines
Quoted 48 lines

In my code, I return error when in the case "count only":

    if (dest_num + mark_num == 0) {
    rte_flow_error_set(error, EINVAL,
   RTE_FLOW_ERROR_TYPE_ACTION, actions,
   "Emtpy action");
    return -rte_errno;
        }

So I want to confirm how to define "count only" case here, your
suggestion code seems "count only" means "count + passthru" ?

Thanks
Simei

Quoted 31 lines

If (dest_num == 0)
filter->input.dest_ctl =
ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER;

drivers/net/ice/ice_fdir_filter.c line 1543

Quoted 12 lines
drivers/net/ice/ice_fdir_filter.c +1 -0
+
 for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {

switch (actions->type) { case RTE_FLOW_ACTION_TYPE_VOID:

drivers/net/ice/ice_fdir_filter.c +1 -1
@@ -1533,7 +1537,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"); @@ -1554,6 +1558,13

@@

Quoted 12 lines

return -rte_errno;
}

drivers/net/ice/ice_fdir_filter.c +4 -1
+if (dest_num + mark_num == 0) {
+rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
+actions, "Emtpy action"); return -rte_errno; }
+
 return 0;
 }
 
--

1.8.3.1

author
#5 lore raw

PATCH v2 1/1 net/ice: support mark only action for FDIR

In reply to Simei Su

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")
---
 drivers/net/ice/ice_fdir_filter.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/net/ice/ice_fdir_filter.c +13 -1
index 1a85d6c..77c6ebb 100644
@@ -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;
 }
 
Signature · 1 line
1.8.3.1
Acked-by on v2 1/1
#6 lore raw
Quoted 10 lines

-----Original Message-----
From: Su, Simei <[email protected]>
Sent: Tuesday, April 14, 2020 11:11 PM
To: Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; Su, Simei <[email protected]>; [email protected]
Subject: [PATCH v2] net/ice: support mark only action for FDIR

Quoted 7 lines

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")
Applied
#7 lore raw
Quoted 13 lines · Qi Z
Quoted 13 lines

-----Original Message-----
From: Su, Simei <[email protected]>
Sent: Tuesday, April 14, 2020 11:11 PM
To: Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Cao, Yahui <[email protected]>; Su, Simei <[email protected]>; [email protected]
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.

Quoted 7 lines
Quoted 4 lines
Fixes f5cafa961fae ("net/ice: add flow director create and destroy")

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