RTE_FLOW_ITEM_TYPE_MACSEC was never added to rte_flow_desc_item[].
The table uses designated initializers, so the MACSEC slot is zero
filled: its name is NULL and its size is zero.

As a result, RTE_FLOW_CONV_OP_ITEM_NAME on MACSEC passes a NULL
source to strlcpy(), and rte_flow_copy() as well as the pattern
conversion operations reject any pattern containing a MACSEC item
as an unknown item type.

Add the missing descriptor entry.

Fixes: 0aaf097585a6 ("ethdev: add MACsec flow item")
Cc: [email protected]

Signed-off-by: Anatoly Burakov <[email protected]>
---
 lib/ethdev/rte_flow.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c
index 0ebf59165d4..eeab79aa5d9 100644
--- a/lib/ethdev/rte_flow.c
+++ b/lib/ethdev/rte_flow.c
@@ -229,6 +229,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] 
= {
                        rte_flow_item_l2tpv2_mask),
        MK_FLOW_ITEM_MASK(PPP, sizeof(struct rte_flow_item_ppp),
                        rte_flow_item_ppp_mask),
+       MK_FLOW_ITEM(MACSEC, sizeof(struct rte_flow_item_macsec)),
        MK_FLOW_ITEM_MASK(METER_COLOR, sizeof(struct rte_flow_item_meter_color),
                        rte_flow_item_meter_color_mask),
        MK_FLOW_ITEM(IPV6_ROUTING_EXT, sizeof(struct 
rte_flow_item_ipv6_routing_ext)),
-- 
2.52.0

Reply via email to