DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 0/6] fix the set flow actions
@ 2023-02-21  6:49 Chaoyong He
  2023-02-21  6:49 ` [PATCH 1/6] net/nfp: fix the set MAC flow action Chaoyong He
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21  6:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

The former logic of set flow actions don't consider the mask filed
of control message passed to the firmware, and this caused the
firmware skip the set action logic wrongly.
This patch series aims to fix this problem.

Chaoyong He (6):
  net/nfp: fix the set MAC flow action
  net/nfp: fix the set IPv4 flow action
  net/nfp: fix the set IPv6 flow action
  net/nfp: fix the set TP flow action
  net/nfp: fix the set TTL flow action
  net/nfp: fix the set IPv4/v6 DSCP flow action

 drivers/net/nfp/nfp_flow.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

-- 
2.29.3


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

* [PATCH 1/6] net/nfp: fix the set MAC flow action
  2023-02-21  6:49 [PATCH 0/6] fix the set flow actions Chaoyong He
@ 2023-02-21  6:49 ` Chaoyong He
  2023-02-21  6:49 ` [PATCH 2/6] net/nfp: fix the set IPv4 " Chaoyong He
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21  6:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set MAC source/destination address flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right MAC address as expected.

Fixes: 4f6983154570 ("net/nfp: support MAC source flow action")
Fixes: eecc7ca3088a ("net/nfp: support MAC destination flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 0c38925701..f373171d7e 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2066,6 +2066,7 @@ nfp_flow_action_set_mac(char *act_data,
 		bool mac_src_flag,
 		bool mac_set_flag)
 {
+	uint8_t i;
 	size_t act_size;
 	struct nfp_fl_act_set_eth *set_eth;
 	const struct rte_flow_action_set_mac *set_mac;
@@ -2084,9 +2085,13 @@ nfp_flow_action_set_mac(char *act_data,
 	if (mac_src_flag) {
 		rte_memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN],
 				set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+		for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
+			set_eth->eth_addr_mask[RTE_ETHER_ADDR_LEN + i] = 0xff;
 	} else {
 		rte_memcpy(&set_eth->eth_addr[0],
 				set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+		for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
+			set_eth->eth_addr_mask[i] = 0xff;
 	}
 }
 
-- 
2.29.3


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

* [PATCH 2/6] net/nfp: fix the set IPv4 flow action
  2023-02-21  6:49 [PATCH 0/6] fix the set flow actions Chaoyong He
  2023-02-21  6:49 ` [PATCH 1/6] net/nfp: fix the set MAC flow action Chaoyong He
@ 2023-02-21  6:49 ` Chaoyong He
  2023-02-21  6:49 ` [PATCH 3/6] net/nfp: fix the set IPv6 " Chaoyong He
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21  6:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set IPv4 source/destination address flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right IPv4 address as expected.

Fixes: ab80975b0a14 ("net/nfp: support IPv4 source flow action")
Fixes: f85c1e05bff3 ("net/nfp: support IPv4 destination flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index f373171d7e..39493ce98d 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2132,10 +2132,13 @@ nfp_flow_action_set_ip(char *act_data,
 	set_ip->reserved     = 0;
 
 	set_ipv4 = (const struct rte_flow_action_set_ipv4 *)action->conf;
-	if (ip_src_flag)
+	if (ip_src_flag) {
 		set_ip->ipv4_src = set_ipv4->ipv4_addr;
-	else
+		set_ip->ipv4_src_mask = RTE_BE32(0xffffffff);
+	} else {
 		set_ip->ipv4_dst = set_ipv4->ipv4_addr;
+		set_ip->ipv4_dst_mask = RTE_BE32(0xffffffff);
+	}
 }
 
 static void
-- 
2.29.3


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

* [PATCH 3/6] net/nfp: fix the set IPv6 flow action
  2023-02-21  6:49 [PATCH 0/6] fix the set flow actions Chaoyong He
  2023-02-21  6:49 ` [PATCH 1/6] net/nfp: fix the set MAC flow action Chaoyong He
  2023-02-21  6:49 ` [PATCH 2/6] net/nfp: fix the set IPv4 " Chaoyong He
@ 2023-02-21  6:49 ` Chaoyong He
  2023-02-21  6:49 ` [PATCH 4/6] net/nfp: fix the set TP " Chaoyong He
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21  6:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set IPv6 source/destination address flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right IPv6 address as expected.

Fixes: 596ae2217214 ("net/nfp: support IPv6 source flow action")
Fixes: 51384f79b264 ("net/nfp: support IPv6 destination flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 39493ce98d..a4561b08e8 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2163,8 +2163,10 @@ nfp_flow_action_set_ipv6(char *act_data,
 	set_ip->head.len_lw = act_size >> NFP_FL_LW_SIZ;
 	set_ip->reserved = 0;
 
-	for (i = 0; i < 4; i++)
-		set_ip->ipv6[i].exact = set_ipv6->ipv6_addr[i];
+	for (i = 0; i < 4; i++) {
+		set_ip->ipv6[i].exact = *(const rte_be32_t *)&set_ipv6->ipv6_addr[i * 4];
+		set_ip->ipv6[i].mask = RTE_BE32(0xffffffff);
+	}
 }
 
 static void
-- 
2.29.3


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

* [PATCH 4/6] net/nfp: fix the set TP flow action
  2023-02-21  6:49 [PATCH 0/6] fix the set flow actions Chaoyong He
                   ` (2 preceding siblings ...)
  2023-02-21  6:49 ` [PATCH 3/6] net/nfp: fix the set IPv6 " Chaoyong He
@ 2023-02-21  6:49 ` Chaoyong He
  2023-02-21  6:49 ` [PATCH 5/6] net/nfp: fix the set TTL " Chaoyong He
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21  6:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set TP source/destination flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right TP as expected.

Fixes: fc185097bbe6 ("net/nfp: support TP source flow action")
Fixes: 87986df09d75 ("net/nfp: support TP destination flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index a4561b08e8..f22e89e1ea 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2190,10 +2190,13 @@ nfp_flow_action_set_tp(char *act_data,
 	set_tp->reserved     = 0;
 
 	set_tp_conf = (const struct rte_flow_action_set_tp *)action->conf;
-	if (tp_src_flag)
+	if (tp_src_flag) {
 		set_tp->src_port = set_tp_conf->port;
-	else
+		set_tp->src_port_mask = RTE_BE16(0xffff);
+	} else {
 		set_tp->dst_port = set_tp_conf->port;
+		set_tp->dst_port_mask = RTE_BE16(0xffff);
+	}
 }
 
 static int
-- 
2.29.3


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

* [PATCH 5/6] net/nfp: fix the set TTL flow action
  2023-02-21  6:49 [PATCH 0/6] fix the set flow actions Chaoyong He
                   ` (3 preceding siblings ...)
  2023-02-21  6:49 ` [PATCH 4/6] net/nfp: fix the set TP " Chaoyong He
@ 2023-02-21  6:49 ` Chaoyong He
  2023-02-21  6:49 ` [PATCH 6/6] net/nfp: fix the set IPv4/v6 DSCP " Chaoyong He
  2023-02-21 10:35 ` [PATCH v2 0/6] fix the set flow actions Chaoyong He
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21  6:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set TTL flow action don't consider the mask
filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right TTL as expected.

Fixes: ac12e126c482 ("net/nfp: support TTL flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index f22e89e1ea..c6e19d8cac 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2252,6 +2252,7 @@ nfp_flow_action_set_ttl(char *act_data,
 
 	ttl_conf = (const struct rte_flow_action_set_ttl *)action->conf;
 	ttl_tos->ipv4_ttl = ttl_conf->ttl_value;
+	ttl_tos->ipv4_ttl_mask = 0xff;
 	ttl_tos->reserved = 0;
 }
 
@@ -2275,6 +2276,7 @@ nfp_flow_action_set_hl(char *act_data,
 
 	ttl_conf = (const struct rte_flow_action_set_ttl *)action->conf;
 	tc_hl->ipv6_hop_limit = ttl_conf->ttl_value;
+	tc_hl->ipv6_hop_limit_mask = 0xff;
 	tc_hl->reserved = 0;
 }
 
-- 
2.29.3


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

* [PATCH 6/6] net/nfp: fix the set IPv4/v6 DSCP flow action
  2023-02-21  6:49 [PATCH 0/6] fix the set flow actions Chaoyong He
                   ` (4 preceding siblings ...)
  2023-02-21  6:49 ` [PATCH 5/6] net/nfp: fix the set TTL " Chaoyong He
@ 2023-02-21  6:49 ` Chaoyong He
  2023-02-21 10:35 ` [PATCH v2 0/6] fix the set flow actions Chaoyong He
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21  6:49 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set IPv4/v6 DSCP flow action don't consider the
mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right IPv4/v6 DSCP as expected.

Fixes: 9c665d70f7a7 ("net/nfp: support IPv4 DSCP flow action")
Fixes: 3202b003bec1 ("net/nfp: support IPv6 DSCP flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index c6e19d8cac..c8c57bc363 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2300,6 +2300,7 @@ nfp_flow_action_set_tos(char *act_data,
 
 	tos_conf = (const struct rte_flow_action_set_dscp *)action->conf;
 	ttl_tos->ipv4_tos = tos_conf->dscp;
+	ttl_tos->ipv4_tos_mask = 0xff;
 	ttl_tos->reserved = 0;
 }
 
@@ -2323,6 +2324,7 @@ nfp_flow_action_set_tc(char *act_data,
 
 	tos_conf = (const struct rte_flow_action_set_dscp *)action->conf;
 	tc_hl->ipv6_tc = tos_conf->dscp;
+	tc_hl->ipv6_tc_mask = 0xff;
 	tc_hl->reserved = 0;
 }
 
-- 
2.29.3


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

* [PATCH v2 0/6] fix the set flow actions
  2023-02-21  6:49 [PATCH 0/6] fix the set flow actions Chaoyong He
                   ` (5 preceding siblings ...)
  2023-02-21  6:49 ` [PATCH 6/6] net/nfp: fix the set IPv4/v6 DSCP " Chaoyong He
@ 2023-02-21 10:35 ` Chaoyong He
  2023-02-21 10:35   ` [PATCH v2 1/6] net/nfp: fix the set MAC flow action Chaoyong He
                     ` (6 more replies)
  6 siblings, 7 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21 10:35 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He

The former logic of set flow actions don't consider the mask filed
of control message passed to the firmware, and this caused the
firmware skip the set action logic wrongly.
This patch series aims to fix this problem.

--
v2:
* fix the compile warning.
--

Chaoyong He (6):
  net/nfp: fix the set MAC flow action
  net/nfp: fix the set IPv4 flow action
  net/nfp: fix the set IPv6 flow action
  net/nfp: fix the set TP flow action
  net/nfp: fix the set TTL flow action
  net/nfp: fix the set IPv4/v6 DSCP flow action

 drivers/net/nfp/nfp_flow.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

-- 
2.29.3


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

* [PATCH v2 1/6] net/nfp: fix the set MAC flow action
  2023-02-21 10:35 ` [PATCH v2 0/6] fix the set flow actions Chaoyong He
@ 2023-02-21 10:35   ` Chaoyong He
  2023-02-21 10:35   ` [PATCH v2 2/6] net/nfp: fix the set IPv4 " Chaoyong He
                     ` (5 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21 10:35 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set MAC source/destination address flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right MAC address as expected.

Fixes: 4f6983154570 ("net/nfp: support MAC source flow action")
Fixes: eecc7ca3088a ("net/nfp: support MAC destination flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 0c38925701..f373171d7e 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2066,6 +2066,7 @@ nfp_flow_action_set_mac(char *act_data,
 		bool mac_src_flag,
 		bool mac_set_flag)
 {
+	uint8_t i;
 	size_t act_size;
 	struct nfp_fl_act_set_eth *set_eth;
 	const struct rte_flow_action_set_mac *set_mac;
@@ -2084,9 +2085,13 @@ nfp_flow_action_set_mac(char *act_data,
 	if (mac_src_flag) {
 		rte_memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN],
 				set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+		for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
+			set_eth->eth_addr_mask[RTE_ETHER_ADDR_LEN + i] = 0xff;
 	} else {
 		rte_memcpy(&set_eth->eth_addr[0],
 				set_mac->mac_addr, RTE_ETHER_ADDR_LEN);
+		for (i = 0; i < RTE_ETHER_ADDR_LEN; i++)
+			set_eth->eth_addr_mask[i] = 0xff;
 	}
 }
 
-- 
2.29.3


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

* [PATCH v2 2/6] net/nfp: fix the set IPv4 flow action
  2023-02-21 10:35 ` [PATCH v2 0/6] fix the set flow actions Chaoyong He
  2023-02-21 10:35   ` [PATCH v2 1/6] net/nfp: fix the set MAC flow action Chaoyong He
@ 2023-02-21 10:35   ` Chaoyong He
  2023-02-21 10:35   ` [PATCH v2 3/6] net/nfp: fix the set IPv6 " Chaoyong He
                     ` (4 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21 10:35 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set IPv4 source/destination address flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right IPv4 address as expected.

Fixes: ab80975b0a14 ("net/nfp: support IPv4 source flow action")
Fixes: f85c1e05bff3 ("net/nfp: support IPv4 destination flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index f373171d7e..39493ce98d 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2132,10 +2132,13 @@ nfp_flow_action_set_ip(char *act_data,
 	set_ip->reserved     = 0;
 
 	set_ipv4 = (const struct rte_flow_action_set_ipv4 *)action->conf;
-	if (ip_src_flag)
+	if (ip_src_flag) {
 		set_ip->ipv4_src = set_ipv4->ipv4_addr;
-	else
+		set_ip->ipv4_src_mask = RTE_BE32(0xffffffff);
+	} else {
 		set_ip->ipv4_dst = set_ipv4->ipv4_addr;
+		set_ip->ipv4_dst_mask = RTE_BE32(0xffffffff);
+	}
 }
 
 static void
-- 
2.29.3


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

* [PATCH v2 3/6] net/nfp: fix the set IPv6 flow action
  2023-02-21 10:35 ` [PATCH v2 0/6] fix the set flow actions Chaoyong He
  2023-02-21 10:35   ` [PATCH v2 1/6] net/nfp: fix the set MAC flow action Chaoyong He
  2023-02-21 10:35   ` [PATCH v2 2/6] net/nfp: fix the set IPv4 " Chaoyong He
@ 2023-02-21 10:35   ` Chaoyong He
  2023-02-21 10:35   ` [PATCH v2 4/6] net/nfp: fix the set TP " Chaoyong He
                     ` (3 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21 10:35 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set IPv6 source/destination address flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right IPv6 address as expected.

Fixes: 596ae2217214 ("net/nfp: support IPv6 source flow action")
Fixes: 51384f79b264 ("net/nfp: support IPv6 destination flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 39493ce98d..d1fe744758 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2163,8 +2163,10 @@ nfp_flow_action_set_ipv6(char *act_data,
 	set_ip->head.len_lw = act_size >> NFP_FL_LW_SIZ;
 	set_ip->reserved = 0;
 
-	for (i = 0; i < 4; i++)
-		set_ip->ipv6[i].exact = set_ipv6->ipv6_addr[i];
+	for (i = 0; i < 4; i++) {
+		set_ip->ipv6[i].exact = set_ipv6->ipv6_addr[i * 4];
+		set_ip->ipv6[i].mask = RTE_BE32(0xffffffff);
+	}
 }
 
 static void
-- 
2.29.3


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

* [PATCH v2 4/6] net/nfp: fix the set TP flow action
  2023-02-21 10:35 ` [PATCH v2 0/6] fix the set flow actions Chaoyong He
                     ` (2 preceding siblings ...)
  2023-02-21 10:35   ` [PATCH v2 3/6] net/nfp: fix the set IPv6 " Chaoyong He
@ 2023-02-21 10:35   ` Chaoyong He
  2023-02-21 10:35   ` [PATCH v2 5/6] net/nfp: fix the set TTL " Chaoyong He
                     ` (2 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21 10:35 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set TP source/destination flow action don't
consider the mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right TP as expected.

Fixes: fc185097bbe6 ("net/nfp: support TP source flow action")
Fixes: 87986df09d75 ("net/nfp: support TP destination flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index d1fe744758..5be4c4f18a 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2190,10 +2190,13 @@ nfp_flow_action_set_tp(char *act_data,
 	set_tp->reserved     = 0;
 
 	set_tp_conf = (const struct rte_flow_action_set_tp *)action->conf;
-	if (tp_src_flag)
+	if (tp_src_flag) {
 		set_tp->src_port = set_tp_conf->port;
-	else
+		set_tp->src_port_mask = RTE_BE16(0xffff);
+	} else {
 		set_tp->dst_port = set_tp_conf->port;
+		set_tp->dst_port_mask = RTE_BE16(0xffff);
+	}
 }
 
 static int
-- 
2.29.3


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

* [PATCH v2 5/6] net/nfp: fix the set TTL flow action
  2023-02-21 10:35 ` [PATCH v2 0/6] fix the set flow actions Chaoyong He
                     ` (3 preceding siblings ...)
  2023-02-21 10:35   ` [PATCH v2 4/6] net/nfp: fix the set TP " Chaoyong He
@ 2023-02-21 10:35   ` Chaoyong He
  2023-02-21 10:35   ` [PATCH v2 6/6] net/nfp: fix the set IPv4/v6 DSCP " Chaoyong He
  2023-03-03 14:26   ` [PATCH v2 0/6] fix the set flow actions Ferruh Yigit
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21 10:35 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set TTL flow action don't consider the mask
filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right TTL as expected.

Fixes: ac12e126c482 ("net/nfp: support TTL flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 5be4c4f18a..77f249e2b9 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2252,6 +2252,7 @@ nfp_flow_action_set_ttl(char *act_data,
 
 	ttl_conf = (const struct rte_flow_action_set_ttl *)action->conf;
 	ttl_tos->ipv4_ttl = ttl_conf->ttl_value;
+	ttl_tos->ipv4_ttl_mask = 0xff;
 	ttl_tos->reserved = 0;
 }
 
@@ -2275,6 +2276,7 @@ nfp_flow_action_set_hl(char *act_data,
 
 	ttl_conf = (const struct rte_flow_action_set_ttl *)action->conf;
 	tc_hl->ipv6_hop_limit = ttl_conf->ttl_value;
+	tc_hl->ipv6_hop_limit_mask = 0xff;
 	tc_hl->reserved = 0;
 }
 
-- 
2.29.3


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

* [PATCH v2 6/6] net/nfp: fix the set IPv4/v6 DSCP flow action
  2023-02-21 10:35 ` [PATCH v2 0/6] fix the set flow actions Chaoyong He
                     ` (4 preceding siblings ...)
  2023-02-21 10:35   ` [PATCH v2 5/6] net/nfp: fix the set TTL " Chaoyong He
@ 2023-02-21 10:35   ` Chaoyong He
  2023-03-03 14:26   ` [PATCH v2 0/6] fix the set flow actions Ferruh Yigit
  6 siblings, 0 replies; 15+ messages in thread
From: Chaoyong He @ 2023-02-21 10:35 UTC (permalink / raw)
  To: dev; +Cc: oss-drivers, niklas.soderlund, Chaoyong He, stable

The former logic of set IPv4/v6 DSCP flow action don't consider the
mask filed of control message passed to the firmware.
This caused the firmware skip the set action logic, and the offloaded
packets don't have the right IPv4/v6 DSCP as expected.

Fixes: 9c665d70f7a7 ("net/nfp: support IPv4 DSCP flow action")
Fixes: 3202b003bec1 ("net/nfp: support IPv6 DSCP flow action")
Cc: stable@dpdk.org

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 drivers/net/nfp/nfp_flow.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c
index 77f249e2b9..53029d00c9 100644
--- a/drivers/net/nfp/nfp_flow.c
+++ b/drivers/net/nfp/nfp_flow.c
@@ -2300,6 +2300,7 @@ nfp_flow_action_set_tos(char *act_data,
 
 	tos_conf = (const struct rte_flow_action_set_dscp *)action->conf;
 	ttl_tos->ipv4_tos = tos_conf->dscp;
+	ttl_tos->ipv4_tos_mask = 0xff;
 	ttl_tos->reserved = 0;
 }
 
@@ -2323,6 +2324,7 @@ nfp_flow_action_set_tc(char *act_data,
 
 	tos_conf = (const struct rte_flow_action_set_dscp *)action->conf;
 	tc_hl->ipv6_tc = tos_conf->dscp;
+	tc_hl->ipv6_tc_mask = 0xff;
 	tc_hl->reserved = 0;
 }
 
-- 
2.29.3


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

* Re: [PATCH v2 0/6] fix the set flow actions
  2023-02-21 10:35 ` [PATCH v2 0/6] fix the set flow actions Chaoyong He
                     ` (5 preceding siblings ...)
  2023-02-21 10:35   ` [PATCH v2 6/6] net/nfp: fix the set IPv4/v6 DSCP " Chaoyong He
@ 2023-03-03 14:26   ` Ferruh Yigit
  6 siblings, 0 replies; 15+ messages in thread
From: Ferruh Yigit @ 2023-03-03 14:26 UTC (permalink / raw)
  To: Chaoyong He, dev; +Cc: oss-drivers, niklas.soderlund

On 2/21/2023 10:35 AM, Chaoyong He wrote:
> The former logic of set flow actions don't consider the mask filed
> of control message passed to the firmware, and this caused the
> firmware skip the set action logic wrongly.
> This patch series aims to fix this problem.
> 
> --
> v2:
> * fix the compile warning.
> --
> 
> Chaoyong He (6):
>   net/nfp: fix the set MAC flow action
>   net/nfp: fix the set IPv4 flow action
>   net/nfp: fix the set IPv6 flow action
>   net/nfp: fix the set TP flow action
>   net/nfp: fix the set TTL flow action
>   net/nfp: fix the set IPv4/v6 DSCP flow action


Series applied to dpdk-next-net/main, thanks.

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

end of thread, other threads:[~2023-03-03 14:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-21  6:49 [PATCH 0/6] fix the set flow actions Chaoyong He
2023-02-21  6:49 ` [PATCH 1/6] net/nfp: fix the set MAC flow action Chaoyong He
2023-02-21  6:49 ` [PATCH 2/6] net/nfp: fix the set IPv4 " Chaoyong He
2023-02-21  6:49 ` [PATCH 3/6] net/nfp: fix the set IPv6 " Chaoyong He
2023-02-21  6:49 ` [PATCH 4/6] net/nfp: fix the set TP " Chaoyong He
2023-02-21  6:49 ` [PATCH 5/6] net/nfp: fix the set TTL " Chaoyong He
2023-02-21  6:49 ` [PATCH 6/6] net/nfp: fix the set IPv4/v6 DSCP " Chaoyong He
2023-02-21 10:35 ` [PATCH v2 0/6] fix the set flow actions Chaoyong He
2023-02-21 10:35   ` [PATCH v2 1/6] net/nfp: fix the set MAC flow action Chaoyong He
2023-02-21 10:35   ` [PATCH v2 2/6] net/nfp: fix the set IPv4 " Chaoyong He
2023-02-21 10:35   ` [PATCH v2 3/6] net/nfp: fix the set IPv6 " Chaoyong He
2023-02-21 10:35   ` [PATCH v2 4/6] net/nfp: fix the set TP " Chaoyong He
2023-02-21 10:35   ` [PATCH v2 5/6] net/nfp: fix the set TTL " Chaoyong He
2023-02-21 10:35   ` [PATCH v2 6/6] net/nfp: fix the set IPv4/v6 DSCP " Chaoyong He
2023-03-03 14:26   ` [PATCH v2 0/6] fix the set flow actions Ferruh Yigit

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