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:
parent
fb2790a535
commit
e7524271c3
@ -360,7 +360,8 @@ dpaa_supported_ptypes_get(struct rte_eth_dev *dev)
|
|||||||
RTE_PTYPE_L4_FRAG,
|
RTE_PTYPE_L4_FRAG,
|
||||||
RTE_PTYPE_L4_TCP,
|
RTE_PTYPE_L4_TCP,
|
||||||
RTE_PTYPE_L4_UDP,
|
RTE_PTYPE_L4_UDP,
|
||||||
RTE_PTYPE_L4_SCTP
|
RTE_PTYPE_L4_SCTP,
|
||||||
|
RTE_PTYPE_TUNNEL_ESP
|
||||||
};
|
};
|
||||||
|
|
||||||
PMD_INIT_FUNC_TRACE();
|
PMD_INIT_FUNC_TRACE();
|
||||||
|
@ -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 |
|
m->packet_type = RTE_PTYPE_L2_ETHER |
|
||||||
RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP;
|
RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_UDP;
|
||||||
break;
|
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:
|
case DPAA_PKT_TYPE_IPV4_EXT_UDP:
|
||||||
m->packet_type = RTE_PTYPE_L2_ETHER |
|
m->packet_type = RTE_PTYPE_L2_ETHER |
|
||||||
RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_UDP;
|
RTE_PTYPE_L3_IPV4_EXT | RTE_PTYPE_L4_UDP;
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
* L4R 0xE0 -
|
* L4R 0xE0 -
|
||||||
* 0x20 - TCP
|
* 0x20 - TCP
|
||||||
* 0x40 - UDP
|
* 0x40 - UDP
|
||||||
|
* 0x60 - IPsec
|
||||||
* 0x80 - SCTP
|
* 0x80 - SCTP
|
||||||
* L3R 0xEDC4 (in Big Endian) -
|
* L3R 0xEDC4 (in Big Endian) -
|
||||||
* 0x8000 - IPv4
|
* 0x8000 - IPv4
|
||||||
@ -63,6 +64,7 @@
|
|||||||
*/
|
*/
|
||||||
#define DPAA_PARSE_MASK 0x00F044EF00800000
|
#define DPAA_PARSE_MASK 0x00F044EF00800000
|
||||||
#define DPAA_PARSE_VLAN_MASK 0x0000000000700000
|
#define DPAA_PARSE_VLAN_MASK 0x0000000000700000
|
||||||
|
#define DPAA_PARSE_ESP_MASK 0x0008000000000000
|
||||||
|
|
||||||
/* Parsed values (Little Endian) */
|
/* Parsed values (Little Endian) */
|
||||||
#define DPAA_PKT_TYPE_NONE 0x0000000000000000
|
#define DPAA_PKT_TYPE_NONE 0x0000000000000000
|
||||||
@ -137,6 +139,10 @@
|
|||||||
(0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_4_6)
|
(0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_4_6)
|
||||||
#define DPAA_PKT_TYPE_TUNNEL_6_4_TCP \
|
#define DPAA_PKT_TYPE_TUNNEL_6_4_TCP \
|
||||||
(0x0020000000000000 | DPAA_PKT_TYPE_TUNNEL_6_4)
|
(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 */
|
/* Checksum Errors */
|
||||||
#define DPAA_PKT_IP_CSUM_ERR 0x0000400200000000
|
#define DPAA_PKT_IP_CSUM_ERR 0x0000400200000000
|
||||||
|
Loading…
Reference in New Issue
Block a user