Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib
cover Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib
Patchset contains below changes:
------------------------------------------------------------
1. Currently PKT_TX_IP_CKSUM is being set into mbuf->ol_flags during fragmentation and reassemble operation implicitly. Because of this, application is forced to use checksum offload whether it is supported by platform or not.
Also documentation does not provide any expected value of ol_flags in returned mbuf (reassembled or fragmented) so application will never come to know that which offloads are enabled. So transmission may gets failed for the platforms which does not support checksum offload.
Also, IPv6 does not contain any checksum field in header so setting mbuf->ol_flags with PKT_TX_IP_CKSUM is itself invalid.
So removing mentioned flag from the library.
2. Enabling PKT_TX_IP_CKSUM into mbuf->ol_flags at fragmentation and reassembly application itself.
Sunil Kumar Kori (3):
lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags examples/ip_fragmentation: Enabling IP checksum offload in mbuf examples/ip_reassembly: Enabling IP checksum offload in mbuf
examples/ip_fragmentation/main.c | 7 +++++-- examples/ip_reassembly/main.c | 6 ++++++ lib/librte_ip_frag/rte_ipv4_fragmentation.c | 1 - lib/librte_ip_frag/rte_ipv4_reassembly.c | 3 --- lib/librte_ip_frag/rte_ipv6_reassembly.c | 3 --- 5 files changed, 11 insertions(+), 9 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/3 lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
Currently PKT_TX_IP_CKSUM is being set into mbuf->ol_flags during fragmentation and reassemble operation implicitly. Because of this, application is forced to use checksum offload whether it is supported by platform or not.
Also documentation does not provide any expected value of ol_flags in returned mbuf (reassembled or fragmented) so application will never come to know that which offloads are enabled. So transmission may be failed for the platforms which does not support checksum offload.
Also, IPv6 does not contain any checksum field in header so setting mbuf->ol_flags with PKT_TX_IP_CKSUM is itself invalid.
So removing mentioned flag from the library.
--- lib/librte_ip_frag/rte_ipv4_fragmentation.c | 1 - lib/librte_ip_frag/rte_ipv4_reassembly.c | 3 --- lib/librte_ip_frag/rte_ipv6_reassembly.c | 3 --- 3 files changed, 7 deletions(-)
lib/librte_ip_frag/rte_ipv4_fragmentation.c +0 -1
@@ -173,7 +173,6 @@ static inline void __free_fragments(struct rte_mbuf *mb[], uint32_t num) fragment_offset = (uint16_t )(fragment_offset + out_pkt->pkt_len -sizeof (struct ipv4_hdr )); - out_pkt->ol_flags |=PKT_TX_IP_CKSUM ; out_pkt->l3_len =sizeof (struct ipv4_hdr );/* Write the fragment to the output list */
lib/librte_ip_frag/rte_ipv4_reassembly.c +0 -3
@@ -66,9 +66,6 @@ struct rte_mbuf * m = fp->frags[IP_FIRST_FRAG_IDX ].mb; fp->frags[IP_FIRST_FRAG_IDX ].mb =NULL ; -/* update mbuf fields for reassembled packet. */ - m->ol_flags |=PKT_TX_IP_CKSUM ; -/* update ipv4 header for the reassembled packet */ ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, m->l2_len);
lib/librte_ip_frag/rte_ipv6_reassembly.c +0 -3
@@ -89,9 +89,6 @@ struct rte_mbuf * m = fp->frags[IP_FIRST_FRAG_IDX ].mb; fp->frags[IP_FIRST_FRAG_IDX ].mb =NULL ; -/* update mbuf fields for reassembled packet. */ - m->ol_flags |=PKT_TX_IP_CKSUM ; -/* update ipv6 header for the reassembled datagram */ ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, m->l2_len);
Signature · 1 line
1.8.3.1
PATCH 2/3 examples/ip_fragmentation: Enabling IP checksum offload in mbuf
In reply to Sunil Kumar Kori--- examples/ip_fragmentation/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
examples/ip_fragmentation/main.c +5 -2
@@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = {/* src addr */ ether_addr_copy (&ports_eth_addr[port_out], ð_hdr->s_addr); -if (ipv6) +if (ipv6) { eth_hdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv6); -else + m->ol_flags |=PKT_TX_IPV6 ; + }else { eth_hdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv4); + m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); + } } len += len2;
Signature · 1 line
1.8.3.1
PATCH 3/3 examples/ip_reassembly: Enabling IP checksum offload in mbuf
In reply to Sunil Kumar Kori--- examples/ip_reassembly/main.c | 6 ++++++ 1 file changed, 6 insertions(+)
examples/ip_reassembly/main.c +6 -0
@@ -353,6 +353,9 @@ struct rte_lpm6_config lpm6_config = { struct ether_hdr *); ip_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); } + +/* update offloading flags */ + m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); } ip_dst =rte_be_to_cpu_32 (ip_hdr->dst_addr);
@@ -391,6 +394,9 @@ struct rte_lpm6_config lpm6_config = { eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); ip_hdr = (struct ipv6_hdr *)(eth_hdr +1 ); } + +/* update offloading flags */ + m->ol_flags |=PKT_TX_IPV6 ; }/* Find destination port */
Signature · 1 line
1.8.3.1
v2 cover Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib
In reply to Sunil Kumar Koriv2: Checkpath warning are removed
Patchset contains below changes:
------------------------------------------------------------
1. Currently PKT_TX_IP_CKSUM is being set into mbuf->ol_flags during fragmentation and reassemble operation implicitly. Because of this, application is forced to use checksum offload whether it is supported by platform or not.
Also documentation does not provide any expected value of ol_flags in returned mbuf (reassembled or fragmented) so application will never come to know that which offloads are enabled. So transmission may gets failed for the platforms which does not support checksum offload.
Also, IPv6 does not contain any checksum field in header so setting mbuf->ol_flags with PKT_TX_IP_CKSUM is itself invalid.
So removing mentioned flag from the library.
2. Enabling PKT_TX_IP_CKSUM into mbuf->ol_flags at fragmentation and reassembly application itself.
Sunil Kumar Kori (3):
lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags examples/ip_fragmentation: Enabling IP checksum offload in mbuf examples/ip_reassembly: Enabling IP checksum offload in mbuf
examples/ip_fragmentation/main.c | 7 +++++-- examples/ip_reassembly/main.c | 6 ++++++ lib/librte_ip_frag/rte_ipv4_fragmentation.c | 1 - lib/librte_ip_frag/rte_ipv4_reassembly.c | 3 --- lib/librte_ip_frag/rte_ipv6_reassembly.c | 3 --- 5 files changed, 11 insertions(+), 9 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v2 1/3 lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
Currently PKT_TX_IP_CKSUM is being set into mbuf->ol_flags during fragmentation and reassemble operation implicitly. Because of this, application is forced to use checksum offload whether it is supported by platform or not.
Also documentation does not provide any expected value of ol_flags in returned mbuf (reassembled or fragmented) so application will never come to know that which offloads are enabled. So transmission may be failed for the platforms which does not support checksum offload.
Also, IPv6 does not contain any checksum field in header so setting mbuf->ol_flags with PKT_TX_IP_CKSUM is itself invalid.
So removing mentioned flag from the library.
--- lib/librte_ip_frag/rte_ipv4_fragmentation.c | 1 - lib/librte_ip_frag/rte_ipv4_reassembly.c | 3 --- lib/librte_ip_frag/rte_ipv6_reassembly.c | 3 --- 3 files changed, 7 deletions(-)
lib/librte_ip_frag/rte_ipv4_fragmentation.c +0 -1
@@ -173,7 +173,6 @@ static inline void __free_fragments(struct rte_mbuf *mb[], uint32_t num) fragment_offset = (uint16_t )(fragment_offset + out_pkt->pkt_len -sizeof (struct ipv4_hdr )); - out_pkt->ol_flags |=PKT_TX_IP_CKSUM ; out_pkt->l3_len =sizeof (struct ipv4_hdr );/* Write the fragment to the output list */
lib/librte_ip_frag/rte_ipv4_reassembly.c +0 -3
@@ -66,9 +66,6 @@ struct rte_mbuf * m = fp->frags[IP_FIRST_FRAG_IDX ].mb; fp->frags[IP_FIRST_FRAG_IDX ].mb =NULL ; -/* update mbuf fields for reassembled packet. */ - m->ol_flags |=PKT_TX_IP_CKSUM ; -/* update ipv4 header for the reassembled packet */ ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, m->l2_len);
lib/librte_ip_frag/rte_ipv6_reassembly.c +0 -3
@@ -89,9 +89,6 @@ struct rte_mbuf * m = fp->frags[IP_FIRST_FRAG_IDX ].mb; fp->frags[IP_FIRST_FRAG_IDX ].mb =NULL ; -/* update mbuf fields for reassembled packet. */ - m->ol_flags |=PKT_TX_IP_CKSUM ; -/* update ipv6 header for the reassembled datagram */ ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, m->l2_len);
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
Hi,
Quoted 10 lines
Currently
PKT_TX_IP_CKSUMis being set intombuf->ol_flagsduring fragmentation and reassemble operation implicitly. Because of this, application is forced to use checksum offload whether it is supported by platform or not.Also documentation does not provide any expected value of
ol_flagsin returned mbuf (reassembled or fragmented) so application will never come to know that which offloads are enabled. So transmission may be failed for the platforms which does not support checksum offload.
Quoted 4 lines
Also, IPv6 does not contain any checksum field in header so setting
mbuf->ol_flagswithPKT_TX_IP_CKSUMis itself invalid.So removing mentioned flag from the library.
As there is a change in public API behavior, I think it deserves update in release notes. Apart from that:
Quoted 50 lines
Signed-off-by Sunil Kumar Kori <[email protected]>--- lib/librte_ip_frag/rte_ipv4_fragmentation.c | 1 - lib/librte_ip_frag/rte_ipv4_reassembly.c | 3 --- lib/librte_ip_frag/rte_ipv6_reassembly.c | 3 --- 3 files changed, 7 deletions(-)lib/librte_ip_frag/rte_ipv4_fragmentation.c +0
-1@@ -173,7 +173,6 @@ static inline void __free_fragments(struct rte_mbuf *mb[], uint32_t num) fragment_offset = (uint16_t )(fragment_offset + out_pkt->pkt_len -sizeof (struct ipv4_hdr )); - out_pkt->ol_flags |=PKT_TX_IP_CKSUM ; out_pkt->l3_len =sizeof (struct ipv4_hdr );/* Write the fragment to the output list */ lib/librte_ip_frag/rte_ipv4_reassembly.c +0
-3@@ -66,9 +66,6 @@ struct rte_mbuf * m = fp->frags[IP_FIRST_FRAG_IDX ].mb; fp->frags[IP_FIRST_FRAG_IDX ].mb =NULL ; -/* update mbuf fields for reassembled packet. */ - m->ol_flags |=PKT_TX_IP_CKSUM ; -/* update ipv4 header for the reassembled packet */ ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, m->l2_len);lib/librte_ip_frag/rte_ipv6_reassembly.c +0
-4@@ -89,9 +89,6 @@ struct rte_mbuf * m = fp->frags[IP_FIRST_FRAG_IDX ].mb; fp->frags[IP_FIRST_FRAG_IDX ].mb =NULL ; -/* update mbuf fields for reassembled packet. */ - m->ol_flags |=PKT_TX_IP_CKSUM ; -/* update ipv6 header for the reassembled datagram */ ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, m->l2_len); --1.8.3.1
Re: [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
18/05/2019 17:18, Ananyev, Konstantin:
Quoted 13 lines
Hi,
Quoted 10 lines
Currently
PKT_TX_IP_CKSUMis being set intombuf->ol_flagsduring fragmentation and reassemble operation implicitly. Because of this, application is forced to use checksum offload whether it is supported by platform or not.Also documentation does not provide any expected value of
ol_flagsin returned mbuf (reassembled or fragmented) so application will never come to know that which offloads are enabled. So transmission may be failed for the platforms which does not support checksum offload.
Quoted 8 lines
Quoted 4 lines
Also, IPv6 does not contain any checksum field in header so setting
mbuf->ol_flagswithPKT_TX_IP_CKSUMis itself invalid.So removing mentioned flag from the library.
As there is a change in public API behavior, I think it deserves update in release notes. Apart from that:
Is it safe to do this behaviour change?
You did not reply about updating the release notes. Why did you drop this patch in v3?
Re: [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
26/06/2019 23:10, Thomas Monjalon:
Quoted 19 lines
18/05/2019 17:18, Ananyev, Konstantin:
Quoted 18 lines
Hi,
Quoted 14 lines
Currently
PKT_TX_IP_CKSUMis being set intombuf->ol_flagsduring fragmentation and reassemble operation implicitly. Because of this, application is forced to use checksum offload whether it is supported by platform or not.Also documentation does not provide any expected value of
ol_flagsin returned mbuf (reassembled or fragmented) so application will never come to know that which offloads are enabled. So transmission may be failed for the platforms which does not support checksum offload.Also, IPv6 does not contain any checksum field in header so setting
mbuf->ol_flagswithPKT_TX_IP_CKSUMis itself invalid.So removing mentioned flag from the library.
Quoted 7 lines
Quoted 3 lines
As there is a change in public API behavior, I think it deserves update in release notes. Apart from that:
Is it safe to do this behaviour change?
You did not reply about updating the release notes. Why did you drop this patch in v3?
No reply?
May I consider this series won't go in 19.08 release?
Re: [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
Quoted 33 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, July 4, 2019 5:53 PM
To: Sunil Kumar Kori <[email protected]>
Cc: [email protected]; Ananyev, Konstantin <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 1/3]lib/librte_ip_frag: RemovePKT_TX_IP_CKSUMoffload flags26/06/2019 23:10, Thomas Monjalon:
Quoted 23 lines
18/05/2019 17:18, Ananyev, Konstantin:
Quoted 21 lines
Hi,
Quoted 10 lines
Currently
PKT_TX_IP_CKSUMis being set intombuf->ol_flagsduring fragmentation and reassemble operation implicitly. Because of this, application is forced to use checksum offload whether it is supported by platform or not.Also documentation does not provide any expected value of
ol_flagsin returned mbuf (reassembled or fragmented) so application will never come to know that which offloads are enabled. So transmission may be failed for the platforms which does not support checksum offload.Quoted 4 lines
Also, IPv6 does not contain any checksum field in header so setting
mbuf->ol_flagswithPKT_TX_IP_CKSUMis itself invalid.So removing mentioned flag from the library.
As there is a change in public API behavior, I think it deserves update in release notes. Apart from that:
Quoted 6 lines
Quoted 3 lines
Is it safe to do this behaviour change?
You did not reply about updating the release notes. Why did you drop this patch in v3?No reply?
May I consider this series won't go in 19.08 release?
I think we better push it into 19.08.
It is a real problem, I hit it myself while working on adding reassemble/fragmentation support into ipsec-secgw.
Sunil, can you prepare new version as asked by Thomas?
Konstantin
PATCH v2 2/3 examples/ip_fragmentation: Enabling IP checksum offload in mbuf
In reply to Sunil Kumar KoriAs per the documentation to use any IP offload features, application must set required offload flags into mbuf->ol_flags.
--- examples/ip_fragmentation/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
examples/ip_fragmentation/main.c +5 -2
@@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = {/* src addr */ ether_addr_copy (&ports_eth_addr[port_out], ð_hdr->s_addr); -if (ipv6) +if (ipv6) { eth_hdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv6); -else + m->ol_flags |=PKT_TX_IPV6 ; + }else { eth_hdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv4); + m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); + } } len += len2;
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
Quoted 22 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Sunil Kumar Kori
Sent: Thursday, May 16, 2019 12:42 PM
To: [email protected]
Cc: [email protected]
Subject: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbufAs per the documentation to use any IP offload features, application must set required offload flags into
mbuf->ol_flags.Signed-off-by Sunil Kumar Kori <[email protected]>--- examples/ip_fragmentation/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)examples/ip_fragmentation/main.c +0
-0
examples/ip_fragmentation/main.c struct rte_lpm6_config lpm6_config = { · line 359
Quoted 8 lines
examples/ip_fragmentation/main.c +2
-2@@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = {/* src addr */ ether_addr_copy (&ports_eth_addr[port_out], ð_hdr->s_addr); -if (ipv6) +if (ipv6) { eth_hdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv6); -else + m->ol_flags |=PKT_TX_IPV6 ;
Is there is any point to do that?
This sample app, as I remember doesn't request any extra HW offloads. Same comment for patch #3.
Konstantin
Quoted 9 lines
examples/ip_fragmentation/main.c +3
-1+ }else { eth_hdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv4); + m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); + } } len += len2; --1.8.3.1
Re: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
Hi,
Regards
Sunil Kumar Kori
Quoted 42 lines
-----Original Message-----
From: Ananyev, Konstantin <[email protected]>
Sent: Saturday, May 18, 2019 8:51 PM
To: Sunil Kumar Kori <[email protected]>; [email protected]
Subject: [EXT] RE: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation:
Enabling IP checksum offload in mbufExternal Email
----------------------------------------------------------------------
Quoted 6 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Sunil Kumar Kori
Sent: Thursday, May 16, 2019 12:42 PM
To: [email protected]
Cc: [email protected]
Subject: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IPchecksum offload in mbuf
Review
Quoted 10 lines
As per the documentation to use any IP offload features, application must set required offload flags into
mbuf->ol_flags.Signed-off-by Sunil Kumar Kori <[email protected]>--- examples/ip_fragmentation/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/examples/ip_fragmentation/main.cexamples/ip_fragmentation/main.c struct rte_lpm6_config lpm6_config = { · line 359
Quoted 11 lines
index e90a61e..d821967 100644
examples/ip_fragmentation/main.c +1
-1@@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = {/* src addr */ ether_addr_copy (&ports_eth_addr[port_out], ð_hdr- s_addr); -if (ipv6) +if (ipv6) { eth_hdr->ether_type =
rte_be_to_cpu_16(ETHER_TYPE_IPv6);
Quoted 9 lines
examples/ip_fragmentation/main.c struct rte_lpm6_config lpm6_config = { · line 359
Quoted 2 lines
examples/ip_fragmentation/main.c +1
-1-else + m->ol_flags |=PKT_TX_IPV6 ;Is there is any point to do that?
This sample app, as I remember doesn't request any extra HW offloads. Same comment for patch #3.
Konstantin
Is this comment valid for IPv6 only ?
Otherwise for IPv4, it is required as IP checksum is neither being updated by library nor by the application.
Quoted 10 lines
examples/ip_fragmentation/main.c struct rte_lpm6_config lpm6_config = { · line 362
Quoted 2 lines
examples/ip_fragmentation/main.c +1
-0+ }else { eth_hdr->ether_type =
rte_be_to_cpu_16(ETHER_TYPE_IPv4);Quoted 7 lines
examples/ip_fragmentation/main.c +2
-0+ m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); + } }len += len2;
--
1.8.3.1
Re: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
Quoted 64 lines
-----Original Message-----
From: Sunil Kumar Kori [mailto:[email protected]]
Sent: Monday, May 20, 2019 9:09 AM
To: Ananyev, Konstantin <[email protected]>; [email protected]
Subject: RE: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbufHi,
Regards
Sunil Kumar KoriQuoted 42 lines
-----Original Message-----
From: Ananyev, Konstantin <[email protected]>
Sent: Saturday, May 18, 2019 8:51 PM
To: Sunil Kumar Kori <[email protected]>; [email protected]
Subject: [EXT] RE: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation:
Enabling IP checksum offload in mbufExternal Email
----------------------------------------------------------------------
Quoted 6 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Sunil Kumar Kori
Sent: Thursday, May 16, 2019 12:42 PM
To: [email protected]
Cc: [email protected]
Subject: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IPchecksum offload in mbuf
Review
Quoted 10 lines
As per the documentation to use any IP offload features, application must set required offload flags into
mbuf->ol_flags.Signed-off-by Sunil Kumar Kori <[email protected]>--- examples/ip_fragmentation/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/examples/ip_fragmentation/main.cexamples/ip_fragmentation/main.c struct rte_lpm6_config lpm6_config = { · line 359
Quoted 11 lines
index e90a61e..d821967 100644
examples/ip_fragmentation/main.c +1
-1@@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = {/* src addr */ ether_addr_copy (&ports_eth_addr[port_out], ð_hdr- s_addr); -if (ipv6) +if (ipv6) { eth_hdr->ether_type =
rte_be_to_cpu_16(ETHER_TYPE_IPv6);Quoted 9 lines
examples/ip_fragmentation/main.c struct rte_lpm6_config lpm6_config = { · line 359
Quoted 2 lines
examples/ip_fragmentation/main.c +1
-1-else + m->ol_flags |=PKT_TX_IPV6 ;Is there is any point to do that?
This sample app, as I remember doesn't request any extra HW offloads. Same comment for patch #3.
Konstantin
Quoted 1 line
Is this comment valid for IPv6 only ?
Yes, my comment is about the following line of code:m->ol_flags |= PKT_TX_IPV6;
Quoted 12 lines
Otherwise for IPv4, it is required as IP checksum is neither being updated by library nor by the application.
Quoted 10 lines
examples/ip_fragmentation/main.c struct rte_lpm6_config lpm6_config = { · line 362
Quoted 2 lines
examples/ip_fragmentation/main.c +1
-0+ }else { eth_hdr->ether_type =
rte_be_to_cpu_16(ETHER_TYPE_IPv4);Quoted 7 lines
examples/ip_fragmentation/main.c +2
-0+ m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); + } }len += len2;
--
1.8.3.1
PATCH v3 1/2 examples/ip_fragmentation: Enabling IP checksum offload in mbuf
In reply to Sunil Kumar KoriAs per the documentation to use any IP offload features, application must set required offload flags into mbuf->ol_flags.
--- examples/ip_fragmentation/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
examples/ip_fragmentation/main.c +4 -2
@@ -354,10 +354,12 @@ struct rte_lpm6_config lpm6_config = {/* src addr */ ether_addr_copy (&ports_eth_addr[port_out], ð_hdr->s_addr); -if (ipv6) +if (ipv6) { eth_hdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv6); -else + }else { eth_hdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv4); + m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); + } } len += len2;
Signature · 1 line
1.8.3.1
PATCH v3 2/2 examples/ip_reassembly: Enabling IP checksum offload in mbuf
As per the documentation to use any IP offload features, application must set required offload flags into mbuf->ol_flags.
--- examples/ip_reassembly/main.c | 3 +++ 1 file changed, 3 insertions(+)
examples/ip_reassembly/main.c +3 -0
@@ -353,6 +353,9 @@ struct rte_lpm6_config lpm6_config = { struct ether_hdr *); ip_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); } + +/* update offloading flags */ + m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); } ip_dst =rte_be_to_cpu_32 (ip_hdr->dst_addr);
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH v3 2/2] examples/ip_reassembly: Enabling IP checksum offload in mbuf
Quoted 15 lines
As per the documentation to use any IP offload features, application must set required offload flags into
mbuf->ol_flags.Signed-off-by Sunil Kumar Kori <[email protected]>--- examples/ip_reassembly/main.c | 3 +++ 1 file changed, 3 insertions(+)examples/ip_reassembly/main.c +0
-0
examples/ip_reassembly/main.c struct rte_lpm6_config lpm6_config = {
Quoted 10 lines
examples/ip_reassembly/main.c +3
-1@@ -353,6 +353,9 @@ struct rte_lpm6_config lpm6_config = { struct ether_hdr *); ip_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); } + +/* update offloading flags */ + m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); } ip_dst =rte_be_to_cpu_32 (ip_hdr->dst_addr); --
Quoted 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH v3 1/2] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
In reply to Sunil Kumar KoriQuoted 19 lines
As per the documentation to use any IP offload features, application must set required offload flags into
mbuf->ol_flags.Signed-off-by Sunil Kumar Kori <[email protected]>--- examples/ip_fragmentation/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)examples/ip_fragmentation/main.c +1
-1@@ -354,10 +354,12 @@ struct rte_lpm6_config lpm6_config = {/* src addr */ ether_addr_copy (&ports_eth_addr[port_out], ð_hdr->s_addr); -if (ipv6) +if (ipv6) {
examples/ip_fragmentation/main.c struct rte_lpm6_config lpm6_config = {
Quoted 10 lines
examples/ip_fragmentation/main.c +3
-2eth_hdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv6); - else + }else { eth_hdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv4); + m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); + } } len += len2; --
Quoted 1 line
1.8.3.1
PATCH v4 1/3 lib/librte_ip_frag: remove IP checkum offload flag
In reply to Sunil Kumar KoriFrom: Sunil Kumar Kori <[email protected]>
Currently PKT_TX_IP_CKSUM is being set into mbuf->ol_flags during fragmentation and reassemble operation implicitly. Because of this, application is forced to use checksum offload whether it is supported by platform or not.
Also documentation does not provide any expected value of ol_flags in returned mbuf (reassembled or fragmented) so application will never come to know that which offloads are enabled. So transmission may be failed for the platforms which does not support checksum offload.
Also, IPv6 does not contain any checksum field in header so setting mbuf->ol_flags with PKT_TX_IP_CKSUM is itself invalid.
So removing mentioned flag from the library.
---
v4:
- Update release notes
--- doc/guides/rel_notes/release_19_08.rst | 15 +++++++++++++++ lib/librte_ip_frag/rte_ipv4_reassembly.c | 3 --- lib/librte_ip_frag/rte_ipv6_reassembly.c | 3 --- 3 files changed, 15 insertions(+), 6 deletions(-)
doc/guides/rel_notes/release_19_08.rst +15 -0
@@ -281,6 +281,21 @@ ABI Changes * bbdev: New operations and parameters added to support new 5GNR operations. The bbdev ABI is still kept experimental. +* ip_fragmentation: IP fragmentation library converts input mbuf into fragments + using input MTU size via ``rte_ipv4_fragment_packet`` interface. + Once fragmentation is done, each ``mbuf->ol_flags`` are set to enable IP + checksum H/W offload irrespective of the platform capability. + Cleared IP checksum H/W offload flag from the library. The application must + set this flag if it is supported by the platform and application wishes to + use it. + +* ip_reassembly: IP reassembly library converts the list of fragments into a + reassembled packet via ``rte_ipv4_frag_reassemble_packet`` interface. + Once reassembly is done, ``mbuf->ol_flags`` are set to enable IP checksum H/W + offload irrespective of the platform capability. Cleared IP checksum H/W + offload flag from the library. The application must set this flag if it is + supported by the platform and application wishes to use it. + Shared Library Versions -----------------------
lib/librte_ip_frag/rte_ipv4_reassembly.c +0 -3
@@ -66,9 +66,6 @@ ipv4_frag_reassemble(struct ip_frag_pkt *fp) m = fp->frags[IP_FIRST_FRAG_IDX ].mb; fp->frags[IP_FIRST_FRAG_IDX ].mb =NULL ; -/* update mbuf fields for reassembled packet. */ - m->ol_flags |=PKT_TX_IP_CKSUM ; -/* update ipv4 header for the reassembled packet */ ip_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *, m->l2_len);
lib/librte_ip_frag/rte_ipv6_reassembly.c +0 -3
@@ -89,9 +89,6 @@ ipv6_frag_reassemble(struct ip_frag_pkt *fp) m = fp->frags[IP_FIRST_FRAG_IDX ].mb; fp->frags[IP_FIRST_FRAG_IDX ].mb =NULL ; -/* update mbuf fields for reassembled packet. */ - m->ol_flags |=PKT_TX_IP_CKSUM ; -/* update ipv6 header for the reassembled datagram */ ip_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *, m->l2_len);
Signature · 1 line
2.22.0
PATCH v4 2/3 examples/ip_fragmentation: enable IP checksum offload
From: Sunil Kumar Kori <[email protected]>
As per the documentation to use any IP offload features, application must set required offload flags into mbuf->ol_flags.
---
v4:
- Rebased to top of tree
- Fix check-gitlog.sh issues
--- examples/ip_fragmentation/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
examples/ip_fragmentation/main.c +4 -2
@@ -357,12 +357,14 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,/* src addr */ rte_ether_addr_copy (&ports_eth_addr[port_out], ð_hdr->s_addr); -if (ipv6) +if (ipv6) { eth_hdr->ether_type =rte_be_to_cpu_16 (RTE_ETHER_TYPE_IPV6 ); -else + }else { eth_hdr->ether_type =rte_be_to_cpu_16 (RTE_ETHER_TYPE_IPV4 ); + m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); + } } len += len2;
Signature · 1 line
2.22.0
PATCH v4 3/3 examples/ip_reassembly: enable IP checksum offload
In reply to [email protected]From: Sunil Kumar Kori <[email protected]>
As per the documentation to use any IP offload features, application must set required offload flags into mbuf->ol_flags.
---
v4:
- Rebased to top of tree
- Fix check-gitlog.sh issues
--- examples/ip_reassembly/main.c | 3 +++ 1 file changed, 3 insertions(+)
examples/ip_reassembly/main.c +3 -0
@@ -353,6 +353,9 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, struct rte_ether_hdr *); ip_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); } + +/* update offloading flags */ + m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); } ip_dst =rte_be_to_cpu_32 (ip_hdr->dst_addr);
Signature · 1 line
2.22.0
Thomas Monjalon
AppliedRe: [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag
In reply to [email protected]08/07/2019 06:32, [email protected]:
Quoted 12 lines
From: Sunil Kumar Kori <[email protected]>
Currently
PKT_TX_IP_CKSUMis being set intombuf->ol_flagsduring fragmentation and reassemble operation implicitly. Because of this, application is forced to use checksum offload whether it is supported by platform or not.Also documentation does not provide any expected value of
ol_flagsin returned mbuf (reassembled or fragmented) so application will never come to know that which offloads are enabled. So transmission may be failed for the platforms which does not support checksum offload.
Quoted 7 lines
Also, IPv6 does not contain any checksum field in header so setting
mbuf->ol_flagswithPKT_TX_IP_CKSUMis itself invalid.So removing mentioned flag from the library.
Signed-off-by Sunil Kumar Kori <[email protected]>
Applied, thanks
PS: I move the release notes from ABI to API changes as it is an API behaviour change.
PATCH v2 3/3 examples/ip_reassembly: Enabling IP checksum offload in mbuf
In reply to Sunil Kumar KoriAs per the documentation to use any IP offload features, application must set required offload flags into mbuf->ol_flags.
--- examples/ip_reassembly/main.c | 6 ++++++ 1 file changed, 6 insertions(+)
examples/ip_reassembly/main.c +6 -0
@@ -353,6 +353,9 @@ struct rte_lpm6_config lpm6_config = { struct ether_hdr *); ip_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); } + +/* update offloading flags */ + m->ol_flags |= (PKT_TX_IPV4 |PKT_TX_IP_CKSUM ); } ip_dst =rte_be_to_cpu_32 (ip_hdr->dst_addr);
@@ -391,6 +394,9 @@ struct rte_lpm6_config lpm6_config = { eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); ip_hdr = (struct ipv6_hdr *)(eth_hdr +1 ); } + +/* update offloading flags */ + m->ol_flags |=PKT_TX_IPV6 ; }/* Find destination port */
Signature · 1 line
1.8.3.1