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 804854310C; Sat, 26 Aug 2023 10:28:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 566F340E6E; Sat, 26 Aug 2023 10:28:32 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id D0C2E4068E for ; Sat, 26 Aug 2023 10:28:30 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id A920C20719; Sat, 26 Aug 2023 10:28:30 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH v2] mbuf: add ESP packet type Date: Sat, 26 Aug 2023 10:28:26 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87B45@smartserver.smartshare.dk> In-Reply-To: <20230825233406.3647006-1-akozyrev@nvidia.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v2] mbuf: add ESP packet type Thread-Index: AdnXrLZq59+M+HFwSlalP4ZxnqB3vAAR9fUQ References: <20230810155408.2045404-1-akozyrev@nvidia.com> <20230825233406.3647006-1-akozyrev@nvidia.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Alexander Kozyrev" , Cc: , , , 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 > From: Alexander Kozyrev [mailto:akozyrev@nvidia.com] > Sent: Saturday, 26 August 2023 01.34 >=20 > Support the IP Encapsulating Security Payload (ESP) in transport mode. >=20 > Signed-off-by: Alexander Kozyrev > --- > lib/mbuf/rte_mbuf_ptype.h | 31 +++++++++++++++++++++++++++---- > 1 file changed, 27 insertions(+), 4 deletions(-) >=20 > diff --git a/lib/mbuf/rte_mbuf_ptype.h b/lib/mbuf/rte_mbuf_ptype.h > index 17a2dd3576..d20199580c 100644 > --- a/lib/mbuf/rte_mbuf_ptype.h > +++ b/lib/mbuf/rte_mbuf_ptype.h > @@ -294,10 +294,10 @@ extern "C" { Please also update the comment accordingly. E.g.: * It refers to those packets of any IP types, while cannot be = recognized as * any of above L4 types (RTE_PTYPE_L4_ICMP, RTE_PTYPE_L4_TCP, * RTE_PTYPE_L4_UDP, RTE_PTYPE_L4_FRAG (for IPv6), RTE_PTYPE_L4_ESP, * RTE_PTYPE_L4_SCTP). Please note that I took the liberty to reorder the protocols in = numerical order, and add that RTE_PTYPE_L4_FRAG only applies to IPv6. At = your preference, feel free to keep the original ordering and add = RTE_PTYPE_L4_ESP at the end, or use my suggested changes. > * > * Packet format: > * <'ether type'=3D0x0800 > - * | 'version'=3D4, 'protocol'!=3D[6|17|132|1], 'MF'=3D0, = 'frag_offset'=3D0> > + * | 'version'=3D4, 'protocol'!=3D[6|17|132|1|50], 'MF'=3D0, = 'frag_offset'=3D0> I notice that ICMP(1) is already last in the list, but this list is more = readable with the protocols enumerated in numerical order: * | 'version'=3D4, 'protocol'!=3D[1|6|17|50|132], 'MF'=3D0, = 'frag_offset'=3D0> > * or, > * <'ether type'=3D0x86DD > - * | 'version'=3D6, 'next header'!=3D[6|17|44|132|1]> > + * | 'version'=3D6, 'next header'!=3D[6|17|44|132|1|50]> Same comment about numerical order here: * | 'version'=3D6, 'next header'!=3D[1|6|17|44|50|132]> > */ > #define RTE_PTYPE_L4_NONFRAG 0x00000600 > /** > @@ -308,6 +308,17 @@ extern "C" { > * | 'version'=3D4, 'protocol'=3D2, 'MF'=3D0, 'frag_offset'=3D0> > */ > #define RTE_PTYPE_L4_IGMP 0x00000700 > +/** > + * ESP (IP Encapsulating Security Payload) transport packet type. > + * > + * Packet format: > + * <'ether type'=3D0x0800 > + * | 'version'=3D4, 'protocol'=3D50, 'MF'=3D0, 'frag_offset'=3D0> > + * or, > + * <'ether type'=3D0x86DD > + * | 'version'=3D6, 'next header'=3D50> > + */ > +#define RTE_PTYPE_L4_ESP 0x00000800 > /** > * Mask of layer 4 packet types. > * It is used for outer packet for tunneling cases. > @@ -652,12 +663,24 @@ extern "C" { > * > * Packet format (inner only): > * <'ether type'=3D0x0800 > - * | 'version'=3D4, 'protocol'!=3D[6|17|132|1], 'MF'=3D0, = 'frag_offset'=3D0> > + * | 'version'=3D4, 'protocol'!=3D[6|17|132|1|50], 'MF'=3D0, = 'frag_offset'=3D0> > * or, > * <'ether type'=3D0x86DD > - * | 'version'=3D6, 'next header'!=3D[6|17|44|132|1]> > + * | 'version'=3D6, 'next header'!=3D[6|17|44|132|1|50]> > */ > #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'=3D0x0800 > + * | 'version'=3D4, 'protocol'=3D50, 'MF'=3D0, 'frag_offset'=3D0> > + * or, > + * <'ether type'=3D0x86DD > + * | 'version'=3D6, 'next header'=3D50> > + */ > +#define RTE_PTYPE_INNER_L4_ESP 0x08000000 > /** > * Mask of inner layer 4 packet types. > */ > -- > 2.18.2 For v3, you can add: Acked-by: Morten Br=F8rup