From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6084BC43603 for ; Sat, 7 Dec 2019 09:14:17 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id DE1F920867 for ; Sat, 7 Dec 2019 09:14:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE1F920867 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=solarflare.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B65F51DBC; Sat, 7 Dec 2019 10:14:15 +0100 (CET) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 224DC23D for ; Sat, 7 Dec 2019 10:14:15 +0100 (CET) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us3.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 19F8F480059; Sat, 7 Dec 2019 09:14:12 +0000 (UTC) Received: from [127.0.0.27] (10.17.10.39) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sat, 7 Dec 2019 09:14:05 +0000 To: Ajit Khaparde , CC: , Thomas Monjalon References: <20191207005919.10962-1-ajit.khaparde@broadcom.com> <20191207005919.10962-2-ajit.khaparde@broadcom.com> From: Andrew Rybchenko Message-ID: <096af21e-a1c7-e19a-04f0-b5bb35e0e4aa@solarflare.com> Date: Sat, 7 Dec 2019 12:13:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191207005919.10962-2-ajit.khaparde@broadcom.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.17.10.39] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-25088.003 X-TM-AS-Result: No-15.294500-8.000000-10 X-TMASE-MatchedRID: gzVbiXtWD9vmLzc6AOD8DfHkpkyUphL9APiR4btCEeYMrRrnLCZEmmwV Fq9KyZGWIvzOLKTKFCsRUoxyXzEWjopAMGiqcHEMjoyKzEmtrEcbQ57RP6lOUQdkFovAReUoIb5 NpqK++5rlrBUldX2ZMYTVJ5jVD1jg7+7cnzpubjq+hCRkqj3j03VNoFzxmabnvGAx/1ATZ5sjOc JUkRAzP+5+G+0RV31HpHl2mQBq8PocBxRL3Awc76oNIG7S1SGvMsovp/h9OdFn24xohQO05Werh SEOWO6efne2DYPvhmUPwNHPMArzOWi8YU2giSiPogGd8wIUGIL4h+uI7dxXxMAkyHiYDAQbZy5j iLHg+goC0XjqFXrPuQjAEA9CGIGZ1OGXhAFLw8syIyttzvQ9954oEP/S42Q2R2YNIFh+clGFJHg Z3WHJMdUrfTvbThLWYmmwWRLzqpLRf7QIWE0s15yebS/i2xjjccy0Gdkm5+SbKItl61J/ycnjLT A/UDoAoTCA5Efyn8C5G5ZK4Ai7+N0H8LFZNFG7bkV4e2xSge7I2JDGsu0Of9fU7dzocPqwNHwWI OVwT2yDg8elU0igG77rweoAIK8o X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--15.294500-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-25088.003 X-MDID: 1575710054-fEfhA_oUvVar Subject: Re: [dpdk-dev] [PATCH 1/3] ethdev: add RSS hash level 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" On 12/7/19 3:59 AM, Ajit Khaparde wrote: > This patch adds ability to configure RSS hash level in hardware. > This feature will allow an application to select RSS hash calculation > on outer or inner headers for tunneled packets. > > Signed-off-by: Ajit Khaparde > --- > lib/librte_ethdev/rte_ethdev.h | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h > index 18a9defc2..5189bdbab 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -444,11 +444,35 @@ struct rte_vlan_filter_conf { > * The *rss_hf* field of the *rss_conf* structure indicates the different > * types of IPv4/IPv6 packets to which the RSS hashing must be applied. > * Supplying an *rss_hf* equal to zero disables the RSS feature. > + * > + * The *rss_level* field of the *rss_conf* structure indicates the > + * Packet encapsulation level RSS hash @p types apply to. > + * > + * - @p 0 requests the default behavior. Depending on the packet > + * type, it can mean outermost, innermost, anything in between or > + * even no RSS. > + * > + * It basically stands for the innermost encapsulation level RSS > + * can be performed on according to PMD and device capabilities. > + * > + * - @p 1 requests RSS to be performed on the outermost packet > + * encapsulation level. > + * > + * - @p 2 and subsequent values request RSS to be performed on the > + * specified inner packet encapsulation level, from outermost to > + * innermost (lower to higher values). > + * > + * Support for values other than @p 0 is dependent on the underlying > + * hardware in use. > + * > + * Requesting a specific RSS level on unrecognized traffic results > + * in undefined behavior. > */ > struct rte_eth_rss_conf { > uint8_t *rss_key; /**< If not NULL, 40-byte hash key. */ > uint8_t rss_key_len; /**< hash key length in bytes. */ > uint64_t rss_hf; /**< Hash functions to apply - see below. */ > + uint32_t rss_level; /**< RSS hash level */ > }; I'm not sure that offload flag is required in this case. I think maximum supported rss_level in dev_info will provide more information and per-queue level does not make sense in this case. Even if per-queue group control is required, it should be doable via rte_flow API RSS action. Anyway, it looks like it is ABI breakage with all consequences. In 64-bit case it is possible to put it before rss_hf to avoid ABI breakage, but it will break ABI on 32-bit anyway. > /* > @@ -599,6 +623,8 @@ rte_eth_rss_hf_refine(uint64_t rss_hf) > ETH_RSS_GENEVE | \ > ETH_RSS_NVGRE) > > +#define ETH_RSS_LEVEL_DEFAULT 0 > + > /* > * Definitions used for redirection table entry size. > * Some RSS RETA sizes may not be supported by some drivers, check the > @@ -1103,6 +1129,7 @@ struct rte_eth_conf { > #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000 > #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000 > #define DEV_RX_OFFLOAD_RSS_HASH 0x00080000 > +#define DEV_RX_OFFLOAD_RSS_LEVEL 0x00100000 > > #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ > DEV_RX_OFFLOAD_UDP_CKSUM | \ >