From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.droids-corp.org (zoll.droids-corp.org [94.23.50.67]) by dpdk.org (Postfix) with ESMTP id 989361B2B8 for ; Tue, 16 Jan 2018 18:10:18 +0100 (CET) Received: from lfbn-lil-1-110-231.w90-45.abo.wanadoo.fr ([90.45.197.231] helo=droids-corp.org) by mail.droids-corp.org with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ebUkZ-0000al-6W; Tue, 16 Jan 2018 18:10:16 +0100 Received: by droids-corp.org (sSMTP sendmail emulation); Tue, 16 Jan 2018 18:10:10 +0100 Date: Tue, 16 Jan 2018 18:10:10 +0100 From: Olivier Matz To: Xueming Li Cc: Thomas Monjalon , Jingjing Wu , Yongseok Koh , Shahaf Shuler , dev@dpdk.org Message-ID: <20180116171010.vt25o6uq3kb7cpzd@platinum> References: <20180109141110.146250-1-xuemingl@mellanox.com> <20180109141110.146250-5-xuemingl@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180109141110.146250-5-xuemingl@mellanox.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH 4/6] ethdev: introduce TX common tunnel offloads X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2018 17:10:19 -0000 Hi Xueming, On Tue, Jan 09, 2018 at 10:11:08PM +0800, Xueming Li wrote: > This patch introduce new DEV_TX_OFFLOAD_GENERIC_TNL_CKSUM_TSO flag for > devices that support tunnel agnostic TX checksum and tso offloading. > > Checksum offset and TSO header length are calculated based on mbuf > inner length l*_len, outer_l*_len and tx offload flags PKT_TX_*, tunnel > header length is part of inner l2_len, so device HW do cheksum and TSO > calculation w/o knowledge of perticular tunnel type. > > When set application must guarantee that correct header types and > lengths for each inner and outer headers in mbuf header, no need to > specify tunnel type. > > Signed-off-by: Xueming Li > --- > lib/librte_ether/rte_ethdev.h | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index 57b61ed41..8457d01be 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -1003,6 +1003,15 @@ struct rte_eth_conf { > * the same mempool and has refcnt = 1. > */ > #define DEV_TX_OFFLOAD_SECURITY 0x00020000 > +/**< Device supports arbitrary tunnel chksum and tso offloading w/o knowing > + * tunnel detail. Checksum and TSO are calculated based on mbuf fields: > + * l*_len, outer_l*_len > + * PKT_TX_OUTER_IPV6, PKT_TX_IPV6 > + * PKT_TX_IP_CKSUM, PKT_TX_TCP_CKSUM, PKT_TX_UDP_CKSUM > + * When set application must guarantee correct header fields, no need to > + * specify tunnel type PKT_TX_TUNNEL_* for HW. > + */ > +#define DEV_TX_OFFLOAD_GENERIC_TNL_CKSUM_TSO 0x00040000 > > struct rte_pci_device; > I'd like to have more details about this flag and its meaning. Let's say we want to do TSO on the following vxlan packet: Ether / IP1 / UDP / VXLAN / Ether / IP2 / TCP / Data With the current API, we need to pass the tunnel type to the hardware with the flag PKT_TX_TUNNEL_VXLAN. Thanks to that, the driver can forward this information to the hardware so it knows that the ip1->length, udp->length and optionally the udp->chksum have to be updated for each generated segment. With your proposal, if I understand properly, it is not expected to pass the tunnel type in the mbuf. So how can the hardware know if some fields have to be updated in the outer header?