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 4A01F45B61; Thu, 17 Oct 2024 22:47:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CCA774028F; Thu, 17 Oct 2024 22:47:49 +0200 (CEST) Received: from fhigh-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) by mails.dpdk.org (Postfix) with ESMTP id 3E0A340267 for ; Thu, 17 Oct 2024 22:47:48 +0200 (CEST) Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfhigh.phl.internal (Postfix) with ESMTP id B2D191140118; Thu, 17 Oct 2024 16:47:47 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Thu, 17 Oct 2024 16:47:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1729198067; x=1729284467; bh=olIN3o4uwNzJV+Ruk5hM+JZWIyiABGGJ9oDVjPOIOGg=; b= bJXOKO+2MyK/WiNxv4wHlQ5B9SGT/WqBFD/JDnXgPLm85nJJf+X0JdGLo+WgKOEe rVtN27xeFhkT9VDdSXu2cwL/cN1HFeX/lFgsIBIsgg4/f0KXWfvd85/Qexw8Zmq4 VIY+STXY/HY6gSeoG/P5RnaE9iwXO2Ce21+DWigR7HlCVHoHE9SjE/2fTPlf8qxQ 5cL90UAQGwNlAPC9+CtcKNuMwJS/QDIh39WHU2utpcsFxCsL32s+KmFe7pxJSdU2 SezvE31u+yq8UHojC4aml+fXZo57zXUs7KBVBlQ7OjbzRodUVXhHJf/IVWbjEwDI dzTQ8iQi9ioGBzQkKfQVKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1729198067; x= 1729284467; bh=olIN3o4uwNzJV+Ruk5hM+JZWIyiABGGJ9oDVjPOIOGg=; b=M XXTP5235PZVavgmXuT/OkXHlnhhTs33CPe8NDiTkf7+GFO4K2LvjwS/tOE4JYv2p 2/DBfaq47efZw3ttHM3MaZCjF+cFApCchA7mmwUJlcstKg9z48Qp0SWnAh2pYIEZ J4pKz/+dI7tKjmqstgH1FtG6slXcm2OwO/BqA4Tprp82ABBVgutgYtkjo0nCZdgV qRtrqx6i0MCd28HueznFnqs+ES+y1124KWDRR1zj5UnWr0916T9L2S5i0zJr2zwj TCBxTkPt0YmP7pLeEZFp591tZOSayEm3/LshdV4ody4yoZcs+5qNfovZQ3LmAgPK +fu6coTn+vRs50L7iFZCw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdehuddgudehiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdej necuhfhrohhmpefvhhhomhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjh grlhhonhdrnhgvtheqnecuggftrfgrthhtvghrnhepjeduveehieevuddutdevfffgtdeg keeuveejffejgedtgeegkefgvdeugfefkeejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvthdp nhgspghrtghpthhtohepuddvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeguvg hvseguphgukhdrohhrghdprhgtphhtthhopegushhoshhnohifshhkihesnhhvihguihgr rdgtohhmpdhrtghpthhtohepohhrihhkrgesnhhvihguihgrrdgtohhmpdhrtghpthhtoh epnhhithhhihhnugduleekkeesghhmrghilhdrtghomhdprhgtphhtthhopeholhhivhhi vghrrdhmrghtiiesieifihhnugdrtghomhdprhgtphhtthhopehmrghtrghnsehnvhhiug hirgdrtghomhdprhgtphhtthhopehjvghrihhnjhesmhgrrhhvvghllhdrtghomhdprhgt phhtthhopehrsghhrghnshgrlhhisehmrghrvhgvlhhlrdgtohhmpdhrtghpthhtohepfh gvrhhruhhhrdihihhgihhtsegrmhgurdgtohhm X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 17 Oct 2024 16:47:45 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: dsosnowski@nvidia.com, orika@nvidia.com, nithind1988@gmail.com, olivier.matz@6wind.com, matan@nvidia.com, jerinj@marvell.com, rbhansali@marvell.com, ferruh.yigit@amd.com, Alexander Kozyrev , "Akhil, Goyal" , Anoob Joseph Subject: Re: [PATCH] mbuf: add transport mode ESP packet type Date: Thu, 17 Oct 2024 22:47:43 +0200 Message-ID: <10612965.qUNvkh4Gvn@thomas> In-Reply-To: <20240822153218.3782170-1-akozyrev@nvidia.com> References: <20240822153218.3782170-1-akozyrev@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" 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 Please could we have another review? 22/08/2024 17:32, Alexander Kozyrev: > Support the IP Encapsulating Security Payload (ESP) in transport mode. > Currently, we have RTE_PTYPE_TUNNEL_ESP for the ESP tunnel mode. > Transport mode can be detected by parsing the "Next Header" field. > The Next Header is TCP for the transport mode and IP for the tunnel mode. > Add RTE_PTYPE_L4_ESP for the regular transport mode and > RTE_PTYPE_INNER_L4_ESP for the ESP over UDP packets. > > Signed-off-by: Alexander Kozyrev > --- > lib/mbuf/rte_mbuf_ptype.c | 2 ++ > lib/mbuf/rte_mbuf_ptype.h | 36 ++++++++++++++++++++++++++++++------ > 2 files changed, 32 insertions(+), 6 deletions(-) > > diff --git a/lib/mbuf/rte_mbuf_ptype.c b/lib/mbuf/rte_mbuf_ptype.c > index d6f906b06c..ab180b3dda 100644 > --- a/lib/mbuf/rte_mbuf_ptype.c > +++ b/lib/mbuf/rte_mbuf_ptype.c > @@ -50,6 +50,7 @@ const char *rte_get_ptype_l4_name(uint32_t ptype) > case RTE_PTYPE_L4_ICMP: return "L4_ICMP"; > case RTE_PTYPE_L4_NONFRAG: return "L4_NONFRAG"; > case RTE_PTYPE_L4_IGMP: return "L4_IGMP"; > + case RTE_PTYPE_L4_ESP: return "L4_ESP"; > default: return "L4_UNKNOWN"; > } > } > @@ -112,6 +113,7 @@ const char *rte_get_ptype_inner_l4_name(uint32_t ptype) > case RTE_PTYPE_INNER_L4_SCTP: return "INNER_L4_SCTP"; > case RTE_PTYPE_INNER_L4_ICMP: return "INNER_L4_ICMP"; > case RTE_PTYPE_INNER_L4_NONFRAG: return "INNER_L4_NONFRAG"; > + case RTE_PTYPE_INNER_L4_ESP: return "INNER_L4_ESP"; > default: return "INNER_L4_UNKNOWN"; > } > } > diff --git a/lib/mbuf/rte_mbuf_ptype.h b/lib/mbuf/rte_mbuf_ptype.h > index f2276e2909..c46a94f89f 100644 > --- a/lib/mbuf/rte_mbuf_ptype.h > +++ b/lib/mbuf/rte_mbuf_ptype.h > @@ -247,7 +247,7 @@ extern "C" { > * It refers to those packets of any IP types, which can be recognized as > * fragmented. A fragmented packet cannot be recognized as any other L4 types > * (RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP, RTE_PTYPE_L4_SCTP, RTE_PTYPE_L4_ICMP, > - * RTE_PTYPE_L4_NONFRAG). > + * RTE_PTYPE_L4_NONFRAG, RTE_PTYPE_L4_IGMP, RTE_PTYPE_L4_ESP). > * > * Packet format: > * <'ether type'=0x0800 > @@ -290,14 +290,15 @@ extern "C" { > * > * It refers to those packets of any IP types, while cannot be recognized as > * any of above L4 types (RTE_PTYPE_L4_TCP, RTE_PTYPE_L4_UDP, > - * RTE_PTYPE_L4_FRAG, RTE_PTYPE_L4_SCTP, RTE_PTYPE_L4_ICMP). > + * RTE_PTYPE_L4_FRAG (for IPv6), RTE_PTYPE_L4_SCTP, RTE_PTYPE_L4_ICMP, > + * RTE_PTYPE_L4_IGMP (for IPv4), RTE_PTYPE_L4_ESP). > * > * Packet format: > * <'ether type'=0x0800 > - * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0, 'frag_offset'=0> > + * | 'version'=4, 'protocol'!=[1|2|6|17|50|132], 'MF'=0, 'frag_offset'=0> > * or, > * <'ether type'=0x86DD > - * | 'version'=6, 'next header'!=[6|17|44|132|1]> > + * | 'version'=6, 'next header'!=[1|6|17|44|50|132]> > */ > #define RTE_PTYPE_L4_NONFRAG 0x00000600 > /** > @@ -308,6 +309,17 @@ extern "C" { > * | 'version'=4, 'protocol'=2, 'MF'=0, 'frag_offset'=0> > */ > #define RTE_PTYPE_L4_IGMP 0x00000700 > +/** > + * ESP (IP Encapsulating Security Payload) transport packet type. > + * > + * Packet format: > + * <'ether type'=0x0800 > + * | 'version'=4, 'protocol'=50, 'MF'=0, 'frag_offset'=0> > + * or, > + * <'ether type'=0x86DD > + * | 'version'=6, 'next header'=50> > + */ > +#define RTE_PTYPE_L4_ESP 0x00000800 > /** > * Mask of layer 4 packet types. > * It is used for outer packet for tunneling cases. > @@ -652,12 +664,24 @@ extern "C" { > * > * Packet format (inner only): > * <'ether type'=0x0800 > - * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0, 'frag_offset'=0> > + * | 'version'=4, 'protocol'!=[1|6|17|50|132], 'MF'=0, 'frag_offset'=0> > * or, > * <'ether type'=0x86DD > - * | 'version'=6, 'next header'!=[6|17|44|132|1]> > + * | 'version'=6, 'next header'!=[1|6|17|44|50|132]> > */ > #define RTE_PTYPE_INNER_L4_NONFRAG 0x06000000 > +/** > + * ESP (IP Encapsulating Security Payload) transport packet type. > + * It is used for inner packet only. > + * > + * Packet format (inner only): > + * <'ether type'=0x0800 > + * | 'version'=4, 'protocol'=50, 'MF'=0, 'frag_offset'=0> > + * or, > + * <'ether type'=0x86DD > + * | 'version'=6, 'next header'=50> > + */ > +#define RTE_PTYPE_INNER_L4_ESP 0x08000000 > /** > * Mask of inner layer 4 packet types. > */ >