From patchwork Thu Nov 12 10:42:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Amber, Kumar" X-Patchwork-Id: 84056 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 05DCEA09D3; Thu, 12 Nov 2020 11:48:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DC44D5AB3; Thu, 12 Nov 2020 11:48:22 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 333225928 for ; Thu, 12 Nov 2020 11:48:20 +0100 (CET) IronPort-SDR: BqNcz17ihg8uYjjlYo6H3iJZrV8FQwxbe7oLBdnTZhMlknWwJZTsnjPZ7YMu6Q148XdSlQVWHu XQyfCkbsSYpA== X-IronPort-AV: E=McAfee;i="6000,8403,9802"; a="254997993" X-IronPort-AV: E=Sophos;i="5.77,471,1596524400"; d="scan'208";a="254997993" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2020 02:48:18 -0800 IronPort-SDR: ex25b5QPf71GIpMBwUq/pF8Iw6jMmdPZnGhyAq1cDi4hd1RtdT+OcDprM2M3J+b9QmILNuzCEM lfUIQAexEuBw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,471,1596524400"; d="scan'208";a="355155944" Received: from unknown (HELO localhost.localdomain) ([10.190.212.185]) by orsmga008.jf.intel.com with ESMTP; 12 Nov 2020 02:48:16 -0800 From: Kumar Amber To: dev@dpdk.org Cc: wei.zhao1@intel.com Date: Thu, 12 Nov 2020 16:12:45 +0530 Message-Id: <20201112104245.91324-1-kumar.amber@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201111101031.52758-1-kumar.amber@intel.com> References: <20201111101031.52758-1-kumar.amber@intel.com> Subject: [dpdk-dev] [PATCH v4] net/i40e: fix argument in RSS action 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" The driver must check for the queue number in the RSS action list and if not should return with a proper error message to user. Bugzilla ID: 573 Fixes: 9486d60b94b5 ("net/i40e: fix flow RSS queue index check") Cc: wei.zhao1@intel.com Signed-off-by: Kumar Amber --- drivers/net/i40e/i40e_flow.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 5bec0c7a84..397ed0ae77 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -4917,6 +4917,18 @@ i40e_flow_parse_rss_action(struct rte_eth_dev *dev, NEXT_ITEM_OF_ACTION(act, actions, index); rss = act->conf; + /** + * Check if Queue number is specified + * in argument else throw an error. + */ + if (!rss->queue || !rss->queue_num) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, + act, + "no valid queues"); + return -rte_errno; + } + /** * RSS only supports forwarding, * check if the first not void action is RSS.