From: "Joshi, Venkatesh" <venkatesh.joshi@hpe.com>
To: "users@dpdk.org" <users@dpdk.org>
Subject: [dpdk-users] DPDK-20.08/i40e driver/XXV710 NIC: Error while adding a flexible payload rule
Date: Sun, 23 May 2021 11:37:18 +0000 [thread overview]
Message-ID: <TU4PR8401MB0479B45B493F9CEB742ED098EC279@TU4PR8401MB0479.NAMPRD84.PROD.OUTLOOK.COM> (raw)
Hi,
I am running DPDK 20.08 version. The NIC is XXV710 with i40e driver.
I'm trying to program a flexible payload rule but it is returning an error message as follows:
---
Error in creation of UDPv4 Rule for XYZ port. Error type: 13
Message: Conflict with the first flexible rule.
EAL: Error - exiting with code: 1
---
Is this a known issue with the i40e driver?
I am able to create rules that match the port attributes in the L4 header.
However, I need to do the following:
Assume a packet with the following format:
L2 Hdr + L3 Hdr + L4 Hder + (payload)
- match for certain pattern in bytes 16 to 19 of the payload.
- I'm trying to use flexible payload to match the bytes 16 to 19 of the payload.
The code is as follows:
----
struct rte_flow_attr attr;
struct rte_flow_item pattern[MAX_PATTERN_NUM]; //5
struct rte_flow_action action[MAX_ACTION_NUM];
struct rte_flow *flow = NULL;
struct rte_flow_error error;
struct rte_flow_action_queue queue;
struct rte_flow_item eth_item = { RTE_FLOW_ITEM_TYPE_ETH, 0, 0, 0 };
struct rte_flow_item ipv4_item = { RTE_FLOW_ITEM_TYPE_IPV4, 0, 0, 0 };
struct rte_flow_item ipv6_item = { RTE_FLOW_ITEM_TYPE_IPV6, 0, 0, 0 };
struct rte_flow_item end_item = { RTE_FLOW_ITEM_TYPE_END, 0, 0, 0 };
struct rte_flow_item_udp udp_spec;
struct rte_flow_item_udp udp_mask;
struct rte_flow_item_raw raw_spec;
struct rte_flow_item_raw raw_mask;
uint8_t raw_pat_data[] = { 0x21, 0x32, 0x21, 0x32 };
uint8_t raw_pat_mask[] = { 0xff, 0xff, 0xff, 0xff };
uint16_t udp_rx_q = 4;
uint8_t nr;
int res;
memset(pattern, 0, sizeof(pattern));
memset(action, 0, sizeof(action));
/*
* set the rule attribute.
* in this case only ingress packets will be checked.
*/
memset(&attr, 0, sizeof(struct rte_flow_attr));
attr.ingress = 1;
/*
* create the action sequence.
* one action only, move packet to queue
*/
queue.index = udp_rx_q;
action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;
action[0].conf = &queue;
action[1].type = RTE_FLOW_ACTION_TYPE_END;
/*
* L2: set the first level of the pattern
*/
pattern[0] = eth_item;
/*
* L3: set the second level here - IPV4
*/
pattern[1] = ipv4_item;
/*
* L4: set the third level of the pattern - UDP
*/
memset(&udp_spec, 0, sizeof(struct rte_flow_item_udp));
memset(&udp_mask, 0, sizeof(struct rte_flow_item_udp));
udp_spec.hdr.dst_port = FRAME_UDP_PORT_XYZ;
udp_mask.hdr.dst_port = L4_PORT_MASK;
udp_spec.hdr.src_port = FRAME_UDP_PORT_XYZ;
udp_mask.hdr.src_port = L4_PORT_MASK;
pattern[2].type = RTE_FLOW_ITEM_TYPE_UDP;
pattern[2].spec = &udp_spec;
pattern[2].mask = &udp_mask;
/* L5: raw: set the pattern */
memset(&raw_spec, 0, sizeof(struct rte_flow_item_raw));
memset(&raw_mask, 0, sizeof(struct rte_flow_item_raw));
raw_spec.relative = 1;
raw_spec.offset = 16;
raw_spec.length = sizeof(raw_pat_data);
raw_spec.pattern = raw_pat_data;
raw_mask.offset = -1;
raw_mask.length = -1;
raw_mask.pattern = raw_pat_mask;
pattern[3].type = RTE_FLOW_ITEM_TYPE_RAW;
pattern[3].spec = &raw_spec;
pattern[3].mask = &raw_mask;
/* the final level must be always type end */
pattern[4] = end_item;
flow = rte_flow_create(port_id, &attr, pattern, action, &error);
if (!flow) {
snprintf(errmsgbuf, sizeof(errmsgbuf), "Error in creation of UDPv4 Rule for XYZ port");
sos_dpdk_fdir_flow_complain(errmsgbuf, &error);
rte_exit(EXIT_FAILURE, "Error in creating flow");
}
----------
Any pointers will be most appreciated.
Regards,
Venkatesh
reply other threads:[~2021-05-23 11:37 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=TU4PR8401MB0479B45B493F9CEB742ED098EC279@TU4PR8401MB0479.NAMPRD84.PROD.OUTLOOK.COM \
--to=venkatesh.joshi@hpe.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).