From: Bob Chen <a175818323@gmail.com>
To: users@dpdk.org
Subject: Re: How to write a flow pattern in test-pmd that can identify the TCP port?
Date: Thu, 6 Apr 2023 18:13:22 +0800 [thread overview]
Message-ID: <CAMxP3BRSNY+gkJZHgq3HELvzYeF2ePE7RscRfGEx2r+itLM03g@mail.gmail.com> (raw)
In-Reply-To: <CAMxP3BTny_tX897Dh-nadO5h96SSh4DtG6ge15QT5iqQx9bOkw@mail.gmail.com>
[-- 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 --]
prev parent reply other threads:[~2023-04-06 10:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-06 8:53 Bob Chen
2023-04-06 10:13 ` Bob Chen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMxP3BRSNY+gkJZHgq3HELvzYeF2ePE7RscRfGEx2r+itLM03g@mail.gmail.com \
--to=a175818323@gmail.com \
--cc=users@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).