From patchwork Fri Oct 30 03:16:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simei Su X-Patchwork-Id: 82856 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 E1A12A04DD; Fri, 30 Oct 2020 04:26:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 22666CCA9; Fri, 30 Oct 2020 04:26:27 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 7EDF9CC79 for ; Fri, 30 Oct 2020 04:26:24 +0100 (CET) IronPort-SDR: z1HHtL5XkY4+Aj7nmjfYAy+RDPToMTTvgs6x10+P1ucAJMZ67LLsNXE9Pi6FRuDWVO3/FKHNRX xFcuVJbK5WFQ== X-IronPort-AV: E=McAfee;i="6000,8403,9789"; a="165056497" X-IronPort-AV: E=Sophos;i="5.77,432,1596524400"; d="scan'208";a="165056497" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Oct 2020 20:26:23 -0700 IronPort-SDR: Zv54fHPm09hXCB6xMKf0F1uAFAqE2tE2oSgWMBBc0N3E6qzVr5Go/pyv931wf2afYYMtbe3BZ7 kxvHOITzCtPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,432,1596524400"; d="scan'208";a="526980890" Received: from unknown (HELO npg-dpdk-cvl-simeisu-118d193.sh.intel.com) ([10.67.119.195]) by fmsmga005.fm.intel.com with ESMTP; 29 Oct 2020 20:26:22 -0700 From: Simei Su To: qi.z.zhang@intel.com Cc: dev@dpdk.org, jia.guo@intel.com, junfeng.guo@intel.com, Simei Su Date: Fri, 30 Oct 2020 11:16:38 +0800 Message-Id: <20201030031638.370766-1-simei.su@intel.com> X-Mailer: git-send-email 2.9.5 Subject: [dpdk-dev] [PATCH] net/iavf: fix invalid RSS type 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 RSS rule with symmetric hash function, the RSS type shouldn't carry with SRC/DST_ONLY. This patch adds invalid RSS type check for the case. Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") Signed-off-by: Simei Su --- drivers/net/iavf/iavf_hash.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index be821b6..6d0360a 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -917,6 +917,22 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *match_item, */ rss_type = rte_eth_rss_hf_refine(rss_type); + /** + * Check if SRC/DST_ONLY is set for SYMMETRIC_TOEPLITZ + * hash function. + */ + if (rss->func == + RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) { + if (rss_type & ((VALID_RSS_ATTR & + ~RTE_ETH_RSS_L3_PRE64) | + ~(VALID_RSS_IPV4 | VALID_RSS_IPV6))) + return rte_flow_error_set(error, + ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, + action, + "invalid rss types"); + } + if (iavf_any_invalid_rss_type(rss_type, match_item->input_set_mask)) return rte_flow_error_set(error, ENOTSUP,