On 9/28/2022 6:25 AM, Gagandeep Singh wrote:
Add support of ESP packet type in packet receive path.

Signed-off-by: Gagandeep Singh <g.si...@nxp.com>
---
  drivers/net/dpaa/dpaa_rxtx.c | 10 ++++++++++
  drivers/net/dpaa/dpaa_rxtx.h |  6 ++++++
  2 files changed, 16 insertions(+)

diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c
index 20b75efb63..22205cec30 100644
--- a/drivers/net/dpaa/dpaa_rxtx.c
+++ b/drivers/net/dpaa/dpaa_rxtx.c
@@ -178,6 +178,16 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf 
*m, void *fd_virt_addr)
                m->packet_type = RTE_PTYPE_L2_ETHER |
                        RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP;
                break;
+       case DPAA_PKT_TYPE_IPSEC_IPV4:
+               if (*((uintptr_t *)&annot->parse) & DPAA_PARSE_ESP_MASK)
+                       m->packet_type = RTE_PTYPE_L2_ETHER |
+                               RTE_PTYPE_L3_IPV4 | RTE_PTYPE_TUNNEL_ESP;
+               break;
+       case DPAA_PKT_TYPE_IPSEC_IPV6:
+               if (*((uintptr_t *)&annot->parse) & DPAA_PARSE_ESP_MASK)
+                       m->packet_type = RTE_PTYPE_L2_ETHER |
+                               RTE_PTYPE_L3_IPV6 | RTE_PTYPE_TUNNEL_ESP;
+               break;
        case DPAA_PKT_TYPE_IPV4_EXT_UDP:
                m->packet_type = RTE_PTYPE_L2_ETHER |
                        RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_UDP;

Shouldn't 'dpaa_supported_ptypes_get()' needs to be updated to notify host on the capability to report ESP types.

diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h
index 99e09196e9..b2d7c0f2a3 100644
--- a/drivers/net/dpaa/dpaa_rxtx.h
+++ b/drivers/net/dpaa/dpaa_rxtx.h
@@ -47,6 +47,7 @@
   *    L4R 0xE0 -
   *            0x20 - TCP
   *            0x40 - UDP
+ *             0x60 - IPsec
   *            0x80 - SCTP
   *    L3R 0xEDC4 (in Big Endian) -
   *            0x8000 - IPv4
@@ -63,6 +64,7 @@
   */
  #define DPAA_PARSE_MASK                       0x00F044EF00800000
  #define DPAA_PARSE_VLAN_MASK          0x0000000000700000
+#define DPAA_PARSE_ESP_MASK            0x0008000000000000
/* Parsed values (Little Endian) */
  #define DPAA_PKT_TYPE_NONE            0x0000000000000000
@@ -137,6 +139,10 @@
                        (0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_4_6)
  #define DPAA_PKT_TYPE_TUNNEL_6_4_TCP \
                        (0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_6_4)
+#define DPAA_PKT_TYPE_IPSEC_IPV4 \
+                       (0x0060000000000000 | DPAA_PKT_TYPE_IPV4)
+#define DPAA_PKT_TYPE_IPSEC_IPV6 \
+                       (0x0060000000000000 | DPAA_PKT_TYPE_IPV6)
/* Checksum Errors */
  #define DPAA_PKT_IP_CSUM_ERR          0x0000400200000000

Reply via email to