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 3E911431A9; Tue, 24 Oct 2023 14:54:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE901406A2; Tue, 24 Oct 2023 14:54:12 +0200 (CEST) Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mails.dpdk.org (Postfix) with ESMTP id 35660402E3 for ; Tue, 24 Oct 2023 14:54:09 +0200 (CEST) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4SFBjH1QNqzMm7L; Tue, 24 Oct 2023 20:49:55 +0800 (CST) Received: from [10.67.121.175] (10.67.121.175) 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; Tue, 24 Oct 2023 20:54:06 +0800 Message-ID: Date: Tue, 24 Oct 2023 20:54:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v5 02/40] ethdev: support setting and querying RSS algorithm To: fengchengwen , Stephen Hemminger CC: , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Ori Kam , , References: <20230908080030.3837515-1-haijie1@huawei.com> <20231011092805.693171-1-haijie1@huawei.com> <20231011092805.693171-3-haijie1@huawei.com> <20231011103936.5ffcdd73@hermes.local> From: Jie Hai In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.121.175] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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 On 2023/10/12 10:21, fengchengwen wrote: > > > On 2023/10/12 1:39, Stephen Hemminger wrote: >> On Wed, 11 Oct 2023 17:27:27 +0800 >> Jie Hai wrote: >> >>> Currently, rte_eth_rss_conf supports configuring and querying >>> RSS hash functions, rss key and it's length, but not RSS hash >>> algorithm. >>> >>> The structure ``rte_eth_rss_conf`` is extended by adding a new >>> field "algorithm". This represents the RSS algorithms to apply. >>> The following API will be affected: >>> - rte_eth_dev_configure >>> - rte_eth_dev_rss_hash_update >>> - rte_eth_dev_rss_hash_conf_get >>> >>> If the value of "algorithm" used for configuration is a gibberish >>> value, report the error and return. Do the same for >>> rte_eth_dev_rss_hash_update and rte_eth_dev_configure. >>> >>> To check whether the drivers report valid "algorithm", it is set >>> to default value before querying. >>> >>> Signed-off-by: Jie Hai >>> Signed-off-by: Dongdong Liu >>> --- >>> doc/guides/rel_notes/release_23_11.rst | 2 ++ >>> lib/ethdev/rte_ethdev.c | 17 ++++++++++++++++ >>> lib/ethdev/rte_ethdev.h | 27 +++++++++++++++++++++++++ >>> lib/ethdev/rte_flow.c | 1 - >>> lib/ethdev/rte_flow.h | 28 ++------------------------ >>> 5 files changed, 48 insertions(+), 27 deletions(-) >>> >>> diff --git a/doc/guides/rel_notes/release_23_11.rst b/doc/guides/rel_notes/release_23_11.rst >>> index e13d57728071..92a445ab2ed3 100644 >>> --- a/doc/guides/rel_notes/release_23_11.rst >>> +++ b/doc/guides/rel_notes/release_23_11.rst >>> @@ -197,6 +197,8 @@ ABI Changes >>> fields, to move ``rxq`` and ``txq`` fields, to change the size of >>> ``reserved1`` and ``reserved2`` fields. >>> >>> +* ethdev: Added "algorithm" field to ``rte_eth_rss_conf`` structure for RSS >>> + hash algorithm. >>> >>> Known Issues >>> ------------ >>> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c >>> index 18a4b950b184..2eda1b8072e5 100644 >>> --- a/lib/ethdev/rte_ethdev.c >>> +++ b/lib/ethdev/rte_ethdev.c >>> @@ -1464,6 +1464,14 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, >>> goto rollback; >>> } >>> >>> + if (dev_conf->rx_adv_conf.rss_conf.algorithm >= RTE_ETH_HASH_FUNCTION_MAX) { >>> + RTE_ETHDEV_LOG(ERR, >>> + "Ethdev port_id=%u invalid RSS algorithm: 0x%"PRIx64"\n", >>> + port_id, dev_conf->rx_adv_conf.rss_conf.algorithm); >>> + ret = -EINVAL; >>> + goto rollback; >>> + } >>> + >> >> Rather than having every driver check the algorithm, why not handle this like >> other features in DPDK (which may mean API/ABI changes). >> >> Add a field rss_algo_capa which is bit field of available RSS functions. >> Then the check for algorithm can be done in generic code. There a couple >> of reserved fields that could be used. > > +1 for add a field > > But there are two ways to config rss: ethdev-ops, ethdev-rteflow-ops, should distinguish them ? or just define for ethdev-ops ? > The rte_flow API does not distinguish RSS rule and FDIR rule, the actual implementation of rss configuration depends on drivers. I think if we had this "rss_algo_capa ", it can be just for ethdev-ops for ethdev API level use. >> >> It would mean updating all the drivers once with the capa field but >> would provide way for application to know what fields are possible. >> >> It has proved to be a problem in later ABI changes if a maximum value >> is exposed. I.e don't expose RTE_ETH_HASH_FUNCTION_MAX. > > +1 > >> >> . >> > .