How to write a flow pattern in test-pmd that can identify the TCP port?
Bob Chen
a175818323 at gmail.com
Thu Apr 6 12:13:22 CEST 2023
I found there is no way to achieve it from the prompt line, so I began to
write some code.
But got a flow validate error then: *IPV4 ihl offload not supported*
Looking for some help...
struct rte_flow_attr attr = { .ingress = 1 };
struct rte_flow_item pattern[2];
struct rte_flow_action actions[2];
struct rte_flow_item_ipv4 ipv4;
struct rte_flow *flow;
struct rte_flow_error error;
struct in_addr addr;
inet_aton("11.158.251.10", &addr);
ipv4.hdr.dst_addr = htonl(addr.s_addr);
pattern[0].type = RTE_FLOW_ITEM_TYPE_IPV4;
pattern[0].spec = &ipv4;
pattern[1].type = RTE_FLOW_ITEM_TYPE_END;
actions[0].type = RTE_FLOW_ACTION_TYPE_DROP;
actions[1].type = RTE_FLOW_ACTION_TYPE_END;
int validate = rte_flow_validate(0, &attr, pattern, actions, &error);
printf("validate flow: %d, msg %s\n", validate, error.message);
if (!validate)
flow = rte_flow_create(0, &attr, pattern, actions, &error);
Bob Chen <a175818323 at gmail.com> 于2023年4月6日周四 16:53写道:
> testpmd> flow create 0 ingress pattern ipv4 ... ?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/users/attachments/20230406/5c1d62e5/attachment.htm>
More information about the users
mailing list