patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ting Xu <ting.xu@intel.com>
To: dev@dpdk.org
Cc: qi.z.zhang@intel.com, beilei.xing@intel.com,
	jingjing.wu@intel.com, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v1] net/iavf: fix RSS queue region size exceeds
Date: Wed, 11 Nov 2020 14:42:50 +0800	[thread overview]
Message-ID: <20201111064250.13660-1-ting.xu@intel.com> (raw)

When a rule is set to do RSS to redirect flows to a group of queues, the
queue region size should not be larger than the max RSS queue region
supported by HW. This patch added the step to check the queue region
size, and report failure if the size does not meet the requirement.

Fixes: e436cd43835b ("net/iavf: negotiate large VF and request more queues")
Cc: stable@dpdk.org

Signed-off-by: Ting Xu <ting.xu@intel.com>
---
 drivers/net/iavf/iavf_fdir.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/iavf/iavf_fdir.c b/drivers/net/iavf/iavf_fdir.c
index f584e5624c..d683a468c1 100644
--- a/drivers/net/iavf/iavf_fdir.c
+++ b/drivers/net/iavf/iavf_fdir.c
@@ -256,6 +256,7 @@ iavf_fdir_parse_action_qregion(struct iavf_adapter *ad,
 			const struct rte_flow_action *act,
 			struct virtchnl_filter_action *filter_action)
 {
+	struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(ad);
 	const struct rte_flow_action_rss *rss = act->conf;
 	uint32_t i;
 
@@ -300,6 +301,13 @@ iavf_fdir_parse_action_qregion(struct iavf_adapter *ad,
 		return -rte_errno;
 	}
 
+	if (rss->queue_num > vf->max_rss_qregion) {
+		rte_flow_error_set(error, EINVAL,
+				RTE_FLOW_ERROR_TYPE_ACTION, act,
+				"The region size cannot be large than the supported max RSS queue region");
+		return -rte_errno;
+	}
+
 	filter_action->act_conf.queue.index = rss->queue[0];
 	filter_action->act_conf.queue.region = rte_fls_u32(rss->queue_num) - 1;
 
-- 
2.17.1


             reply	other threads:[~2020-11-11  6:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11  6:42 Ting Xu [this message]
2020-11-11  8:48 ` Zhang, Qi Z

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=20201111064250.13660-1-ting.xu@intel.com \
    --to=ting.xu@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stable@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).