Skip to contentSkip to conversation

app/testpmd: fix csumonly mode when run without outer chksum

PATCH In review Nithin Dabilpuram 5 participants 10 messages Aug 16, 2021 – Aug 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 app/testpmd: fix csumonly mode when run without outer chksum

Donot use outer metadata when neither outer ip checksum nor outer udp checksum is enabled. PMD's will ignore the outer_l2_len and outer_l3_len in cases where none of the outer checksum is enabled and hence only l2_len and l3_len will be used to calculate the offsets for L2 or L3 header.

Fixes 3c32113a1aac ("app/testpmd: fix IPv6 tunnel checksum")
---
 app/test-pmd/csumonly.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
app/test-pmd/csumonly.c +1 -2
index 607c889..38cc256 100644
@@ -961,8 +961,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			    (tx_offloads &
 			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
 			    (tx_offloads &
-			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
-			    (tx_ol_flags & PKT_TX_OUTER_IPV6)) {
+			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)) {
 				m->outer_l2_len = info.outer_l2_len;
 				m->outer_l3_len = info.outer_l3_len;
 				m->l2_len = info.l2_len;
Signature · 1 line
2.8.4
#1 lore raw

PATCH 2/2 app/testpmd: fix verbose mode dump for Tx

Fix verbose mode dump for Tx to dump tx offload flags instead of Rx offload flags.

Fixes d862c45b5955 ("app/testpmd: move dumping packets to a separate function")
---
 app/test-pmd/util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
app/test-pmd/util.c +5 -1
index 5dd7157..14a9a25 100644
@@ -275,7 +275,11 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 			  " - %s queue=0x%x", is_rx ? "Receive" : "Send",
 			  (unsigned int) queue);
 		MKDUMPSTR(print_buf, buf_size, cur_len, "\n");
-		rte_get_rx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));
+		if (is_rx)
+			rte_get_rx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));
+		else
+			rte_get_tx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));
+
 		MKDUMPSTR(print_buf, buf_size, cur_len,
 			  "  ol_flags: %s\n", buf);
 		if (rte_mbuf_check(mb, 1, &reason) < 0)
Signature · 1 line
2.8.4
Acked-by on v1 2/2
#2 lore raw

Re: [dpdk-dev] [PATCH 2/2] app/testpmd: fix verbose mode dump for Tx

Quoted 40 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, August 16, 2021 15:10
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; [email protected]; [email protected]
Subject: [PATCH 2/2] app/testpmd: fix verbose mode dump for Tx

Fix verbose mode dump for Tx to dump tx offload flags instead of Rx offload flags.

Fixes d862c45b5955 ("app/testpmd: move dumping packets to a separate

function")
Cc: [email protected]
Cc: [email protected]

---
 app/test-pmd/util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
app/test-pmd/util.c index 5dd7157..14a9a25 renamed from app/test-pmd/util.c +0 -0

100644

app/test-pmd/util.c +5 -1
@@ -275,7 +275,11 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue,
 struct rte_mbuf *pkts[],
 			  " - %s queue=0x%x", is_rx ? "Receive" : "Send",
 			  (unsigned int) queue);
 		MKDUMPSTR(print_buf, buf_size, cur_len, "\n");
-		rte_get_rx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));
+		if (is_rx)
+			rte_get_rx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));
+		else
+			rte_get_tx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));
+
 		MKDUMPSTR(print_buf, buf_size, cur_len,
 			  "  ol_flags: %s\n", buf);
Quoted 3 lines

if (rte_mbuf_check(mb, 1, &reason) < 0)
--
2.8.4

#3 lore raw

Re: [dpdk-dev] [PATCH 2/2] app/testpmd: fix verbose mode dump for Tx

Hi,

Quoted 50 lines

-----Original Message-----
From: Li, Xiaoyun <[email protected]>
Sent: Tuesday, August 17, 2021 4:54 AM
To: Nithin Dabilpuram <[email protected]>
Cc: [email protected]; [email protected]; Raslan Darawsheh <[email protected]>; [email protected]
Subject: RE: [PATCH 2/2] app/testpmd: fix verbose mode dump for Tx

Quoted 9 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, August 16, 2021 15:10
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; [email protected]; [email protected]
Subject: [PATCH 2/2] app/testpmd: fix verbose mode dump for Tx

Fix verbose mode dump for Tx to dump tx offload flags instead of Rx

offload

app/test-pmd/util.c index

Quoted 13 lines

flags.

Fixes d862c45b5955 ("app/testpmd: move dumping packets to a separate

function")
Cc: [email protected]
Cc: [email protected]

---
 app/test-pmd/util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
app/test-pmd/util.c index renamed from app/test-pmd/util.c +0 -0

5dd7157..14a9a25

app/test-pmd/util.c dump_pkt_burst(uint16_t port_id, uint16_t

Quoted 4 lines

100644

app/test-pmd/util.c +0 -0
@@ -275,7 +275,11 @@ dump_pkt_burst(uint16_t port_id, uint16_t

queue,

app/test-pmd/util.c dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],

Quoted 7 lines
app/test-pmd/util.c +2 -1
 struct rte_mbuf *pkts[],
 			  " - %s queue=0x%x", is_rx ? "Receive" : "Send",
 			  (unsigned int) queue);
 		MKDUMPSTR(print_buf, buf_size, cur_len, "\n");
-		rte_get_rx_ol_flag_list(mb->ol_flags, buf, sizeof(buf));
+		if (is_rx)
+			rte_get_rx_ol_flag_list(mb->ol_flags, buf,

sizeof(buf));

app/test-pmd/util.c dump_pkt_burst(uint16_t port_id, uint16_t · line 282

Quoted 2 lines
app/test-pmd/util.c +2 -0
+		else
+			rte_get_tx_ol_flag_list(mb->ol_flags, buf,

sizeof(buf));

Quoted 8 lines
Quoted 6 lines
app/test-pmd/util.c +1 -0
+
 		MKDUMPSTR(print_buf, buf_size, cur_len,
 			  "  ol_flags: %s\n", buf);

if (rte_mbuf_check(mb, 1, &reason) < 0)
--
2.8.4

Kindest regards,
Raslan Darawsheh

#4 lore raw
In reply to Nithin Dabilpuram

Hi

Quoted 9 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, August 16, 2021 15:10
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; [email protected]; [email protected]
Subject: [PATCH 1/2] app/testpmd: fix csumonly mode when run without outer chksum

Quoted 4 lines

Donot use outer metadata when neither outer ip checksum nor outer udp checksum is enabled. PMD's will ignore the outer_l2_len and outer_l3_len in cases where none of the outer checksum is enabled and hence only l2_len and l3_len will be used to calculate the offsets for L2 or L3 header.

I don't understand.
In process_outer_chksum, only PKT_TX_OUTER_IPV6 Will be set if it's ipv6 packets.
So PKT_TX_OUTER_IPV6 means this packet is tunnel ipv6 packet. So it actually needs outer l2 len and outer l3 len put them to hw. At least i40e needs outer l2 len and outer l3 len as far as I know.

Quoted 26 lines
Fixes 3c32113a1aac ("app/testpmd: fix IPv6 tunnel checksum")
---
 app/test-pmd/csumonly.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
app/test-pmd/csumonly.c index renamed from app/test-pmd/csumonly.c +0 -0

607c889..38cc256 100644

app/test-pmd/csumonly.c +1 -3
@@ -961,8 +961,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			    (tx_offloads &
 			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
 			    (tx_offloads &
-			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
-			    (tx_ol_flags & PKT_TX_OUTER_IPV6)) {
+			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)) {
 				m->outer_l2_len = info.outer_l2_len;
 				m->outer_l3_len = info.outer_l3_len;
 				m->l2_len = info.l2_len;
--

2.8.4

#5 lore raw
Quoted 16 lines · Xiaoyun

Hi

Quoted 9 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, August 16, 2021 15:10
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; [email protected]; [email protected]
Subject: [PATCH 1/2] app/testpmd: fix csumonly mode when run without outer chksum

Quoted 4 lines

Donot use outer metadata when neither outer ip checksum nor outer udp checksum is enabled. PMD's will ignore the outer_l2_len and outer_l3_len in cases where none of the outer checksum is enabled and hence only l2_len and l3_len will be used to calculate the offsets for L2 or L3 header.

Quoted 4 lines

I don't understand.
In process_outer_chksum, only PKT_TX_OUTER_IPV6 Will be set if it's ipv6 packets.
So PKT_TX_OUTER_IPV6 means this packet is tunnel ipv6 packet. So it actually needs outer l2 len and outer l3 len put them to hw. At least i40e needs outer l2 len and outer l3 len as far as I know.

Ok, do you mean m->outer_l2_len and m->outer_l3_len will be referred in i40e driver even when both DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM and DEV_TX_OFFLOAD_OUTER_UDP_CKSUM are not enabled in ethdev Tx offloads ?

I thought as per spec, those fields will only be used when the Outer offloads are enabled.

Quoted 28 lines
Quoted 27 lines
Fixes 3c32113a1aac ("app/testpmd: fix IPv6 tunnel checksum")
---
 app/test-pmd/csumonly.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
app/test-pmd/csumonly.c index renamed from app/test-pmd/csumonly.c +0 -0

607c889..38cc256 100644

app/test-pmd/csumonly.c +1 -3
@@ -961,8 +961,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			    (tx_offloads &
 			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
 			    (tx_offloads &
-			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
-			    (tx_ol_flags & PKT_TX_OUTER_IPV6)) {
+			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)) {
 				m->outer_l2_len = info.outer_l2_len;
 				m->outer_l3_len = info.outer_l3_len;
 				m->l2_len = info.l2_len;
--

2.8.4

#6 lore raw
Quoted 33 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, August 16, 2021 18:56
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] app/testpmd: fix csumonly mode when run without outer chksum

Quoted 15 lines · Xiaoyun

Hi

Quoted 13 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, August 16, 2021 15:10
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; [email protected]; [email protected]
Subject: [PATCH 1/2] app/testpmd: fix csumonly mode when run without outer chksum

Donot use outer metadata when neither outer ip checksum nor outer udp checksum is enabled. PMD's will ignore the outer_l2_len and outer_l3_len in cases where none of the outer checksum is enabled and hence only l2_len and l3_len will be used to calculate the offsets for L2

or L3 header.

Quoted 3 lines

I don't understand.
In process_outer_chksum, only PKT_TX_OUTER_IPV6 Will be set if it's ipv6

packets.

Quoted 1 line

So PKT_TX_OUTER_IPV6 means this packet is tunnel ipv6 packet. So it actually

needs outer l2 len and outer l3 len put them to hw.

Quoted 8 lines
Quoted 1 line

At least i40e needs outer l2 len and outer l3 len as far as I know.

Ok, do you mean m->outer_l2_len and m->outer_l3_len will be referred in i40e driver even when both DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM and DEV_TX_OFFLOAD_OUTER_UDP_CKSUM are not enabled in ethdev Tx offloads ?

I thought as per spec, those fields will only be used when the Outer offloads are enabled.

Checked again. You're right. Tx offloads are enough.

Quoted 29 lines
Quoted 29 lines
Quoted 28 lines
Fixes 3c32113a1aac ("app/testpmd: fix IPv6 tunnel checksum")
---
 app/test-pmd/csumonly.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
app/test-pmd/csumonly.c index renamed from app/test-pmd/csumonly.c +0 -0

607c889..38cc256 100644

app/test-pmd/csumonly.c +1 -3
@@ -961,8 +961,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			    (tx_offloads &
 			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
 			    (tx_offloads &
-			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
-			    (tx_ol_flags & PKT_TX_OUTER_IPV6)) {
+			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)) {
 				m->outer_l2_len = info.outer_l2_len;
 				m->outer_l3_len = info.outer_l3_len;
 				m->l2_len = info.l2_len;
--

2.8.4

#7 lore raw
Quoted 35 lines · Xiaoyun
Quoted 35 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, August 16, 2021 18:56
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/2] app/testpmd: fix csumonly mode when run without outer chksum

Quoted 15 lines · Xiaoyun

Hi

Quoted 13 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, August 16, 2021 15:10
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; [email protected]; [email protected]
Subject: [PATCH 1/2] app/testpmd: fix csumonly mode when run without outer chksum

Donot use outer metadata when neither outer ip checksum nor outer udp checksum is enabled. PMD's will ignore the outer_l2_len and outer_l3_len in cases where none of the outer checksum is enabled and hence only l2_len and l3_len will be used to calculate the offsets for L2

or L3 header.

Quoted 3 lines

I don't understand.
In process_outer_chksum, only PKT_TX_OUTER_IPV6 Will be set if it's ipv6

packets.

Quoted 1 line

So PKT_TX_OUTER_IPV6 means this packet is tunnel ipv6 packet. So it actually

needs outer l2 len and outer l3 len put them to hw.

Quoted 1 line

At least i40e needs outer l2 len and outer l3 len as far as I know.

Quoted 8 lines
Quoted 6 lines

Ok, do you mean m->outer_l2_len and m->outer_l3_len will be referred in i40e driver even when both DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM and DEV_TX_OFFLOAD_OUTER_UDP_CKSUM are not enabled in ethdev Tx offloads ?

I thought as per spec, those fields will only be used when the Outer offloads are enabled.

Checked again. You're right. Tx offloads are enough.

Ack, thanks.

Quoted 30 lines
Quoted 30 lines
Quoted 30 lines
Quoted 29 lines
Fixes 3c32113a1aac ("app/testpmd: fix IPv6 tunnel checksum")
---
 app/test-pmd/csumonly.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
app/test-pmd/csumonly.c index renamed from app/test-pmd/csumonly.c +0 -0

607c889..38cc256 100644

app/test-pmd/csumonly.c +1 -3
@@ -961,8 +961,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			    (tx_offloads &
 			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
 			    (tx_offloads &
-			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
-			    (tx_ol_flags & PKT_TX_OUTER_IPV6)) {
+			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)) {
 				m->outer_l2_len = info.outer_l2_len;
 				m->outer_l3_len = info.outer_l3_len;
 				m->l2_len = info.l2_len;
--

2.8.4

Acked-by on v1 1/2
#8 lore raw
In reply to Nithin Dabilpuram
Quoted 40 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, August 16, 2021 15:10
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; [email protected]; [email protected]
Subject: [PATCH 1/2] app/testpmd: fix csumonly mode when run without outer chksum

Donot use outer metadata when neither outer ip checksum nor outer udp checksum is enabled. PMD's will ignore the outer_l2_len and outer_l3_len in cases where none of the outer checksum is enabled and hence only l2_len and l3_len will be used to calculate the offsets for L2 or L3 header.

Fixes 3c32113a1aac ("app/testpmd: fix IPv6 tunnel checksum")
---
 app/test-pmd/csumonly.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
app/test-pmd/csumonly.c index renamed from app/test-pmd/csumonly.c +0 -0

607c889..38cc256 100644

app/test-pmd/csumonly.c +1 -3
@@ -961,8 +961,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 			    (tx_offloads &
 			     DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) ||
 			    (tx_offloads &
-			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) ||
-			    (tx_ol_flags & PKT_TX_OUTER_IPV6)) {
+			     DEV_TX_OFFLOAD_OUTER_UDP_CKSUM)) {
 				m->outer_l2_len = info.outer_l2_len;
 				m->outer_l3_len = info.outer_l3_len;
 				m->l2_len = info.l2_len;
--
Quoted 1 line

2.8.4

#9 lore raw
Quoted 16 lines · Xiaoyun
Quoted 16 lines

-----Original Message-----
From: Nithin Dabilpuram <[email protected]>
Sent: Monday, August 16, 2021 15:10
To: Li, Xiaoyun <[email protected]>
Cc: [email protected]; [email protected]; Nithin Dabilpuram <[email protected]>; [email protected]; [email protected]
Subject: [PATCH 1/2] app/testpmd: fix csumonly mode when run without outer chksum

Donot use outer metadata when neither outer ip checksum nor outer udp checksum is enabled. PMD's will ignore the outer_l2_len and outer_l3_len in cases where none of the outer checksum is enabled and hence only l2_len and l3_len will be used to calculate the offsets for L2 or L3 header.

Quoted 7 lines
Quoted 5 lines
Fixes 3c32113a1aac ("app/testpmd: fix IPv6 tunnel checksum")

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