From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id AD7041B7E2; Wed, 4 Apr 2018 05:37:16 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Apr 2018 20:37:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,404,1517904000"; d="scan'208";a="217350744" Received: from dpdk6.bj.intel.com ([172.16.182.119]) by fmsmga006.fm.intel.com with ESMTP; 03 Apr 2018 20:37:14 -0700 From: Wei Zhao To: dev@dpdk.org, stable@dpdk.org Cc: qi.z.zhang@intel.com, Wei Zhao Date: Wed, 4 Apr 2018 11:18:47 +0800 Message-Id: <1522811927-46772-1-git-send-email-wei.zhao1@intel.com> X-Mailer: git-send-email 2.7.5 Subject: [dpdk-dev] [PATCH] 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 03:37:17 -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 --- drivers/net/i40e/i40e_flow.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index f3e8c5f..4e86ecb 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -4249,6 +4249,20 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, return -rte_errno; } + 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 (i = 0; i < info->queue_region_number; i++) { if (info->region[i].queue_num == rss->num && info->region[i].queue_start_index == -- 2.7.5