Skip to contentSkip to conversation

net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

PATCH Applied Radu Nicolau 3 participants 10 messages Oct 24, 2023 – Oct 25, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

IAVF_TX_OFFLOAD_MASK definition contained
RTE_ETH_TX_OFFLOAD_SECURITY instead of
RTE_MBUF_F_TX_SEC_OFFLOAD.

Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
---
 drivers/net/iavf/iavf_rxtx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/iavf/iavf_rxtx.h +1 -1
index 605ea3f824..f29c90fb21 100644
@@ -98,7 +98,7 @@
 		RTE_MBUF_F_TX_TUNNEL_MASK |	\
 		RTE_MBUF_F_TX_OUTER_IP_CKSUM |  \
 		RTE_MBUF_F_TX_OUTER_UDP_CKSUM | \
-		RTE_ETH_TX_OFFLOAD_SECURITY)
+		RTE_MBUF_F_TX_SEC_OFFLOAD)
 
 #define IAVF_TX_OFFLOAD_NOTSUP_MASK \
 		(RTE_MBUF_F_TX_OFFLOAD_MASK ^ IAVF_TX_OFFLOAD_MASK)
Signature · 1 line
2.25.1
#1 lore raw
Quoted 9 lines · Radu Nicolau

IAVF_TX_OFFLOAD_MASK definition contained
RTE_ETH_TX_OFFLOAD_SECURITY instead of
RTE_MBUF_F_TX_SEC_OFFLOAD.

Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")

Something is not clear to me.
How was the IPsec inline crypto feature supposed to work with this driver so far?

Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have been refused in iavf_prep_pkts.

Signature · 1 line
David Marchand
#2 lore raw
Quoted 8 lines · David Marchand
Quoted 7 lines · Radu Nicolau

IAVF_TX_OFFLOAD_MASK definition contained
RTE_ETH_TX_OFFLOAD_SECURITY instead of
RTE_MBUF_F_TX_SEC_OFFLOAD.

Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Quoted 8 lines
Quoted 1 line

Something is not clear to me.
How was the IPsec inline crypto feature supposed to work with this driver so far?

Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have been refused in iavf_prep_pkts.

It worked because the IPsec sample app doesn't call rte_eth_tx_prepare, and from what I can see no other sample app does.

#3 lore raw
Quoted 26 lines

-----Original Message-----
From: Radu Nicolau <[email protected]>
Sent: Tuesday, October 24, 2023 6:23 PM
To: Marchand, David <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

Quoted 1 line · David Marchand

On Tue, Oct 24, 2023 at 11:13 AM Radu Nicolau <[email protected]>

Quoted 1 line · wrote:
Quoted 1 line

IAVF_TX_OFFLOAD_MASK definition contained

RTE_ETH_TX_OFFLOAD_SECURITY

Quoted 10 lines
Quoted 6 lines

instead of RTE_MBUF_F_TX_SEC_OFFLOAD.

Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")

Something is not clear to me.
How was the IPsec inline crypto feature supposed to work with this driver so far?

Quoted 5 lines
Quoted 3 lines

Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have been refused in iavf_prep_pkts.

It worked because the IPsec sample app doesn't call rte_eth_tx_prepare, and from what I can see no other sample app does.

To keep consistent, its better to refine the IAVF_TX_OFFLOAD_NOTSUP_MASK definition.

#4 lore raw
Quoted 25 lines · Qi Z
Quoted 25 lines

-----Original Message-----
From: Radu Nicolau <[email protected]>
Sent: Tuesday, October 24, 2023 6:23 PM
To: Marchand, David <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

Quoted 1 line · David Marchand

On Tue, Oct 24, 2023 at 11:13 AM Radu Nicolau <[email protected]>

Quoted 1 line · wrote:
Quoted 1 line

IAVF_TX_OFFLOAD_MASK definition contained

RTE_ETH_TX_OFFLOAD_SECURITY

Quoted 10 lines
Quoted 6 lines

instead of RTE_MBUF_F_TX_SEC_OFFLOAD.

Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")

Something is not clear to me.
How was the IPsec inline crypto feature supposed to work with this driver so far?

Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have been refused in iavf_prep_pkts.

It worked because the IPsec sample app doesn't call rte_eth_tx_prepare, and from what I can see no other sample app does.

To keep consistent, its better to refine the IAVF_TX_OFFLOAD_NOTSUP_MASK definition.

You mean like this?

#define IAVF_TX_OFFLOAD_NOTSUP_MASK ( \
        RTE_MBUF_F_TX_OFFLOAD_MASK ^ (  \
            RTE_MBUF_F_TX_OUTER_IPV6 |         \
            RTE_MBUF_F_TX_OUTER_IPV4 |         \

            RTE_MBUF_F_TX_IPV6 |             \
            RTE_MBUF_F_TX_IPV4 |             \
            RTE_MBUF_F_TX_VLAN |         \
            RTE_MBUF_F_TX_IP_CKSUM |         \
            RTE_MBUF_F_TX_L4_MASK |         \
            RTE_MBUF_F_TX_TCP_SEG |         \
            RTE_MBUF_F_TX_UDP_SEG |      \

            RTE_MBUF_F_TX_TUNNEL_MASK |    \
            RTE_MBUF_F_TX_OUTER_IP_CKSUM |  \
            RTE_MBUF_F_TX_OUTER_UDP_CKSUM | \
            RTE_MBUF_F_TX_SEC_OFFLOAD))

#5 lore raw
Quoted 62 lines

-----Original Message-----
From: Nicolau, Radu <[email protected]>
Sent: Tuesday, October 24, 2023 10:49 PM
To: Zhang, Qi Z <[email protected]>; Marchand, David <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

Quoted 21 lines · Qi Z
Quoted 21 lines

-----Original Message-----
From: Radu Nicolau <[email protected]>
Sent: Tuesday, October 24, 2023 6:23 PM
To: Marchand, David <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

Quoted 2 lines · David Marchand

On Tue, Oct 24, 2023 at 11:13 AM Radu Nicolau
<[email protected]>

Quoted 1 line · wrote:
Quoted 1 line

IAVF_TX_OFFLOAD_MASK definition contained

RTE_ETH_TX_OFFLOAD_SECURITY

Quoted 5 lines
Quoted 5 lines

instead of RTE_MBUF_F_TX_SEC_OFFLOAD.

Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

Something is not clear to me.
How was the IPsec inline crypto feature supposed to work with this driver so far?

Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have

been

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

refused in iavf_prep_pkts.

It worked because the IPsec sample app doesn't call rte_eth_tx_prepare, and from what I can see no other sample app does.

To keep consistent, its better to refine the

IAVF_TX_OFFLOAD_NOTSUP_MASK definition.

You mean like this?

#define IAVF_TX_OFFLOAD_NOTSUP_MASK ( \
        RTE_MBUF_F_TX_OFFLOAD_MASK ^ (  \
            RTE_MBUF_F_TX_OUTER_IPV6 |         \
            RTE_MBUF_F_TX_OUTER_IPV4 |         \

             RTE_MBUF_F_TX_IPV6 |             \
             RTE_MBUF_F_TX_IPV4 |             \
             RTE_MBUF_F_TX_VLAN |         \
             RTE_MBUF_F_TX_IP_CKSUM |         \
             RTE_MBUF_F_TX_L4_MASK |         \
             RTE_MBUF_F_TX_TCP_SEG |         \
             RTE_MBUF_F_TX_UDP_SEG |      \
Quoted 4 lines

            RTE_MBUF_F_TX_TUNNEL_MASK |    \
            RTE_MBUF_F_TX_OUTER_IP_CKSUM |  \
            RTE_MBUF_F_TX_OUTER_UDP_CKSUM | \
            RTE_MBUF_F_TX_SEC_OFFLOAD))

Sorry, I miss understanding this code change, actually you didn't remove a flag, but just replace it, NOTSUP_MASK no need to be changed

Then I don't understand why "Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have refused in iavf_prep_pkts" But I assume tx_pkt_prepare should reject only invalid packets while still functioning correctly with inline IPsec.

#6 lore raw
Quoted 64 lines · Qi Z
Quoted 60 lines

-----Original Message-----
From: Nicolau, Radu <[email protected]>
Sent: Tuesday, October 24, 2023 10:49 PM
To: Zhang, Qi Z <[email protected]>; Marchand, David <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

Quoted 20 lines · Qi Z
Quoted 20 lines

-----Original Message-----
From: Radu Nicolau <[email protected]>
Sent: Tuesday, October 24, 2023 6:23 PM
To: Marchand, David <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

Quoted 2 lines · David Marchand

On Tue, Oct 24, 2023 at 11:13 AM Radu Nicolau
<[email protected]>

Quoted 1 line · wrote:
Quoted 1 line

IAVF_TX_OFFLOAD_MASK definition contained

RTE_ETH_TX_OFFLOAD_SECURITY

Quoted 5 lines
Quoted 5 lines

instead of RTE_MBUF_F_TX_SEC_OFFLOAD.

Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

Something is not clear to me.
How was the IPsec inline crypto feature supposed to work with this driver so far?

Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have

been

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

refused in iavf_prep_pkts.

It worked because the IPsec sample app doesn't call rte_eth_tx_prepare, and from what I can see no other sample app does.

To keep consistent, its better to refine the

IAVF_TX_OFFLOAD_NOTSUP_MASK definition.

You mean like this?

#define IAVF_TX_OFFLOAD_NOTSUP_MASK ( \
        RTE_MBUF_F_TX_OFFLOAD_MASK ^ (  \
            RTE_MBUF_F_TX_OUTER_IPV6 |         \
            RTE_MBUF_F_TX_OUTER_IPV4 |         \

              RTE_MBUF_F_TX_IPV6 |             \
              RTE_MBUF_F_TX_IPV4 |             \
              RTE_MBUF_F_TX_VLAN |         \
              RTE_MBUF_F_TX_IP_CKSUM |         \
              RTE_MBUF_F_TX_L4_MASK |         \
              RTE_MBUF_F_TX_TCP_SEG |         \
              RTE_MBUF_F_TX_UDP_SEG |      \
Quoted 4 lines

            RTE_MBUF_F_TX_TUNNEL_MASK |    \
            RTE_MBUF_F_TX_OUTER_IP_CKSUM |  \
            RTE_MBUF_F_TX_OUTER_UDP_CKSUM | \
            RTE_MBUF_F_TX_SEC_OFFLOAD))

Quoted 4 lines

Sorry, I miss understanding this code change, actually you didn't remove a flag, but just replace it, NOTSUP_MASK no need to be changed

Then I don't understand why "Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have refused in iavf_prep_pkts" But I assume tx_pkt_prepare should reject only invalid packets while still functioning correctly with inline IPsec.

rte_eth_tx_prepare would have rejected the packets before this fix, but no app calls rte_eth_tx_prepare. The only app that calls it is testpmd.

#7 lore raw
Quoted 67 lines · Radu Nicolau
Quoted 64 lines · Qi Z
Quoted 64 lines

-----Original Message-----
From: Nicolau, Radu <[email protected]>
Sent: Tuesday, October 24, 2023 10:49 PM
To: Zhang, Qi Z <[email protected]>; Marchand, David <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

Quoted 20 lines · Qi Z
Quoted 20 lines

-----Original Message-----
From: Radu Nicolau <[email protected]>
Sent: Tuesday, October 24, 2023 6:23 PM
To: Marchand, David <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

Quoted 2 lines · David Marchand

On Tue, Oct 24, 2023 at 11:13 AM Radu Nicolau
<[email protected]>

Quoted 1 line · wrote:
Quoted 1 line

IAVF_TX_OFFLOAD_MASK definition contained

RTE_ETH_TX_OFFLOAD_SECURITY

Quoted 5 lines
Quoted 5 lines

instead of RTE_MBUF_F_TX_SEC_OFFLOAD.

Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

Something is not clear to me.
How was the IPsec inline crypto feature supposed to work with this driver so far?

Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have

been

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

refused in iavf_prep_pkts.

It worked because the IPsec sample app doesn't call rte_eth_tx_prepare, and from what I can see no other sample app does.

To keep consistent, its better to refine the

IAVF_TX_OFFLOAD_NOTSUP_MASK definition.

You mean like this?

#define IAVF_TX_OFFLOAD_NOTSUP_MASK ( \
          RTE_MBUF_F_TX_OFFLOAD_MASK ^ (  \
              RTE_MBUF_F_TX_OUTER_IPV6 |         \
              RTE_MBUF_F_TX_OUTER_IPV4 |         \
              RTE_MBUF_F_TX_IPV6 |             \
              RTE_MBUF_F_TX_IPV4 |             \
              RTE_MBUF_F_TX_VLAN |         \
              RTE_MBUF_F_TX_IP_CKSUM |         \
              RTE_MBUF_F_TX_L4_MASK |         \
              RTE_MBUF_F_TX_TCP_SEG |         \
              RTE_MBUF_F_TX_UDP_SEG |      \
              RTE_MBUF_F_TX_TUNNEL_MASK |    \
              RTE_MBUF_F_TX_OUTER_IP_CKSUM |  \
              RTE_MBUF_F_TX_OUTER_UDP_CKSUM | \
              RTE_MBUF_F_TX_SEC_OFFLOAD))
Quoted 7 lines
Quoted 4 lines

Sorry, I miss understanding this code change, actually you didn't remove a flag, but just replace it, NOTSUP_MASK no need to be changed

Then I don't understand why "Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have refused in iavf_prep_pkts" But I assume tx_pkt_prepare should reject only invalid packets while still functioning correctly with inline IPsec.

rte_eth_tx_prepare would have rejected the packets before this fix, but no app calls rte_eth_tx_prepare. The only app that calls it is testpmd.

From my understanding, applications that want checksum offload are required to call rte_eth_tx_prepare.

Signature · 1 line
David Marchand
#8 lore raw
Quoted 66 lines · David Marchand
Quoted 65 lines · Radu Nicolau
Quoted 63 lines · Qi Z
Quoted 63 lines

-----Original Message-----
From: Nicolau, Radu <[email protected]>
Sent: Tuesday, October 24, 2023 10:49 PM
To: Zhang, Qi Z <[email protected]>; Marchand, David <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

Quoted 20 lines · Qi Z
Quoted 20 lines

-----Original Message-----
From: Radu Nicolau <[email protected]>
Sent: Tuesday, October 24, 2023 6:23 PM
To: Marchand, David <[email protected]>
Cc: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

Quoted 2 lines · David Marchand

On Tue, Oct 24, 2023 at 11:13 AM Radu Nicolau
<[email protected]>

Quoted 1 line · wrote:
Quoted 1 line

IAVF_TX_OFFLOAD_MASK definition contained

RTE_ETH_TX_OFFLOAD_SECURITY

Quoted 5 lines
Quoted 5 lines

instead of RTE_MBUF_F_TX_SEC_OFFLOAD.

Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

Something is not clear to me.
How was the IPsec inline crypto feature supposed to work with this driver so far?

Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have

been

Quoted 5 lines
Quoted 4 lines
Quoted 2 lines

refused in iavf_prep_pkts.

It worked because the IPsec sample app doesn't call rte_eth_tx_prepare, and from what I can see no other sample app does.

To keep consistent, its better to refine the

IAVF_TX_OFFLOAD_NOTSUP_MASK definition.

You mean like this?

#define IAVF_TX_OFFLOAD_NOTSUP_MASK ( \
           RTE_MBUF_F_TX_OFFLOAD_MASK ^ (  \
               RTE_MBUF_F_TX_OUTER_IPV6 |         \
               RTE_MBUF_F_TX_OUTER_IPV4 |         \
               RTE_MBUF_F_TX_IPV6 |             \
               RTE_MBUF_F_TX_IPV4 |             \
               RTE_MBUF_F_TX_VLAN |         \
               RTE_MBUF_F_TX_IP_CKSUM |         \
               RTE_MBUF_F_TX_L4_MASK |         \
               RTE_MBUF_F_TX_TCP_SEG |         \
               RTE_MBUF_F_TX_UDP_SEG |      \
               RTE_MBUF_F_TX_TUNNEL_MASK |    \
               RTE_MBUF_F_TX_OUTER_IP_CKSUM |  \
               RTE_MBUF_F_TX_OUTER_UDP_CKSUM | \
               RTE_MBUF_F_TX_SEC_OFFLOAD))
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Sorry, I miss understanding this code change, actually you didn't remove a flag, but just replace it, NOTSUP_MASK no need to be changed

Then I don't understand why "Any packet with the RTE_MBUF_F_TX_SEC_OFFLOAD flag should have refused in iavf_prep_pkts" But I assume tx_pkt_prepare should reject only invalid packets while still functioning correctly with inline IPsec.

rte_eth_tx_prepare would have rejected the packets before this fix, but no app calls rte_eth_tx_prepare. The only app that calls it is testpmd.

From my understanding, applications that want checksum offload are
required to call rte_eth_tx_prepare.

TBH I don't understand much about it and looking at the implementation actually made things worse: for example from what I can see calling it when RTE_MBUF_F_TX_TCP_CKSUM is set will result in having the TCP checksum being computed (in software) in the prepare function.

Acked-by on v1 1/1 Applied
#9 lore raw
In reply to Radu Nicolau
Quoted 34 lines

-----Original Message-----
From: Radu Nicolau <[email protected]>
Sent: Tuesday, October 24, 2023 5:13 PM
To: Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Nicolau, Radu <[email protected]>; [email protected]
Subject: [PATCH] net/iavf: fix IAVF_TX_OFFLOAD_MASK definition

IAVF_TX_OFFLOAD_MASK definition contained RTE_ETH_TX_OFFLOAD_SECURITY instead of RTE_MBUF_F_TX_SEC_OFFLOAD.

Fixes 6bc987ecb860 ("net/iavf: support IPsec inline crypto")
---
 drivers/net/iavf/iavf_rxtx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/iavf/iavf_rxtx.h index renamed from drivers/net/iavf/iavf_rxtx.h +0 -0

605ea3f824..f29c90fb21 100644

drivers/net/iavf/iavf_rxtx.h +1 -1
@@ -98,7 +98,7 @@
 		RTE_MBUF_F_TX_TUNNEL_MASK |	\
 		RTE_MBUF_F_TX_OUTER_IP_CKSUM |  \
 		RTE_MBUF_F_TX_OUTER_UDP_CKSUM | \
-		RTE_ETH_TX_OFFLOAD_SECURITY)
+		RTE_MBUF_F_TX_SEC_OFFLOAD)
 
 #define IAVF_TX_OFFLOAD_NOTSUP_MASK \
 		(RTE_MBUF_F_TX_OFFLOAD_MASK ^
Quoted 3 lines

IAVF_TX_OFFLOAD_MASK)
--
2.25.1

Applied to dpdk-next-net-intel.

Thanks
Qi