You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用DPDK剥离MPLS报头遇动作不支持错误的技术问询

问题:DPDK流规则添加MPLS剥离动作失败

基于DPDK的flow_filtering示例程序,尝试配置流匹配规则及动作如下:

  • 匹配模式:Ethernet → MPLS → IPv4 → END
  • 动作:RTE_FLOW_ACTION_TYPE_OF_POP_MPLS → RTE_FLOW_ACTION_TYPE_END

执行代码时抛出错误:Flow can't be created 16 message: Not supported action.

代码片段

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

测试情况

移除pattern[1].type = RTE_FLOW_ITEM_TYPE_MPLS;和action[0].type = RTE_FLOW_ACTION_TYPE_OF_POP_MPLS;后,代码可正常运行;尝试调整MPLS在匹配模式中的顺序(尽管MPLS报头位于L2和L3之间),问题仍未解决。

环境信息

  • Linux: CentOS 7
  • DPDK: 19.08.2
  • NIC: X520
  • Firmware version: 18.5.17

内容的提问来源于stack exchange,提问作者Tanzeel Ahmed

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.13 04:30:58