From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 595994235E; Wed, 11 Oct 2023 11:33:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35CA141133; Wed, 11 Oct 2023 11:31:54 +0200 (CEST) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 0553040E25 for ; Wed, 11 Oct 2023 11:31:38 +0200 (CEST) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S56sV5Bd7zrTZ2 for ; Wed, 11 Oct 2023 17:29:02 +0800 (CST) Received: from localhost.localdomain (10.67.165.2) by kwepemi500020.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Wed, 11 Oct 2023 17:31:36 +0800 From: Jie Hai To: , Qiming Yang , Qi Zhang CC: , , Subject: [PATCH v5 19/40] net/ice: check RSS hash algorithms Date: Wed, 11 Oct 2023 17:27:44 +0800 Message-ID: <20231011092805.693171-20-haijie1@huawei.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20231011092805.693171-1-haijie1@huawei.com> References: <20230908080030.3837515-1-haijie1@huawei.com> <20231011092805.693171-1-haijie1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.67.165.2] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500020.china.huawei.com (7.221.188.8) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org A new field 'algorithm' has been added to rss_conf, check it in case of ignoring unsupported values. Signed-off-by: Jie Hai --- drivers/net/ice/ice_dcf.c | 3 +++ drivers/net/ice/ice_dcf_ethdev.c | 3 +++ drivers/net/ice/ice_ethdev.c | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c index 7f8f5163acef..bff39cf9d145 100644 --- a/drivers/net/ice/ice_dcf.c +++ b/drivers/net/ice/ice_dcf.c @@ -1120,6 +1120,9 @@ ice_dcf_init_rss(struct ice_dcf_hw *hw) return ice_dcf_configure_rss_lut(hw); } + if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT) + return -EINVAL; + /* In IAVF, RSS enablement is set by PF driver. It is not supported * to set based on rss_conf->rss_hf. */ diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c index 30ad18d8fc20..f0db68c5dee5 100644 --- a/drivers/net/ice/ice_dcf_ethdev.c +++ b/drivers/net/ice/ice_dcf_ethdev.c @@ -1405,6 +1405,9 @@ ice_dcf_dev_rss_hash_update(struct rte_eth_dev *dev, if (!(hw->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF)) return -ENOTSUP; + if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT) + return -EINVAL; + /* HENA setting, it is enabled by default, no change */ if (!rss_conf->rss_key || rss_conf->rss_key_len == 0) { PMD_DRV_LOG(DEBUG, "No key to be configured"); diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 4bad39c2c1c9..0cba6f7d7b6a 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -3383,6 +3383,10 @@ static int ice_init_rss(struct ice_pf *pf) return -ENOMEM; } } + + if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT) + return -EINVAL; + /* configure RSS key */ if (!rss_conf->rss_key) ice_get_default_rss_key(vsi->rss_key, vsi->rss_key_size); @@ -5046,6 +5050,9 @@ ice_rss_hash_update(struct rte_eth_dev *dev, struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct ice_vsi *vsi = pf->main_vsi; + if (rss_conf->algorithm != RTE_ETH_HASH_FUNCTION_DEFAULT) + return -EINVAL; + /* set hash key */ status = ice_set_rss_key(vsi, rss_conf->rss_key, rss_conf->rss_key_len); if (status) -- 2.30.0