DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Didier Pallard <didier.pallard@6wind.com>, dev@dpdk.org
Cc: stable@dpdk.org,
	Konstantin Ananyev <konstantin.ananyev@intel.com>,
	Tomasz Kulasek <tomaszx.kulasek@intel.com>
Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] net: fix Intel prepare function for IP checksum offload
Date: Wed, 19 Sep 2018 18:50:37 +0100	[thread overview]
Message-ID: <bce07b9d-ab5e-b5f7-7b52-5cf276dc79ea@intel.com> (raw)
In-Reply-To: <20180919144208.17064-1-didier.pallard@6wind.com>

On 9/19/2018 3:42 PM, Didier Pallard wrote:
> Current Intel tx prepare function does not properly handle the
> case where only IP checksum is requested, without requesting
> any L4 checksum or TSO: IP checksum is not properly reset to 0
> and output packet may contain invalid IP checksum.
> 
> Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
> Cc: stable@dpdk.org

cc'ed developer.

> 
> Signed-off-by: Didier Pallard <didier.pallard@6wind.com>
> ---
>  lib/librte_net/rte_net.h | 20 ++++++++------------
>  1 file changed, 8 insertions(+), 12 deletions(-)
> 
> diff --git a/lib/librte_net/rte_net.h b/lib/librte_net/rte_net.h
> index b6ab6e1d57b2..e59760a0a108 100644
> --- a/lib/librte_net/rte_net.h
> +++ b/lib/librte_net/rte_net.h
> @@ -122,14 +122,16 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
>  		(ol_flags & PKT_TX_OUTER_IPV6))
>  		inner_l3_offset += m->outer_l2_len + m->outer_l3_len;
>  
> -	if ((ol_flags & PKT_TX_UDP_CKSUM) == PKT_TX_UDP_CKSUM) {
> -		if (ol_flags & PKT_TX_IPV4) {
> -			ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
> -					inner_l3_offset);
> +	if (ol_flags & PKT_TX_IPV4) {
> +		ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
> +				inner_l3_offset);
>  
> -			if (ol_flags & PKT_TX_IP_CKSUM)
> -				ipv4_hdr->hdr_checksum = 0;
> +		if (ol_flags & PKT_TX_IP_CKSUM)
> +			ipv4_hdr->hdr_checksum = 0;
> +	}
>  
> +	if ((ol_flags & PKT_TX_UDP_CKSUM) == PKT_TX_UDP_CKSUM) {
> +		if (ol_flags & PKT_TX_IPV4) {
>  			udp_hdr = (struct udp_hdr *)((char *)ipv4_hdr +
>  					m->l3_len);
>  			udp_hdr->dgram_cksum = rte_ipv4_phdr_cksum(ipv4_hdr,
> @@ -146,12 +148,6 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
>  	} else if ((ol_flags & PKT_TX_TCP_CKSUM) ||
>  			(ol_flags & PKT_TX_TCP_SEG)) {
>  		if (ol_flags & PKT_TX_IPV4) {
> -			ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
> -					inner_l3_offset);
> -
> -			if (ol_flags & PKT_TX_IP_CKSUM)
> -				ipv4_hdr->hdr_checksum = 0;
> -
>  			/* non-TSO tcp or TSO */
>  			tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr +
>  					m->l3_len);
> 

  reply	other threads:[~2018-09-19 17:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-19 14:42 [dpdk-dev] " Didier Pallard
2018-09-19 17:50 ` Ferruh Yigit [this message]
2018-09-20 14:53 ` Ananyev, Konstantin
2018-09-21  1:12   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bce07b9d-ab5e-b5f7-7b52-5cf276dc79ea@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=didier.pallard@6wind.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=stable@dpdk.org \
    --cc=tomaszx.kulasek@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).