I am trying to strip MPLS header using DPDK, I have use the flow_filtering sample application as starting and tried to add another item in the pattern: Ethernet MPLS IPv4 END and I added the following action: RTE_FLOW_ACTION_TYPE_OF_POP_MPLS RTE_FLOW_ACTION_TYPE_END But while executing the code following error is thrown: Flow can't be created 16 message: Not supported action.
Following is the snippet of the code:
action[0].type = RTE_FLOW_ACTION_TYPE_OF_POP_MPLS;
action[1].type = RTE_FLOW_ACTION_TYPE_END;
pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH;
pattern[1].type = RTE_FLOW_ITEM_TYPE_MPLS;
memset(&ip_spec, 0, sizeof(struct rte_flow_item_ipv4));
memset(&ip_mask, 0, sizeof(struct rte_flow_item_ipv4));
ip_spec.hdr.dst_addr = htonl(dest_ip);
ip_mask.hdr.dst_addr = dest_mask;
ip_spec.hdr.src_addr = htonl(src_ip);
ip_mask.hdr.src_addr = src_mask;
pattern[2].type = RTE_FLOW_ITEM_TYPE_IPV4;
pattern[2].spec = &ip_spec;
pattern[2].mask = &ip_mask;
pattern[3].type = RTE_FLOW_ITEM_TYPE_END;
res = rte_flow_validate(port_id, &attr, pattern, action, error);
By removing the pattern[1].type = RTE_FLOW_ITEM_TYPE_MPLS; and action[0].type = RTE_FLOW_ACTION_TYPE_OF_POP_MPLS;. The code works fine.
I tried to change the order of MPLS in pattern even though MPLS header reside between L2 and L3 layer but no use.
Version:
Linux: CentOS 7
DPDK: 19.08.2
NIC: X520
Firmware version: 18.5.17