net/dpaa: support ESP type in packet parsing

Add support of ESP packet type in packet receive path.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
This commit is contained in:
Gagandeep Singh 2022-10-07 08:57:33 +05:30 committed by Ferruh Yigit
parent fb2790a535
commit e7524271c3
3 changed files with 18 additions and 1 deletions

View File

@ -360,7 +360,8 @@ dpaa_supported_ptypes_get(struct rte_eth_dev *dev)
RTE_PTYPE_L4_FRAG,
RTE_PTYPE_L4_TCP,
RTE_PTYPE_L4_UDP,
RTE_PTYPE_L4_SCTP
RTE_PTYPE_L4_SCTP,
RTE_PTYPE_TUNNEL_ESP
};
PMD_INIT_FUNC_TRACE();

View File

@ -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;

View File

@ -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