From: Radu Nicolau <radu.nicolau@intel.com>
To: Kirill Rybalchenko <kirill.rybalchenko@intel.com>, dev@dpdk.org
Cc: andrey.chilikin@intel.com, beilei.xing@intel.com
Subject: Re: [dpdk-dev] [PATCH 2/2] net/i40e: add support for raw flow type for flow director
Date: Mon, 4 Sep 2017 11:38:16 +0100 [thread overview]
Message-ID: <c54ec2af-37be-5559-42c3-9d6cb6b456da@intel.com> (raw)
In-Reply-To: <1503588634-85735-3-git-send-email-kirill.rybalchenko@intel.com>
On 8/24/2017 4:30 PM, Kirill Rybalchenko wrote:
> When addidng flow director filter for raw flow type, instead
> of constructing packet use buffer with pre-constructed packet.
>
> Signed-off-by: Kirill Rybalchenko <kirill.rybalchenko@intel.com>
> ---
> drivers/net/i40e/i40e_fdir.c | 27 +++++++++++++++++++--------
> 1 file changed, 19 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c
> index 8013add..0558914 100644
> --- a/drivers/net/i40e/i40e_fdir.c
> +++ b/drivers/net/i40e/i40e_fdir.c
> @@ -1093,6 +1093,7 @@ i40e_add_del_fdir_filter(struct rte_eth_dev *dev,
> struct i40e_fdir_filter *fdir_filter, *node;
> struct i40e_fdir_filter check_filter; /* Check if the filter exists */
> int ret = 0;
> + uint16_t flow_type = filter->input.flow_type;
>
> if (dev->data->dev_conf.fdir_conf.mode != RTE_FDIR_MODE_PERFECT) {
> PMD_DRV_LOG(ERR, "FDIR is not enabled, please"
> @@ -1100,7 +1101,7 @@ i40e_add_del_fdir_filter(struct rte_eth_dev *dev,
> return -ENOTSUP;
> }
>
> - if (!I40E_VALID_FLOW(filter->input.flow_type)) {
> + if (flow_type != RTE_ETH_FLOW_RAW && !I40E_VALID_FLOW(flow_type)) {
Why not expand I40E_VALID_FLOW to check for RTE_ETH_FLOW_RAW as well?
> PMD_DRV_LOG(ERR, "invalid flow_type input.");
> return -EINVAL;
> }
> @@ -1132,20 +1133,30 @@ i40e_add_del_fdir_filter(struct rte_eth_dev *dev,
>
> memset(pkt, 0, I40E_FDIR_PKT_LEN);
>
> - ret = i40e_fdir_construct_pkt(pf, &filter->input, pkt);
> - if (ret < 0) {
> - PMD_DRV_LOG(ERR, "construct packet for fdir fails.");
> - return ret;
> + if (flow_type == RTE_ETH_FLOW_RAW) {
> + if (filter->input.flow.raw_flow.length > I40E_FDIR_PKT_LEN ||
> + !filter->input.flow.raw_flow.packet ||
> + !I40E_VALID_FLOW(filter->input.flow.raw_flow.flow)) {
> + PMD_DRV_LOG(ERR, "Invalid raw flow filter parameters!");
> + }
> + memcpy(pkt, filter->input.flow.raw_flow.packet,
> + filter->input.flow.raw_flow.length);
> + flow_type = filter->input.flow.raw_flow.flow;
> + } else {
> + ret = i40e_fdir_construct_pkt(pf, &filter->input, pkt);
> + if (ret < 0) {
> + PMD_DRV_LOG(ERR, "construct packet for fdir fails.");
> + return ret;
> + }
> }
>
> if (hw->mac.type == I40E_MAC_X722) {
> /* get translated pctype value in fd pctype register */
> pctype = (enum i40e_filter_pctype)i40e_read_rx_ctl(
> hw, I40E_GLQF_FD_PCTYPES(
> - (int)i40e_flowtype_to_pctype(
> - filter->input.flow_type)));
> + (int)i40e_flowtype_to_pctype(flow_type)));
> } else
> - pctype = i40e_flowtype_to_pctype(filter->input.flow_type);
> + pctype = i40e_flowtype_to_pctype(flow_type);
>
> ret = i40e_fdir_filter_programming(pf, pctype, filter, add);
> if (ret < 0) {
next prev parent reply other threads:[~2017-09-04 10:38 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 15:30 [dpdk-dev] [PATCH 0/2] ethdev: " Kirill Rybalchenko
2017-08-24 15:30 ` [dpdk-dev] [PATCH 1/2] " Kirill Rybalchenko
2017-09-04 10:35 ` Radu Nicolau
2017-08-24 15:30 ` [dpdk-dev] [PATCH 2/2] net/i40e: " Kirill Rybalchenko
2017-09-04 10:38 ` Radu Nicolau [this message]
2017-09-20 8:42 ` [dpdk-dev] [PATCH v2 0/2] ethdev: " Kirill Rybalchenko
2017-09-20 8:42 ` [dpdk-dev] [PATCH v2 1/2] " Kirill Rybalchenko
2017-09-20 8:42 ` [dpdk-dev] [PATCH v2 2/2] net/i40e: " Kirill Rybalchenko
2017-10-03 19:02 ` [dpdk-dev] [PATCH v2 0/2] ethdev: " Ferruh Yigit
2017-10-04 16:57 ` Thomas Monjalon
2017-10-04 17:44 ` Ferruh Yigit
2017-10-04 17:56 ` Thomas Monjalon
2017-10-04 19:47 ` Ferruh Yigit
2017-10-04 22:42 ` Thomas Monjalon
2017-10-05 9:09 ` Rybalchenko, Kirill
2017-10-05 20:52 ` [dpdk-dev] [PATCH v3 0/4] " Kirill Rybalchenko
2017-10-05 20:52 ` [dpdk-dev] [PATCH v3 1/4] " Kirill Rybalchenko
2017-10-05 20:52 ` [dpdk-dev] [PATCH v3 2/4] net/i40e: " Kirill Rybalchenko
2017-10-05 20:52 ` [dpdk-dev] [PATCH v3 3/4] app/testpmd: add raw flow type to " Kirill Rybalchenko
2017-10-05 20:52 ` [dpdk-dev] [PATCH v3 4/4] doc: add description of raw flow type in flow director in testpmd Kirill Rybalchenko
2017-10-10 20:13 ` [dpdk-dev] [PATCH v4 0/4] add support for raw flow type for flow director Kirill Rybalchenko
2017-10-10 20:13 ` [dpdk-dev] [PATCH v4 1/4] ethdev: " Kirill Rybalchenko
2017-10-10 20:13 ` [dpdk-dev] [PATCH v4 2/4] net/i40e: " Kirill Rybalchenko
2017-10-10 20:13 ` [dpdk-dev] [PATCH v4 3/4] app/testpmd: add raw flow type to " Kirill Rybalchenko
2017-10-10 20:13 ` [dpdk-dev] [PATCH v4 4/4] doc: add description of raw mode in flow director in testpmd Kirill Rybalchenko
2017-10-10 20:28 ` [dpdk-dev] [PATCH v5 0/4] add support for raw flow type for flow director Kirill Rybalchenko
2017-10-10 20:28 ` [dpdk-dev] [PATCH v5 1/4] ethdev: " Kirill Rybalchenko
2017-10-11 22:26 ` Thomas Monjalon
2017-10-12 11:41 ` Rybalchenko, Kirill
2017-10-12 12:01 ` Thomas Monjalon
2017-10-12 16:14 ` Adrien Mazarguil
2017-10-10 20:28 ` [dpdk-dev] [PATCH v5 2/4] net/i40e: " Kirill Rybalchenko
2017-10-10 20:28 ` [dpdk-dev] [PATCH v5 3/4] app/testpmd: add raw flow type to " Kirill Rybalchenko
2017-10-13 3:27 ` Wu, Jingjing
2017-10-10 20:28 ` [dpdk-dev] [PATCH v5 4/4] doc: add description of raw mode in flow director in testpmd Kirill Rybalchenko
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=c54ec2af-37be-5559-42c3-9d6cb6b456da@intel.com \
--to=radu.nicolau@intel.com \
--cc=andrey.chilikin@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=kirill.rybalchenko@intel.com \
/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).