From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5C40A42C40; Tue, 6 Jun 2023 17:20:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D5BFC4067B; Tue, 6 Jun 2023 17:20:02 +0200 (CEST) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mails.dpdk.org (Postfix) with ESMTP id 70EE440223 for ; Tue, 6 Jun 2023 17:20:01 +0200 (CEST) Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-30ad99fa586so6183770f8f.2 for ; Tue, 06 Jun 2023 08:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; t=1686064801; x=1688656801; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=i7HnN0v1UUYutBO8h1jjjPF5RKglsAdWSFFC5JMKpHw=; b=A9V5T3ai1wyAe4Te94x3+5NDrC5ZAlwPWzq5v2ExDvnewPELzBU+mSNHr+x86bdGL6 hZL6wrd+mqLo8mQGlP0ATVRs4LR11EVSOsq5KkfxGNw5W9kcFufzrCINzcsLcWGyDdgN 23kpWzzQYaNqSnPM9JOo7UV+CPC7Li0JuCNgNU6v3Wo/Rn+di+UUcp7Lhigqx+w2u23t YHOuP04cwpcUItgeGyAJnq0wYtbQ7EoAxFDUg3jjaIT/oojmt3vL9DZLyN80/gfmtCPz ziZtRFBUkg9eyQp1SwpphgINOT6ACw0fz1yDOm6R+eZsxm7FTFe7hgTWnkDO7D6vCboo mr5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686064801; x=1688656801; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=i7HnN0v1UUYutBO8h1jjjPF5RKglsAdWSFFC5JMKpHw=; b=jLVPwso+MYStEaY6tva8HwnV5PRJ6hmQeNFut1pEFpxMOOzRfkt2J6a0zUXppXTGiv AlnHK8DsULCujsRIFPvA6/vJD/D9VDoBNCcHuT4mn9++M6LuFNmlwnb11+O9FfnpR3Nv FFosr1vIH5SDBJ59en0zG+QAn7hC//6ZUgf3//HcwqmXm3I1b8MGL5FholEDzhHEnS2o LXHawcUKJWv229ENKKJeIivRJG+UI9jtkLaNpbIPb1iHc4gDKku154/K1wOPjKNJmhdL y0vkTopUpTnXeGQRqyUq1XtQNMwnMw5RELFr6M5H3GuVTa67eAMY8ywYJf098YwAsEb+ BQGg== X-Gm-Message-State: AC+VfDyp4v3dNrrN4j8KhaCQ7W0k+d4IpBiiU9NKOhpujZTt+I9k4gow 0cXWTsPz+m+wneAiRoZaS73Vfg== X-Google-Smtp-Source: ACHHUZ4x+cLtvHYkWRl0p3pIKqqMyT4pZ3eHLqHey4AOpLHtFQQInVlPzBMDFCNqDvoRGOUZez0PBQ== X-Received: by 2002:adf:e5c9:0:b0:306:2cc8:a337 with SMTP id a9-20020adfe5c9000000b003062cc8a337mr2067761wrn.45.1686064800993; Tue, 06 Jun 2023 08:20:00 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id d24-20020a1c7318000000b003f6129d2e30sm18080271wmb.1.2023.06.06.08.20.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 08:20:00 -0700 (PDT) Date: Tue, 6 Jun 2023 17:19:59 +0200 From: Olivier Matz To: Zhichao Zeng Cc: dev@dpdk.org, qi.z.zhang@intel.com, ke1.xu@intel.com Subject: Re: [PATCH 1/4] net: calculate correct UDP pseudo header for UFO Message-ID: References: <20230413053401.4190743-1-zhichaox.zeng@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230413053401.4190743-1-zhichaox.zeng@intel.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Zeng, On Thu, Apr 13, 2023 at 01:34:00PM +0800, Zhichao Zeng wrote: > This commit calculates the correct pseudo header for the > UDP fragmentation offload by adding UDP_SEG flag. > > Signed-off-by: Zhichao Zeng Sorry for the late feedback. The patch looks good to me, thanks! I don't think we need to Cc stable or add a "Fixes:" tag, as this feature was not supported by any driver before your series. Acked-by: Olivier Matz > --- > lib/net/rte_ip.h | 4 ++-- > lib/net/rte_net.h | 5 +++-- > 2 files changed, 5 insertions(+), 4 deletions(-) > > diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h > index a310e9d498..8073c8e889 100644 > --- a/lib/net/rte_ip.h > +++ b/lib/net/rte_ip.h > @@ -345,7 +345,7 @@ rte_ipv4_phdr_cksum(const struct rte_ipv4_hdr *ipv4_hdr, uint64_t ol_flags) > psd_hdr.dst_addr = ipv4_hdr->dst_addr; > psd_hdr.zero = 0; > psd_hdr.proto = ipv4_hdr->next_proto_id; > - if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) { > + if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) { > psd_hdr.len = 0; > } else { > l3_len = rte_be_to_cpu_16(ipv4_hdr->total_length); > @@ -596,7 +596,7 @@ rte_ipv6_phdr_cksum(const struct rte_ipv6_hdr *ipv6_hdr, uint64_t ol_flags) > } psd_hdr; > > psd_hdr.proto = (uint32_t)(ipv6_hdr->proto << 24); > - if (ol_flags & RTE_MBUF_F_TX_TCP_SEG) { > + if (ol_flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG)) { > psd_hdr.len = 0; > } else { > psd_hdr.len = ipv6_hdr->payload_len; > diff --git a/lib/net/rte_net.h b/lib/net/rte_net.h > index 56611fc8f9..ef3ff4c6fd 100644 > --- a/lib/net/rte_net.h > +++ b/lib/net/rte_net.h > @@ -121,7 +121,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) > * no offloads are requested. > */ > if (!(ol_flags & (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_L4_MASK | RTE_MBUF_F_TX_TCP_SEG | > - RTE_MBUF_F_TX_OUTER_IP_CKSUM))) > + RTE_MBUF_F_TX_UDP_SEG | RTE_MBUF_F_TX_OUTER_IP_CKSUM))) > return 0; > > if (ol_flags & (RTE_MBUF_F_TX_OUTER_IPV4 | RTE_MBUF_F_TX_OUTER_IPV6)) { > @@ -154,7 +154,8 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) > ipv4_hdr->hdr_checksum = 0; > } > > - if ((ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_UDP_CKSUM) { > + if ((ol_flags & RTE_MBUF_F_TX_L4_MASK) == RTE_MBUF_F_TX_UDP_CKSUM || > + (ol_flags & RTE_MBUF_F_TX_UDP_SEG)) { > if (ol_flags & RTE_MBUF_F_TX_IPV4) { > udp_hdr = (struct rte_udp_hdr *)((char *)ipv4_hdr + > m->l3_len); > -- > 2.25.1 >