From: benli ye <danielbenliye@gmail.com>
To: dev@dpdk.org
Subject: [dpdk-dev] mlx5 FDIR rule comparison issue
Date: Tue, 2 Apr 2019 15:23:22 +0800 [thread overview]
Message-ID: <2D0CB568-B970-408A-9463-5D05D201370A@gmail.com> (raw)
Message-ID: <20190402072322.Iswwe__tYYpmozD_boVbMStVeRrBKy5iae0OqecAMdA@z> (raw)
Hi Developers,
I am adding two FDIR rule (one is for UDP and the other is for TCP) for mlx5 pmd driver. The rules are listed below.
struct rte_eth_fdir_filter filt[MAX_FDIR_PROTO] = {
{
.input.flow_type = RTE_ETH_FLOW_NONFRAG_IPV4_TCP,
.input.flow.tcp4_flow.ip.dst_ip = dip,
.input.flow.tcp4_flow.dst_port = dport,
.action.behavior = RTE_ETH_FDIR_ACCEPT,
.action.report_status = RTE_ETH_FDIR_REPORT_ID,
.soft_id = 0,
},
{
.input.flow_type = RTE_ETH_FLOW_NONFRAG_IPV4_UDP,
.input.flow.udp4_flow.ip.dst_ip = dip,
.input.flow.udp4_flow.dst_port = dport,
.action.behavior = RTE_ETH_FDIR_ACCEPT,
.action.report_status = RTE_ETH_FDIR_REPORT_ID,
.soft_id = 1,
},
};
However, mlx5 lib prevent me to doing this as when it treats the two rules are the same.
I debugged for a while and found flow_fdir_cmp() didn’t compare the protocol type in field items of struct mlx5_fdir. So should this be a bug for mlx5?
flow_fdir_cmp(const struct mlx5_fdir *f1, const struct mlx5_fdir *f2)
{
if (FLOW_FDIR_CMP(f1, f2, attr) ||
FLOW_FDIR_CMP(f1, f2, l2) ||
FLOW_FDIR_CMP(f1, f2, l2_mask) ||
FLOW_FDIR_CMP(f1, f2, l3) ||
FLOW_FDIR_CMP(f1, f2, l3_mask) ||
FLOW_FDIR_CMP(f1, f2, l4) ||
FLOW_FDIR_CMP(f1, f2, l4_mask) ||
FLOW_FDIR_CMP(f1, f2, actions[0].type))
return 1;
if (f1->actions[0].type == RTE_FLOW_ACTION_TYPE_QUEUE &&
FLOW_FDIR_CMP(f1, f2, queue))
return 1;
return 0;
}
Thanks,
Daniel
next reply other threads:[~2019-04-02 7:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-02 7:23 benli ye [this message]
2019-04-02 7:23 ` benli ye
2019-04-03 8:29 ` benli ye
2019-04-03 8:29 ` benli ye
2019-04-04 11:18 ` Dekel Peled
2019-04-04 11:18 ` Dekel Peled
2019-04-04 12:12 ` benli ye
2019-04-04 12:12 ` benli ye
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=2D0CB568-B970-408A-9463-5D05D201370A@gmail.com \
--to=danielbenliye@gmail.com \
--cc=dev@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).