All of lore.kernel.org
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib
@ 2019-05-16 11:24 Sunil Kumar Kori
  2019-05-16 11:24 ` [dpdk-dev] [PATCH 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:24 UTC (permalink / raw)
  To: dev; +Cc: skori

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

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
  2019-05-16 11:24 [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
@ 2019-05-16 11:24 ` Sunil Kumar Kori
  2019-05-16 11:24 ` [dpdk-dev] [PATCH 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf Sunil Kumar Kori
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:24 UTC (permalink / raw)
  To: dev; +Cc: skori

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.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 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(-)

diff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_frag/rte_ipv4_fragmentation.c
index a96fb03..13e60fb 100644
--- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c
+++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c
@@ -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 */
diff --git a/lib/librte_ip_frag/rte_ipv4_reassembly.c b/lib/librte_ip_frag/rte_ipv4_reassembly.c
index 1029b7a..4e20431 100644
--- a/lib/librte_ip_frag/rte_ipv4_reassembly.c
+++ b/lib/librte_ip_frag/rte_ipv4_reassembly.c
@@ -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);
 
diff --git a/lib/librte_ip_frag/rte_ipv6_reassembly.c b/lib/librte_ip_frag/rte_ipv6_reassembly.c
index 855e3f7..eb8b849 100644
--- a/lib/librte_ip_frag/rte_ipv6_reassembly.c
+++ b/lib/librte_ip_frag/rte_ipv6_reassembly.c
@@ -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


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

* [dpdk-dev] [PATCH 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
  2019-05-16 11:24 [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
  2019-05-16 11:24 ` [dpdk-dev] [PATCH 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
@ 2019-05-16 11:24 ` Sunil Kumar Kori
  2019-05-16 11:24 ` [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: " Sunil Kumar Kori
  2019-05-16 11:42 ` [dpdk-dev] [PATCH v2 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
  3 siblings, 0 replies; 23+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:24 UTC (permalink / raw)
  To: dev; +Cc: skori

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 examples/ip_fragmentation/main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index e90a61e..d821967 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = {
 
 		/* src addr */
 		ether_addr_copy(&ports_eth_addr[port_out], &eth_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;
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: Enabling IP checksum offload in mbuf
  2019-05-16 11:24 [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
  2019-05-16 11:24 ` [dpdk-dev] [PATCH 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
  2019-05-16 11:24 ` [dpdk-dev] [PATCH 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf Sunil Kumar Kori
@ 2019-05-16 11:24 ` Sunil Kumar Kori
  2019-05-16 11:42 ` [dpdk-dev] [PATCH v2 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
  3 siblings, 0 replies; 23+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:24 UTC (permalink / raw)
  To: dev; +Cc: skori

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 examples/ip_reassembly/main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 17b55d4..686e364 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -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 */
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v2 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib
  2019-05-16 11:24 [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
                   ` (2 preceding siblings ...)
  2019-05-16 11:24 ` [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: " Sunil Kumar Kori
@ 2019-05-16 11:42 ` Sunil Kumar Kori
  2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
                     ` (2 more replies)
  3 siblings, 3 replies; 23+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:42 UTC (permalink / raw)
  To: dev; +Cc: skori

v2: 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(-)

-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
  2019-05-16 11:42 ` [dpdk-dev] [PATCH v2 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
@ 2019-05-16 11:42   ` Sunil Kumar Kori
  2019-05-18 15:18     ` Ananyev, Konstantin
  2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf Sunil Kumar Kori
  2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 3/3] examples/ip_reassembly: Enabling IP checksum offload in mbuf Sunil Kumar Kori
  2 siblings, 1 reply; 23+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:42 UTC (permalink / raw)
  To: dev; +Cc: skori

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.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
---
 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(-)

diff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_frag/rte_ipv4_fragmentation.c
index a96fb03..13e60fb 100644
--- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c
+++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c
@@ -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 */
diff --git a/lib/librte_ip_frag/rte_ipv4_reassembly.c b/lib/librte_ip_frag/rte_ipv4_reassembly.c
index 1029b7a..4e20431 100644
--- a/lib/librte_ip_frag/rte_ipv4_reassembly.c
+++ b/lib/librte_ip_frag/rte_ipv4_reassembly.c
@@ -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);
 
diff --git a/lib/librte_ip_frag/rte_ipv6_reassembly.c b/lib/librte_ip_frag/rte_ipv6_reassembly.c
index 855e3f7..eb8b849 100644
--- a/lib/librte_ip_frag/rte_ipv6_reassembly.c
+++ b/lib/librte_ip_frag/rte_ipv6_reassembly.c
@@ -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


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

* [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
  2019-05-16 11:42 ` [dpdk-dev] [PATCH v2 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
  2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
@ 2019-05-16 11:42   ` Sunil Kumar Kori
  2019-05-18 15:21     ` Ananyev, Konstantin
  2019-05-20 10:59     ` [dpdk-dev] [PATCH v3 1/2] " Sunil Kumar Kori
  2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 3/3] examples/ip_reassembly: Enabling IP checksum offload in mbuf Sunil Kumar Kori
  2 siblings, 2 replies; 23+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:42 UTC (permalink / raw)
  To: dev; +Cc: skori

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 <skori@marvell.com>
---
 examples/ip_fragmentation/main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index e90a61e..d821967 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = {
 
 		/* src addr */
 		ether_addr_copy(&ports_eth_addr[port_out], &eth_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;
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v2 3/3] examples/ip_reassembly: Enabling IP checksum offload in mbuf
  2019-05-16 11:42 ` [dpdk-dev] [PATCH v2 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
  2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
  2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf Sunil Kumar Kori
@ 2019-05-16 11:42   ` Sunil Kumar Kori
  2 siblings, 0 replies; 23+ messages in thread
From: Sunil Kumar Kori @ 2019-05-16 11:42 UTC (permalink / raw)
  To: dev; +Cc: skori

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 <skori@marvell.com>
---
 examples/ip_reassembly/main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 17b55d4..686e364 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -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 */
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
  2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
@ 2019-05-18 15:18     ` Ananyev, Konstantin
  2019-06-26 21:10       ` Thomas Monjalon
  0 siblings, 1 reply; 23+ messages in thread
From: Ananyev, Konstantin @ 2019-05-18 15:18 UTC (permalink / raw)
  To: Sunil Kumar Kori, dev


Hi,
 
> 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.

As there is a change in public API behavior, I think it deserves update in release notes.
Apart from that:
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>


> 
> Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
> ---
>  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(-)
> 
> diff --git a/lib/librte_ip_frag/rte_ipv4_fragmentation.c b/lib/librte_ip_frag/rte_ipv4_fragmentation.c
> index a96fb03..13e60fb 100644
> --- a/lib/librte_ip_frag/rte_ipv4_fragmentation.c
> +++ b/lib/librte_ip_frag/rte_ipv4_fragmentation.c
> @@ -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 */
> diff --git a/lib/librte_ip_frag/rte_ipv4_reassembly.c b/lib/librte_ip_frag/rte_ipv4_reassembly.c
> index 1029b7a..4e20431 100644
> --- a/lib/librte_ip_frag/rte_ipv4_reassembly.c
> +++ b/lib/librte_ip_frag/rte_ipv4_reassembly.c
> @@ -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);
> 
> diff --git a/lib/librte_ip_frag/rte_ipv6_reassembly.c b/lib/librte_ip_frag/rte_ipv6_reassembly.c
> index 855e3f7..eb8b849 100644
> --- a/lib/librte_ip_frag/rte_ipv6_reassembly.c
> +++ b/lib/librte_ip_frag/rte_ipv6_reassembly.c
> @@ -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


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

* Re: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
  2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf Sunil Kumar Kori
@ 2019-05-18 15:21     ` Ananyev, Konstantin
  2019-05-20  8:09       ` Sunil Kumar Kori
  2019-05-20 10:59     ` [dpdk-dev] [PATCH v3 1/2] " Sunil Kumar Kori
  1 sibling, 1 reply; 23+ messages in thread
From: Ananyev, Konstantin @ 2019-05-18 15:21 UTC (permalink / raw)
  To: Sunil Kumar Kori, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sunil Kumar Kori
> Sent: Thursday, May 16, 2019 12:42 PM
> To: dev@dpdk.org
> Cc: skori@marvell.com
> Subject: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: 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.
> 
> Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
> ---
>  examples/ip_fragmentation/main.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
> index e90a61e..d821967 100644
> --- a/examples/ip_fragmentation/main.c
> +++ b/examples/ip_fragmentation/main.c
> @@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = {
> 
>  		/* src addr */
>  		ether_addr_copy(&ports_eth_addr[port_out], &eth_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


> +		} 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


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

* Re: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
  2019-05-18 15:21     ` Ananyev, Konstantin
@ 2019-05-20  8:09       ` Sunil Kumar Kori
  2019-05-20  8:15         ` Ananyev, Konstantin
  0 siblings, 1 reply; 23+ messages in thread
From: Sunil Kumar Kori @ 2019-05-20  8:09 UTC (permalink / raw)
  To: Ananyev, Konstantin, dev

Hi,

Regards
Sunil Kumar Kori

>-----Original Message-----
>From: Ananyev, Konstantin <konstantin.ananyev@intel.com>
>Sent: Saturday, May 18, 2019 8:51 PM
>To: Sunil Kumar Kori <skori@marvell.com>; dev@dpdk.org
>Subject: [EXT] RE: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation:
>Enabling IP checksum offload in mbuf
>
>External Email
>
>----------------------------------------------------------------------
>
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sunil Kumar Kori
>> Sent: Thursday, May 16, 2019 12:42 PM
>> To: dev@dpdk.org
>> Cc: skori@marvell.com
>> Subject: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: 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.
>>
>> Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
>> ---
>>  examples/ip_fragmentation/main.c | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/examples/ip_fragmentation/main.c
>b/examples/ip_fragmentation/main.c
>> index e90a61e..d821967 100644
>> --- a/examples/ip_fragmentation/main.c
>> +++ b/examples/ip_fragmentation/main.c
>> @@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = {
>>
>>  		/* src addr */
>>  		ether_addr_copy(&ports_eth_addr[port_out], &eth_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
>
>
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.
>> +		} 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


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

* Re: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
  2019-05-20  8:09       ` Sunil Kumar Kori
@ 2019-05-20  8:15         ` Ananyev, Konstantin
  0 siblings, 0 replies; 23+ messages in thread
From: Ananyev, Konstantin @ 2019-05-20  8:15 UTC (permalink / raw)
  To: Sunil Kumar Kori, dev



> -----Original Message-----
> From: Sunil Kumar Kori [mailto:skori@marvell.com]
> Sent: Monday, May 20, 2019 9:09 AM
> To: Ananyev, Konstantin <konstantin.ananyev@intel.com>; dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
> 
> Hi,
> 
> Regards
> Sunil Kumar Kori
> 
> >-----Original Message-----
> >From: Ananyev, Konstantin <konstantin.ananyev@intel.com>
> >Sent: Saturday, May 18, 2019 8:51 PM
> >To: Sunil Kumar Kori <skori@marvell.com>; dev@dpdk.org
> >Subject: [EXT] RE: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation:
> >Enabling IP checksum offload in mbuf
> >
> >External Email
> >
> >----------------------------------------------------------------------
> >
> >
> >> -----Original Message-----
> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Sunil Kumar Kori
> >> Sent: Thursday, May 16, 2019 12:42 PM
> >> To: dev@dpdk.org
> >> Cc: skori@marvell.com
> >> Subject: [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: 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.
> >>
> >> Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
> >> ---
> >>  examples/ip_fragmentation/main.c | 7 +++++--
> >>  1 file changed, 5 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/examples/ip_fragmentation/main.c
> >b/examples/ip_fragmentation/main.c
> >> index e90a61e..d821967 100644
> >> --- a/examples/ip_fragmentation/main.c
> >> +++ b/examples/ip_fragmentation/main.c
> >> @@ -354,10 +354,13 @@ struct rte_lpm6_config lpm6_config = {
> >>
> >>  		/* src addr */
> >>  		ether_addr_copy(&ports_eth_addr[port_out], &eth_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
> >
> >
> Is this comment valid for IPv6 only ?

Yes, my comment is about the following line of code:
m->ol_flags |= PKT_TX_IPV6;

> Otherwise for IPv4, it is required as IP checksum is neither being updated by library nor
> by the application.
> >> +		} 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


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

* [dpdk-dev] [PATCH v3 1/2] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
  2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf Sunil Kumar Kori
  2019-05-18 15:21     ` Ananyev, Konstantin
@ 2019-05-20 10:59     ` Sunil Kumar Kori
  2019-05-20 10:59       ` [dpdk-dev] [PATCH v3 2/2] examples/ip_reassembly: " Sunil Kumar Kori
                         ` (2 more replies)
  1 sibling, 3 replies; 23+ messages in thread
From: Sunil Kumar Kori @ 2019-05-20 10:59 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Sunil Kumar Kori

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 <skori@marvell.com>
---
 examples/ip_fragmentation/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index e90a61e..719d6f4 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -354,10 +354,12 @@ struct rte_lpm6_config lpm6_config = {
 
 		/* src addr */
 		ether_addr_copy(&ports_eth_addr[port_out], &eth_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;
-- 
1.8.3.1


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

* [dpdk-dev] [PATCH v3 2/2] examples/ip_reassembly: Enabling IP checksum offload in mbuf
  2019-05-20 10:59     ` [dpdk-dev] [PATCH v3 1/2] " Sunil Kumar Kori
@ 2019-05-20 10:59       ` Sunil Kumar Kori
  2019-05-20 11:29         ` Ananyev, Konstantin
  2019-05-20 11:28       ` [dpdk-dev] [PATCH v3 1/2] examples/ip_fragmentation: " Ananyev, Konstantin
  2019-07-08  4:32       ` [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag jerinj
  2 siblings, 1 reply; 23+ messages in thread
From: Sunil Kumar Kori @ 2019-05-20 10:59 UTC (permalink / raw)
  To: Konstantin Ananyev; +Cc: dev, Sunil Kumar Kori

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 <skori@marvell.com>
---
 examples/ip_reassembly/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 17b55d4..0ad526c 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -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);
 
-- 
1.8.3.1


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

* Re: [dpdk-dev] [PATCH v3 1/2] examples/ip_fragmentation: Enabling IP checksum offload in mbuf
  2019-05-20 10:59     ` [dpdk-dev] [PATCH v3 1/2] " Sunil Kumar Kori
  2019-05-20 10:59       ` [dpdk-dev] [PATCH v3 2/2] examples/ip_reassembly: " Sunil Kumar Kori
@ 2019-05-20 11:28       ` Ananyev, Konstantin
  2019-07-08  4:32       ` [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag jerinj
  2 siblings, 0 replies; 23+ messages in thread
From: Ananyev, Konstantin @ 2019-05-20 11:28 UTC (permalink / raw)
  To: Sunil Kumar Kori; +Cc: dev


> 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 <skori@marvell.com>
> ---
>  examples/ip_fragmentation/main.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
> index e90a61e..719d6f4 100644
> --- a/examples/ip_fragmentation/main.c
> +++ b/examples/ip_fragmentation/main.c
> @@ -354,10 +354,12 @@ struct rte_lpm6_config lpm6_config = {
> 
>  		/* src addr */
>  		ether_addr_copy(&ports_eth_addr[port_out], &eth_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;
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 1.8.3.1


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

* Re: [dpdk-dev] [PATCH v3 2/2] examples/ip_reassembly: Enabling IP checksum offload in mbuf
  2019-05-20 10:59       ` [dpdk-dev] [PATCH v3 2/2] examples/ip_reassembly: " Sunil Kumar Kori
@ 2019-05-20 11:29         ` Ananyev, Konstantin
  0 siblings, 0 replies; 23+ messages in thread
From: Ananyev, Konstantin @ 2019-05-20 11:29 UTC (permalink / raw)
  To: Sunil Kumar Kori; +Cc: dev



> 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 <skori@marvell.com>
> ---
>  examples/ip_reassembly/main.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
> index 17b55d4..0ad526c 100644
> --- a/examples/ip_reassembly/main.c
> +++ b/examples/ip_reassembly/main.c
> @@ -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);
> 
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 1.8.3.1


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

* Re: [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
  2019-05-18 15:18     ` Ananyev, Konstantin
@ 2019-06-26 21:10       ` Thomas Monjalon
  2019-07-04 16:52         ` Thomas Monjalon
  0 siblings, 1 reply; 23+ messages in thread
From: Thomas Monjalon @ 2019-06-26 21:10 UTC (permalink / raw)
  To: Sunil Kumar Kori; +Cc: dev, Ananyev, Konstantin

18/05/2019 17:18, Ananyev, Konstantin:
> 
> Hi,
>  
> > 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.
> 
> As there is a change in public API behavior, I think it deserves update in release notes.
> Apart from that:
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

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?



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

* Re: [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
  2019-06-26 21:10       ` Thomas Monjalon
@ 2019-07-04 16:52         ` Thomas Monjalon
  2019-07-05  8:31           ` Ananyev, Konstantin
  0 siblings, 1 reply; 23+ messages in thread
From: Thomas Monjalon @ 2019-07-04 16:52 UTC (permalink / raw)
  To: Sunil Kumar Kori; +Cc: dev, Ananyev, Konstantin, jerinj

26/06/2019 23:10, Thomas Monjalon:
> 18/05/2019 17:18, Ananyev, Konstantin:
> > 
> > Hi,
> >  
> > > 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.
> > 
> > As there is a change in public API behavior, I think it deserves update in release notes.
> > Apart from that:
> > Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 
> 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?



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

* Re: [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
  2019-07-04 16:52         ` Thomas Monjalon
@ 2019-07-05  8:31           ` Ananyev, Konstantin
  0 siblings, 0 replies; 23+ messages in thread
From: Ananyev, Konstantin @ 2019-07-05  8:31 UTC (permalink / raw)
  To: Thomas Monjalon, Sunil Kumar Kori; +Cc: dev, jerinj



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Thursday, July 4, 2019 5:53 PM
> To: Sunil Kumar Kori <skori@marvell.com>
> Cc: dev@dpdk.org; Ananyev, Konstantin <konstantin.ananyev@intel.com>; jerinj@marvell.com
> Subject: 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:
> > 18/05/2019 17:18, Ananyev, Konstantin:
> > >
> > > Hi,
> > >
> > > > 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.
> > >
> > > As there is a change in public API behavior, I think it deserves update in release notes.
> > > Apart from that:
> > > Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> >
> > 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 


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

* [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag
  2019-05-20 10:59     ` [dpdk-dev] [PATCH v3 1/2] " Sunil Kumar Kori
  2019-05-20 10:59       ` [dpdk-dev] [PATCH v3 2/2] examples/ip_reassembly: " Sunil Kumar Kori
  2019-05-20 11:28       ` [dpdk-dev] [PATCH v3 1/2] examples/ip_fragmentation: " Ananyev, Konstantin
@ 2019-07-08  4:32       ` jerinj
  2019-07-08  4:32         ` [dpdk-dev] [PATCH v4 2/3] examples/ip_fragmentation: enable IP checksum offload jerinj
                           ` (2 more replies)
  2 siblings, 3 replies; 23+ messages in thread
From: jerinj @ 2019-07-08  4:32 UTC (permalink / raw)
  To: dev, John McNamara, Marko Kovacevic, Konstantin Ananyev
  Cc: thomas, Sunil Kumar Kori

From: Sunil Kumar Kori <skori@marvell.com>

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.

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
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(-)

diff --git a/doc/guides/rel_notes/release_19_08.rst b/doc/guides/rel_notes/release_19_08.rst
index defbc5e27..ad9cbf4a2 100644
--- a/doc/guides/rel_notes/release_19_08.rst
+++ b/doc/guides/rel_notes/release_19_08.rst
@@ -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
 -----------------------
diff --git a/lib/librte_ip_frag/rte_ipv4_reassembly.c b/lib/librte_ip_frag/rte_ipv4_reassembly.c
index b7b92ed28..1dda8aca0 100644
--- a/lib/librte_ip_frag/rte_ipv4_reassembly.c
+++ b/lib/librte_ip_frag/rte_ipv4_reassembly.c
@@ -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);
 
diff --git a/lib/librte_ip_frag/rte_ipv6_reassembly.c b/lib/librte_ip_frag/rte_ipv6_reassembly.c
index 169b01a5d..ad0105518 100644
--- a/lib/librte_ip_frag/rte_ipv6_reassembly.c
+++ b/lib/librte_ip_frag/rte_ipv6_reassembly.c
@@ -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);
 
-- 
2.22.0


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

* [dpdk-dev] [PATCH v4 2/3] examples/ip_fragmentation: enable IP checksum offload
  2019-07-08  4:32       ` [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag jerinj
@ 2019-07-08  4:32         ` jerinj
  2019-07-08  4:33         ` [dpdk-dev] [PATCH v4 3/3] examples/ip_reassembly: " jerinj
  2019-07-08  9:07         ` [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag Thomas Monjalon
  2 siblings, 0 replies; 23+ messages in thread
From: jerinj @ 2019-07-08  4:32 UTC (permalink / raw)
  To: dev, Konstantin Ananyev; +Cc: thomas, Sunil Kumar Kori

From: Sunil Kumar Kori <skori@marvell.com>

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 <skori@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
v4:
- Rebased to top of tree
- Fix check-gitlog.sh issues
---
 examples/ip_fragmentation/main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 85c0100f7..ccaf23ff0 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -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],
 				&eth_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;
-- 
2.22.0


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

* [dpdk-dev] [PATCH v4 3/3] examples/ip_reassembly: enable IP checksum offload
  2019-07-08  4:32       ` [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag jerinj
  2019-07-08  4:32         ` [dpdk-dev] [PATCH v4 2/3] examples/ip_fragmentation: enable IP checksum offload jerinj
@ 2019-07-08  4:33         ` jerinj
  2019-07-08  9:07         ` [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag Thomas Monjalon
  2 siblings, 0 replies; 23+ messages in thread
From: jerinj @ 2019-07-08  4:33 UTC (permalink / raw)
  To: dev, Konstantin Ananyev; +Cc: thomas, Sunil Kumar Kori

From: Sunil Kumar Kori <skori@marvell.com>

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 <skori@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
v4:
- Rebased to top of tree
- Fix check-gitlog.sh issues
---
 examples/ip_reassembly/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index fbd09341f..38b39be6b 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -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);
 
-- 
2.22.0


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

* Re: [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag
  2019-07-08  4:32       ` [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag jerinj
  2019-07-08  4:32         ` [dpdk-dev] [PATCH v4 2/3] examples/ip_fragmentation: enable IP checksum offload jerinj
  2019-07-08  4:33         ` [dpdk-dev] [PATCH v4 3/3] examples/ip_reassembly: " jerinj
@ 2019-07-08  9:07         ` Thomas Monjalon
  2 siblings, 0 replies; 23+ messages in thread
From: Thomas Monjalon @ 2019-07-08  9:07 UTC (permalink / raw)
  To: jerinj, Sunil Kumar Kori
  Cc: dev, John McNamara, Marko Kovacevic, Konstantin Ananyev

08/07/2019 06:32, jerinj@marvell.com:
> From: Sunil Kumar Kori <skori@marvell.com>
> 
> 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.
> 
> Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied, thanks

PS: I move the release notes from ABI to API changes
as it is an API behaviour change.



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

end of thread, other threads:[~2019-07-08  9:07 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 11:24 [dpdk-dev] [PATCH 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
2019-05-16 11:24 ` [dpdk-dev] [PATCH 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
2019-05-16 11:24 ` [dpdk-dev] [PATCH 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf Sunil Kumar Kori
2019-05-16 11:24 ` [dpdk-dev] [PATCH 3/3] examples/ip_reassembly: " Sunil Kumar Kori
2019-05-16 11:42 ` [dpdk-dev] [PATCH v2 0/3] Removing PKT_TX_IP_CKSUM from fragmentation/reassembly lib Sunil Kumar Kori
2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags Sunil Kumar Kori
2019-05-18 15:18     ` Ananyev, Konstantin
2019-06-26 21:10       ` Thomas Monjalon
2019-07-04 16:52         ` Thomas Monjalon
2019-07-05  8:31           ` Ananyev, Konstantin
2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 2/3] examples/ip_fragmentation: Enabling IP checksum offload in mbuf Sunil Kumar Kori
2019-05-18 15:21     ` Ananyev, Konstantin
2019-05-20  8:09       ` Sunil Kumar Kori
2019-05-20  8:15         ` Ananyev, Konstantin
2019-05-20 10:59     ` [dpdk-dev] [PATCH v3 1/2] " Sunil Kumar Kori
2019-05-20 10:59       ` [dpdk-dev] [PATCH v3 2/2] examples/ip_reassembly: " Sunil Kumar Kori
2019-05-20 11:29         ` Ananyev, Konstantin
2019-05-20 11:28       ` [dpdk-dev] [PATCH v3 1/2] examples/ip_fragmentation: " Ananyev, Konstantin
2019-07-08  4:32       ` [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag jerinj
2019-07-08  4:32         ` [dpdk-dev] [PATCH v4 2/3] examples/ip_fragmentation: enable IP checksum offload jerinj
2019-07-08  4:33         ` [dpdk-dev] [PATCH v4 3/3] examples/ip_reassembly: " jerinj
2019-07-08  9:07         ` [dpdk-dev] [PATCH v4 1/3] lib/librte_ip_frag: remove IP checkum offload flag Thomas Monjalon
2019-05-16 11:42   ` [dpdk-dev] [PATCH v2 3/3] examples/ip_reassembly: Enabling IP checksum offload in mbuf Sunil Kumar Kori

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.