From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A064EC388F9 for ; Wed, 11 Nov 2020 06:45:01 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 16AE320786 for ; Wed, 11 Nov 2020 06:45:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16AE320786 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 00CC32BAB; Wed, 11 Nov 2020 07:44:58 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 88DFA2AB; Wed, 11 Nov 2020 07:44:56 +0100 (CET) IronPort-SDR: vpX48fTUn/p/PP3AZoUJr+ygJe0arGW2JPqPZ3/jrfXHUJ0DA7DeuySSR/q8NtjEDXcgjQINO8 vgRpFQ1aGSOQ== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="169319539" X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="169319539" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 22:44:54 -0800 IronPort-SDR: D2JB0f9/T1TZLbzAWnwSDI7Sb9fwezauxVcL6aFKSLFbH3om7EwIi7aSweiLX6Kbb8Uyj0SlNZ NE9fqsFgQ1Ng== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,468,1596524400"; d="scan'208";a="356503337" Received: from dpdk-xuting-main.sh.intel.com ([10.67.117.84]) by fmsmga004.fm.intel.com with ESMTP; 10 Nov 2020 22:44:53 -0800 From: Ting Xu To: dev@dpdk.org Cc: qi.z.zhang@intel.com, beilei.xing@intel.com, jingjing.wu@intel.com, stable@dpdk.org Date: Wed, 11 Nov 2020 14:42:50 +0800 Message-Id: <20201111064250.13660-1-ting.xu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1] net/iavf: fix RSS queue region size exceeds X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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