* How to write a flow pattern in test-pmd that can identify the TCP port?
@ 2023-04-06 8:53 Bob Chen
2023-04-06 10:13 ` Bob Chen
0 siblings, 1 reply; 2+ messages in thread
From: Bob Chen @ 2023-04-06 8:53 UTC (permalink / raw)
To: users
[-- Attachment #1: Type: text/plain, Size: 50 bytes --]
testpmd> flow create 0 ingress pattern ipv4 ... ?
[-- Attachment #2: Type: text/html, Size: 2128 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: How to write a flow pattern in test-pmd that can identify the TCP port?
2023-04-06 8:53 How to write a flow pattern in test-pmd that can identify the TCP port? Bob Chen
@ 2023-04-06 10:13 ` Bob Chen
0 siblings, 0 replies; 2+ messages in thread
From: Bob Chen @ 2023-04-06 10:13 UTC (permalink / raw)
To: users
[-- Attachment #1: Type: text/plain, Size: 1059 bytes --]
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@gmail.com> 于2023年4月6日周四 16:53写道:
> testpmd> flow create 0 ingress pattern ipv4 ... ?
>
[-- Attachment #2: Type: text/html, Size: 7114 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-06 10:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 8:53 How to write a flow pattern in test-pmd that can identify the TCP port? Bob Chen
2023-04-06 10:13 ` Bob Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).