[v2,1/3] lib/librte_ip_frag: Remove PKT_TX_IP_CKSUM offload flags
Checks
Commit Message
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(-)
Comments
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
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?
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?
> -----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
@@ -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 */
@@ -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);
@@ -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);