security: add UDP parameters for IPsec NAT-T
authorRadu Nicolau <radu.nicolau@intel.com>
Thu, 14 Oct 2021 16:03:23 +0000 (17:03 +0100)
committerAkhil Goyal <gakhil@marvell.com>
Sun, 17 Oct 2021 12:03:43 +0000 (14:03 +0200)
Add support for specifying UDP port params for UDP encapsulation option.
RFC3948 section-2.1 does not enforce using specific the UDP ports for
UDP-Encapsulated ESP Header

Signed-off-by: Declan Doherty <declan.doherty@intel.com>
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
Signed-off-by: Abhijit Sinha <abhijit.sinha@intel.com>
Signed-off-by: Daniel Martin Buckley <daniel.m.buckley@intel.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
doc/guides/rel_notes/deprecation.rst
doc/guides/rel_notes/release_21_11.rst
lib/security/rte_security.h

index cc9718c..46cb3e7 100644 (file)
@@ -206,9 +206,8 @@ Deprecation Notices
   pointer for the private data to the application which can be attached
   to the packet while enqueuing.
 
-* security: The structure ``rte_security_ipsec_xform`` will be extended with
-  multiple fields: source and destination port of UDP encapsulation,
-  IPsec payload MSS (Maximum Segment Size).
+* security: The structure ``rte_security_ipsec_xform`` will be extended with:
+  new field: IPsec payload MSS (Maximum Segment Size).
 
 * security: The IPsec SA config options ``struct rte_security_ipsec_sa_options``
   will be updated with new fields to support new features like TSO in case of
index 99f10c9..25424e6 100644 (file)
@@ -315,6 +315,10 @@ ABI Changes
   application to start from an arbitrary ESN value for debug and SA lifetime
   enforcement purposes.
 
+* security: A new structure ``udp`` was added in structure
+  ``rte_security_ipsec_xform`` to allow setting the source and destination ports
+  for UDP encapsulated IPsec traffic.
+
 * bbdev: Added capability related to more comprehensive CRC options,
   shifting values of the ``enum rte_bbdev_op_ldpcdec_flag_bitmasks``.
 
index 764ce83..17d0e95 100644 (file)
@@ -128,6 +128,11 @@ struct rte_security_ipsec_tunnel_param {
        };
 };
 
+struct rte_security_ipsec_udp_param {
+       uint16_t sport;
+       uint16_t dport;
+};
+
 /**
  * IPsec Security Association option flags
  */
@@ -326,6 +331,8 @@ struct rte_security_ipsec_xform {
                };
        } esn;
        /**< Extended Sequence Number */
+       struct rte_security_ipsec_udp_param udp;
+       /**< UDP parameters, ignored when udp_encap option not specified */
 };
 
 /**