net/i40e: fix offload flag checking in simple Tx datapath
PATCH 1/1 net/i40e: fix offload flag checking in simple Tx datapath
For Tx packets, if no other offload flag except 'PKT_TX_OUTER_IPV6, PKT_TX_OUTER_IPV4, PKT_TX_IPV6, PKT_TX_IPV4' is set, the hardware doesn't need to do offloads for these packets.
This patch removes those previously indicated flags from the offload flag checking in simple Tx datapath.
--- drivers/net/i40e/i40e_rxtx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/i40e/i40e_rxtx.c +3 -1
@@ -1501,7 +1501,9 @@return i; } -if (ol_flags &PKT_TX_OFFLOAD_MASK ) { +if (ol_flags &PKT_TX_OFFLOAD_MASK & + ~(PKT_TX_OUTER_IPV6 |PKT_TX_OUTER_IPV4 | +PKT_TX_IPV6 |PKT_TX_IPV4 )) { rte_errno =ENOTSUP ;return i; }
Signature · 1 line
1.8.3.1
Quoted 6 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Alvin Zhang
Sent: Tuesday, April 27, 2021 4:59 PM
To: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] net/i40e: fix offload flag checking in simple Tx datapath
Quoted 29 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Alvin Zhang
Sent: Tuesday, April 27, 2021 4:59 PM
To: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH] net/i40e: fix offload flag checking in simple Tx datapathFor Tx packets, if no other offload flag except '
PKT_TX_OUTER_IPV6,PKT_TX_OUTER_IPV4,PKT_TX_IPV6,PKT_TX_IPV4' is set, the hardware doesn't need to do offloads for these packets.This patch removes those previously indicated flags from the offload flag checking in simple Tx datapath.
Fixes 146ffa81d05e ("net/i40e: add Tx preparation for simple Tx datapath")Signed-off-by Alvin Zhang <[email protected]>--- drivers/net/i40e/i40e_rxtx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/i40e/i40e_rxtx.c index renamed from drivers/net/i40e/i40e_rxtx.c +0
-086a9eae..48d0582 100644
drivers/net/i40e/i40e_rxtx.c line 1506
Quoted 7 lines
drivers/net/i40e/i40e_rxtx.c +3
-1@@ -1501,7 +1501,9 @@return i; } -if (ol_flags &PKT_TX_OFFLOAD_MASK ) { +if (ol_flags &PKT_TX_OFFLOAD_MASK & + ~(PKT_TX_OUTER_IPV6 |PKT_TX_OUTER_IPV4 | +PKT_TX_IPV6 |PKT_TX_IPV4 )) {
Hi Alvin,
Could we define a new macro like I40E_SIMPLE_TX_OFFLOAD_NOTSUP_MASK as what I40E_TX_OFFLOAD_NOTSUP_MASK did. That would have nice readability. Thanks!
Quoted 5 lines
drivers/net/i40e/i40e_rxtx.c +0
-1rte_errno =ENOTSUP ;return i; } --1.8.3.1
PATCH v2 1/1 net/i40e: fix offload flag checking in simple Tx datapath
In reply to Alvin ZhangTx offload flags 'PKT_TX_IPV6, PKT_TX_IPV4, PKT_TX_OUTER_IPV6, PKT_TX_OUTER_IPV4' are supported in simple datapath.
This patch removes these offload flags from packet checking in simple Tx datapath and defines 2 macro I40E_TX_OFFLOAD_SIMPLE_SUP_MASK and I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK.
--- drivers/net/i40e/i40e_rxtx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/i40e/i40e_rxtx.c +10 -1
@@ -72,6 +72,15 @@#define I40E_TX_OFFLOAD_NOTSUP_MASK \ (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_MASK) +#define I40E_TX_OFFLOAD_SIMPLE_SUP_MASK ( \ + PKT_TX_IPV4 | \ + PKT_TX_IPV6 | \ + PKT_TX_OUTER_IPV4 | \ + PKT_TX_OUTER_IPV6) + +#define I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK \ + (PKT_TX_OFFLOAD_MASK & ~I40E_TX_OFFLOAD_SIMPLE_SUP_MASK) +int i40e_get_monitor_addr (void *rx_queue,struct rte_power_monitor_cond *pmc) {
@@ -1501,7 +1510,7 @@return i; } -if (ol_flags &PKT_TX_OFFLOAD_MASK ) { +if (ol_flags &I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK ) { rte_errno =ENOTSUP ;return i; }
Signature · 1 line
1.8.3.1
Quoted 30 lines
-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, May 11, 2021 10:39 AM
To: Xing, Beilei <[email protected]>; Rong, Leyi <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [PATCH v2] net/i40e: fix offload flag checking in simple Tx datapathTx offload flags '
PKT_TX_IPV6,PKT_TX_IPV4,PKT_TX_OUTER_IPV6,PKT_TX_OUTER_IPV4' are supported in simple datapath.This patch removes these offload flags from packet checking in simple Tx datapath and defines 2 macro
I40E_TX_OFFLOAD_SIMPLE_SUP_MASKandI40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK.Fixes 146ffa81d05e ("net/i40e: add Tx preparation for simple Tx datapath")Signed-off-by Alvin Zhang <[email protected]>--- drivers/net/i40e/i40e_rxtx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)drivers/net/i40e/i40e_rxtx.c index renamed from drivers/net/i40e/i40e_rxtx.c +0
-002cf5e7..337916b 100644
drivers/net/i40e/i40e_rxtx.c +0
-0@@ -72,6 +72,15 @@#define I40E_TX_OFFLOAD_NOTSUP_MASK \ (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_MASK)
drivers/net/i40e/i40e_rxtx.c line 83
Quoted 10 lines
drivers/net/i40e/i40e_rxtx.c +8
-0+#define I40E_TX_OFFLOAD_SIMPLE_SUP_MASK ( \ + PKT_TX_IPV4 | \ + PKT_TX_IPV6 | \ + PKT_TX_OUTER_IPV4 | \ + PKT_TX_OUTER_IPV6) + +#define I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK \ + (PKT_TX_OFFLOAD_MASK & ~I40E_TX_OFFLOAD_SIMPLE_SUP_MASK)
Hi Alvin,
Better to use ^ oprand here, think about the situation when setting a flag in I40E_TX_OFFLOAD_SIMPLE_SUP_MASK but not in the PKT_TX_OFFLOAD_MASK, the result is going to be unexpected.
Quoted 14 lines
drivers/net/i40e/i40e_rxtx.c +1
-0+int i40e_get_monitor_addr (void *rx_queue,struct rte_power_monitor_cond *pmc){ @@ -1501,7 +1510,7 @@
drivers/net/i40e/i40e_rxtx.c +1
-2return i; } -if (ol_flags &PKT_TX_OFFLOAD_MASK ) { +if (ol_flags &I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK ) { rte_errno =ENOTSUP ;return i; } --1.8.3.1
PATCH v3 1/1 net/i40e: fix offload flag checking in simple Tx datapath
In reply to Alvin ZhangTx offload flags 'PKT_TX_IPV6, PKT_TX_IPV4, PKT_TX_OUTER_IPV6, PKT_TX_OUTER_IPV4' are supported in simple datapath.
This patch removes these offload flags from packet checking in simple Tx datapath and defines 2 macro I40E_TX_OFFLOAD_SIMPLE_SUP_MASK and I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK.
---
v3: Update codes according to comments
--- drivers/net/i40e/i40e_rxtx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/i40e/i40e_rxtx.c +10 -1
@@ -72,6 +72,15 @@#define I40E_TX_OFFLOAD_NOTSUP_MASK \ (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_MASK) +#define I40E_TX_OFFLOAD_SIMPLE_SUP_MASK ( \ + PKT_TX_IPV4 | \ + PKT_TX_IPV6 | \ + PKT_TX_OUTER_IPV4 | \ + PKT_TX_OUTER_IPV6) + +#define I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK \ + (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_SIMPLE_SUP_MASK) +int i40e_get_monitor_addr (void *rx_queue,struct rte_power_monitor_cond *pmc) {
@@ -1501,7 +1510,7 @@return i; } -if (ol_flags &PKT_TX_OFFLOAD_MASK ) { +if (ol_flags &I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK ) { rte_errno =ENOTSUP ;return i; }
Signature · 1 line
1.8.3.1
Quoted 56 lines
-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, May 11, 2021 4:46 PM
To: Xing, Beilei <[email protected]>; Rong, Leyi <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [PATCH v3] net/i40e: fix offload flag checking in simple Tx datapathTx offload flags '
PKT_TX_IPV6,PKT_TX_IPV4,PKT_TX_OUTER_IPV6,PKT_TX_OUTER_IPV4' are supported in simple datapath.This patch removes these offload flags from packet checking in simple Tx datapath and defines 2 macro
I40E_TX_OFFLOAD_SIMPLE_SUP_MASKandI40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK.Fixes 146ffa81d05e ("net/i40e: add Tx preparation for simple Tx datapath")Signed-off-by Alvin Zhang <[email protected]>---
v3: Update codes according to comments
--- drivers/net/i40e/i40e_rxtx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)drivers/net/i40e/i40e_rxtx.c index renamed from drivers/net/i40e/i40e_rxtx.c +0
-002cf5e7..337916b 100644
drivers/net/i40e/i40e_rxtx.c +9
-0@@ -72,6 +72,15 @@#define I40E_TX_OFFLOAD_NOTSUP_MASK \ (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_MASK) +#define I40E_TX_OFFLOAD_SIMPLE_SUP_MASK ( \ + PKT_TX_IPV4 | \ + PKT_TX_IPV6 | \ + PKT_TX_OUTER_IPV4 | \ + PKT_TX_OUTER_IPV6) + +#define I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK \ + (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_SIMPLE_SUP_MASK) +int i40e_get_monitor_addr (void *rx_queue,struct rte_power_monitor_cond *pmc){ @@ -1501,7 +1510,7 @@
drivers/net/i40e/i40e_rxtx.c +1
-2return i; } -if (ol_flags &PKT_TX_OFFLOAD_MASK ) { +if (ol_flags &I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK ) { rte_errno =ENOTSUP ;return i; } --
Quoted 1 line
1.8.3.1
Zhang, Qi Z
AppliedQuoted 66 lines
-----Original Message-----
From: Rong, Leyi <[email protected]>
Sent: Tuesday, May 11, 2021 5:20 PM
To: Zhang, AlvinX <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v3] net/i40e: fix offload flag checking in simple Tx datapathQuoted 10 lines
-----Original Message-----
From: Zhang, AlvinX <[email protected]>
Sent: Tuesday, May 11, 2021 4:46 PM
To: Xing, Beilei <[email protected]>; Rong, Leyi <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [PATCH v3] net/i40e: fix offload flag checking in simple Tx datapathQuoted 5 lines
Tx offload flags '
PKT_TX_IPV6,PKT_TX_IPV4,PKT_TX_OUTER_IPV6,PKT_TX_OUTER_IPV4' are supported in simple datapath.This patch removes these offload flags from packet checking in simple Tx datapath and defines 2 macro
I40E_TX_OFFLOAD_SIMPLE_SUP_MASKand
Quoted 38 lines
I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK.Fixes 146ffa81d05e ("net/i40e: add Tx preparation for simple Txdatapath")
Cc: [email protected]Signed-off-by Alvin Zhang <[email protected]>---
v3: Update codes according to comments
--- drivers/net/i40e/i40e_rxtx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/net/i40e/i40e_rxtx.cindex 02cf5e7..337916b 100644drivers/net/i40e/i40e_rxtx.c +9
-0@@ -72,6 +72,15 @@#define I40E_TX_OFFLOAD_NOTSUP_MASK \ (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_MASK) +#define I40E_TX_OFFLOAD_SIMPLE_SUP_MASK ( \ + PKT_TX_IPV4 | \ + PKT_TX_IPV6 | \ + PKT_TX_OUTER_IPV4 | \ + PKT_TX_OUTER_IPV6) + +#define I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK \ + (PKT_TX_OFFLOAD_MASK ^ I40E_TX_OFFLOAD_SIMPLE_SUP_MASK) +int i40e_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond*pmc) { @@ -1501,7 +1510,7 @@
drivers/net/i40e/i40e_rxtx.c +0
-0return i; }
Quoted 9 lines
Quoted 7 lines
drivers/net/i40e/i40e_rxtx.c +1
-2-if (ol_flags &PKT_TX_OFFLOAD_MASK ) { +if (ol_flags &I40E_TX_OFFLOAD_SIMPLE_NOTSUP_MASK ) { rte_errno =ENOTSUP ;return i; } --1.8.3.1
Acked-by Leyi Rong <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi