> From: Alexander Kozyrev [mailto:akozy...@nvidia.com] > Sent: Saturday, 26 August 2023 01.34 > > Support the IP Encapsulating Security Payload (ESP) in transport mode. > > Signed-off-by: Alexander Kozyrev <akozy...@nvidia.com> > --- > lib/mbuf/rte_mbuf_ptype.h | 31 +++++++++++++++++++++++++++---- > 1 file changed, 27 insertions(+), 4 deletions(-) > > 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'=0x0800 > - * | 'version'=4, 'protocol'!=[6|17|132|1], 'MF'=0, 'frag_offset'=0> > + * | 'version'=4, 'protocol'!=[6|17|132|1|50], 'MF'=0, 'frag_offset'=0> 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'=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'!=[6|17|44|132|1|50]> Same comment about numerical order here: * | 'version'=6, 'next header'!=[1|6|17|44|50|132]> > */ > #define RTE_PTYPE_L4_NONFRAG 0x00000600 > /** > @@ -308,6 +308,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 +663,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'!=[6|17|132|1|50], 'MF'=0, 'frag_offset'=0> > * or, > * <'ether type'=0x86DD > - * | 'version'=6, 'next header'!=[6|17|44|132|1]> > + * | 'version'=6, 'next header'!=[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'=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. > */ > -- > 2.18.2 For v3, you can add: Acked-by: Morten Brørup <m...@smartsharesystems.com>