From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 1B55D1BB82; Wed, 4 Apr 2018 07:24:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 22:24:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,404,1517904000"; d="scan'208";a="43237218" Received: from dpdk6.bj.intel.com ([172.16.182.119]) by fmsmga004.fm.intel.com with ESMTP; 03 Apr 2018 22:24:54 -0700 From: Wei Zhao To: dev@dpdk.org, stable@dpdk.org Cc: qi.z.zhang@intel.com, Wei Zhao Date: Wed, 4 Apr 2018 13:06:27 +0800 Message-Id: <1522818387-63961-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1522818034-62915-1-git-send-email-wei.zhao1@intel.com> References: <1522818034-62915-1-git-send-email-wei.zhao1@intel.com> Subject: [dpdk-dev] [PATCH v3] net/i40e: add flow RSS queue index check 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: , X-List-Received-Date: Wed, 04 Apr 2018 05:24:59 -0000 There need a queue index check for RSS queue region in order to aviod error from configuration. Fixes: ecad87d22383 ("net/i40e: move RSS to flow API") Signed-off-by: Wei Zhao Tested-by: Peng Yuan --- Changes in v2: move check code out from the big loop. change in v3: delete unnecessary dash in comment. --- drivers/net/i40e/i40e_flow.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index f3e8c5f..3b54be0 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -4216,6 +4216,22 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, } } + if (conf_info->queue_region_number) { + for (i = 0; i < rss->num; i++) { + for (j = 0; j < rss_info->num; j++) { + if (rss->queue[i] == rss_info->queue[j]) + break; + } + if (j == rss_info->num) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "no valid queues"); + return -rte_errno; + } + } + } + for (n = 0; n < conf_info->queue_region_number; n++) { if (conf_info->region[n].user_priority_num || conf_info->region[n].flowtype_num) { -- 2.7.5