From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id BD7312BB9 for ; Thu, 8 Jun 2017 14:25:47 +0200 (CEST) Received: by mail-wm0-f44.google.com with SMTP id 7so136804251wmo.1 for ; Thu, 08 Jun 2017 05:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N0HzMaA3HSCnmCqabLJLnM/UZZg5EXSRDmnciz9PryM=; b=locUpRfxylH8Ju2IbBD30HbhTUqB9GUHiOatRRRDu2dWrv4P2UT3lJW2uZWf6KmMRF 1YxuWSVzjp60ALMDrNWA80UXrTDpCg9psL1Vw5A+sQmpQYq5FWF2KCXAl6ayJG3yfdBN yC7P6OOyU9BDOjscl4LicYcQRP09ZNsDN4sUWMrTT5rXNNilbX268Piho1Bi6uh7aWaE BMOS7YETS1lqdE14x3uHBjy5jhnn5MWMaaX3mj28+6LkM/du/A2F7QENYCKjTXnREXXj TzJ90bjORlz6xruN3ZVKuHEd3f14HYm6W+kxIMryZ+/08yeEt3f8XXqoBYxMWjRqhejQ jz8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=N0HzMaA3HSCnmCqabLJLnM/UZZg5EXSRDmnciz9PryM=; b=F64cDaP/B4b4u04HUNaaHjfRCItLRGzbWRAA5YqKuxWB2fZgHv6J1JDdaiEoTx6g07 inhrCVIO8cgaU9J6Qy8nCc17GVohmumNBpqkR2r5P3SENTIR/MaCbPLS+mCP0TVXTVSn YNmPTMpdyOZHrlA10+CvqU2cP0gLfY2EwtV2hkUijiGveu2bOCmtA9FUUG/nV9ZJJXf8 cceOfAVWGseXxkzIGKcM93iTLxHyBxDVIiXtEleDTsR9FgLwi7PcG4NXheUyyHzQUwwg UHWWTggaZMW1WLdrLEb6BpvRtzQSmmh+cdXUZuRlEENBdvckvVSa5DwHEGgusOtlwz5/ JVqQ== X-Gm-Message-State: AKS2vOw3my2rL/qKNhvGUqmJO5pPuTpV5Dh/ks/02br5qRo5jSKeVhe1 3tIcu6fga6IeBRckO4c= X-Received: by 10.28.63.9 with SMTP id m9mr3480589wma.87.1496924747383; Thu, 08 Jun 2017 05:25:47 -0700 (PDT) Received: from platinum (2a01cb0c03c651000226b0fffeed02fc.ipv6.abo.wanadoo.fr. [2a01:cb0c:3c6:5100:226:b0ff:feed:2fc]) by smtp.gmail.com with ESMTPSA id z184sm139137wmz.0.2017.06.08.05.25.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jun 2017 05:25:47 -0700 (PDT) Date: Thu, 8 Jun 2017 14:25:45 +0200 From: Olivier Matz To: Rasesh Mody Cc: , Harish Patil , Message-ID: <20170608142545.10cc8326@platinum> In-Reply-To: <1496821429-6954-1-git-send-email-rasesh.mody@cavium.com> References: <1495960654-352-1-git-send-email-rasesh.mody@cavium.com> <1496821429-6954-1-git-send-email-rasesh.mody@cavium.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 1/2] mbuf: introduce new Tx offload flag for MPLS-in-UDP 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: Thu, 08 Jun 2017 12:25:48 -0000 Hi Rasesh, On Wed, 7 Jun 2017 00:43:48 -0700, Rasesh Mody wrote: > From: Harish Patil > > Some PMDs need to know the tunnel type in order to handle advance TX > features. This patch adds a new TX offload flag for MPLS-in-UDP packets. > > Signed-off-by: Harish Patil > --- > lib/librte_mbuf/rte_mbuf.c | 2 ++ > lib/librte_mbuf/rte_mbuf.h | 17 ++++++++++------- > 2 files changed, 12 insertions(+), 7 deletions(-) > > diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c > index 0e3e36a..c2793fb 100644 > --- a/lib/librte_mbuf/rte_mbuf.c > +++ b/lib/librte_mbuf/rte_mbuf.c > @@ -410,6 +410,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask) > case PKT_TX_TUNNEL_IPIP: return "PKT_TX_TUNNEL_IPIP"; > case PKT_TX_TUNNEL_GENEVE: return "PKT_TX_TUNNEL_GENEVE"; > case PKT_TX_MACSEC: return "PKT_TX_MACSEC"; > + case PKT_TX_TUNNEL_MPLSINUDP: return "PKT_TX_TUNNEL_MPLSINUDP"; > default: return NULL; > } > } > @@ -441,6 +442,7 @@ const char *rte_get_tx_ol_flag_name(uint64_t mask) > { PKT_TX_TUNNEL_GENEVE, PKT_TX_TUNNEL_MASK, > "PKT_TX_TUNNEL_NONE" }, > { PKT_TX_MACSEC, PKT_TX_MACSEC, NULL }, > + { PKT_TX_TUNNEL_MPLSINUDP, PKT_TX_TUNNEL_MPLSINUDP, NULL }, > }; > const char *name; > unsigned int i; > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > index 1cb0310..27ad421 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -197,19 +197,22 @@ > * Offload the MACsec. This flag must be set by the application to enable > * this offload feature for a packet to be transmitted. > */ > -#define PKT_TX_MACSEC (1ULL << 44) > +#define PKT_TX_MACSEC (1ULL << 43) I'm not sure it is suitable to change the value of an existing flag, since it breaks the ABI. > /** > - * Bits 45:48 used for the tunnel type. > + * Bits 44:48 used for the tunnel type. > * When doing Tx offload like TSO or checksum, the HW needs to configure the > * tunnel type into the HW descriptors. > */ > -#define PKT_TX_TUNNEL_VXLAN (0x1ULL << 45) > -#define PKT_TX_TUNNEL_GRE (0x2ULL << 45) > -#define PKT_TX_TUNNEL_IPIP (0x3ULL << 45) > -#define PKT_TX_TUNNEL_GENEVE (0x4ULL << 45) > +/**< TX packet with MPLS-in-UDP RFC 7510 header. */ > +#define PKT_TX_TUNNEL_MPLSINUDP (0x1ULL << 44) > + > +#define PKT_TX_TUNNEL_VXLAN (0x2ULL << 44) > +#define PKT_TX_TUNNEL_GRE (0x3ULL << 44) > +#define PKT_TX_TUNNEL_IPIP (0x4ULL << 44) > +#define PKT_TX_TUNNEL_GENEVE (0x5ULL << 45) > /* add new TX TUNNEL type here */ > -#define PKT_TX_TUNNEL_MASK (0xFULL << 45) > +#define PKT_TX_TUNNEL_MASK (0x1FULL << 44) > > /** > * Second VLAN insertion (QinQ) flag. I dont understand why adding #define PKT_TX_TUNNEL_MPLSINUDP (0x5ULL << 45) wouldn't do the job? Currently, the tunnel mask is 0xF << 45, which gives 16 possible values. Regards, Olivier