From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F537A2F6B for ; Wed, 9 Oct 2019 09:18:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 100731C115; Wed, 9 Oct 2019 09:18:41 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id A293E1C0C0 for ; Wed, 9 Oct 2019 09:18:39 +0200 (CEST) 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-us2.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id D97931C008D; Wed, 9 Oct 2019 07:18:37 +0000 (UTC) Received: from [192.168.38.17] (91.220.146.112) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 9 Oct 2019 08:18:31 +0100 To: Simei Su , , , CC: References: <1570164362-64775-1-git-send-email-simei.su@intel.com> <1570604240-97643-1-git-send-email-simei.su@intel.com> <1570604240-97643-3-git-send-email-simei.su@intel.com> From: Andrew Rybchenko Message-ID: <9a54b5b8-8364-36e6-ff9a-6e4b6cd3aeda@solarflare.com> Date: Wed, 9 Oct 2019 10:18:27 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <1570604240-97643-3-git-send-email-simei.su@intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-Originating-IP: [91.220.146.112] 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-24964.003 X-TM-AS-Result: No-6.765000-8.000000-10 X-TMASE-MatchedRID: 1GZI+iG+MtfmLzc6AOD8DfHkpkyUphL9APiR4btCEeaXbcZfsC7t1C1E Xi73WJBa/xTu/qITlN028sDkxWLWkh6/+Ev3guYHLbjXqdzdtCU/pOSL72dTfwdkFovAReUoR47 F23WRhl5h/7vLrkOO2fimYUTgbSLu0+3uhi65wfHbbgI4AuYpV36NJZ3HRhRTNukyDIB+HbrNG3 pe4fFpifgZrwoNuiyM4HC/EJcrgrzehfA42bn528zSKGx9g8xh/qWl+m17jWGnk8VVpU1FNtIkl xunVj5bmQdl7xwqvMbU4zZiFbt+n/qrD6IiMUvNvHKClHGjjr2HgDwpGasZ7clk/SMg0CpQo8WM kQWv6iUD0yuKrQIMCAGLeSok4rrZC24oEZ6SpSmb4wHqRpnaDnmGMgth8Vn3Ncwd+v5eCaY0l5l dtheTvRS0is7xk8XiRTKDRz3CD+De+Iw11qqrcjVMo5UGKvDwSAAzcZc8Z+KPOM0hBjoplofMZM egLDIeGU0pKnas+RbnCJftFZkZizYJYNFU00e7N+XOQZygrvY= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--6.765000-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24964.003 X-MDID: 1570605518-bcU2_-8t_m8r Subject: Re: [dpdk-dev] [PATCH v11 2/3] ethdev: extend RSS offload types 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 10/9/19 9:57 AM, Simei Su wrote: > This patch reserves several bits as input set selection from the > high end of the 64 bits. It is combined with exisiting ETH_RSS_* > to represent RSS types. > > Signed-off-by: Simei Su > Reviewed-by: Qi Zhang > Acked-by: Ori Kam > --- > lib/librte_ethdev/rte_ethdev.c | 5 +++++ > lib/librte_ethdev/rte_ethdev.h | 35 +++++++++++++++++++++++++++++++++++ > 2 files changed, 40 insertions(+) > > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c > index af82360..69f4133 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c > @@ -1269,6 +1269,9 @@ struct rte_eth_dev * > goto rollback; > } > > + dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf = > + strip_out_src_dst_only(dev_conf->rx_adv_conf.rss_conf.rss_hf); > + > /* Check that device supports requested rss hash functions. */ > if ((dev_info.flow_type_rss_offloads | > dev_conf->rx_adv_conf.rss_conf.rss_hf) != > @@ -3112,6 +3115,8 @@ struct rte_eth_dev * > if (ret != 0) > return ret; > > + rss_conf->rss_hf = strip_out_src_dst_only(rss_conf->rss_hf); > + > dev = &rte_eth_devices[port_id]; > if ((dev_info.flow_type_rss_offloads | rss_conf->rss_hf) != > dev_info.flow_type_rss_offloads) { > diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h > index 7722f70..ef59ed5 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -505,6 +505,20 @@ struct rte_eth_rss_conf { > #define ETH_RSS_GENEVE (1ULL << 20) > #define ETH_RSS_NVGRE (1ULL << 21) > > +/* > + * We use the following macros to combine with above ETH_RSS_* for > + * more specific input set selection. These bits are defined starting > + * from the high end of the 64 bits. > + * Note: If we use above ETH_RSS_* without SRC/DST_ONLY, it represents > + * both SRC and DST are taken into account. If SRC_ONLY and DST_ONLY of > + * the same level are used simultaneously, it is the same case as none of > + * them are added. > + */ > +#define ETH_RSS_L3_SRC_ONLY (1ULL << 63) > +#define ETH_RSS_L3_DST_ONLY (1ULL << 62) > +#define ETH_RSS_L4_SRC_ONLY (1ULL << 61) > +#define ETH_RSS_L4_DST_ONLY (1ULL << 60) > + > #define ETH_RSS_IP ( \ > ETH_RSS_IPV4 | \ > ETH_RSS_FRAG_IPV4 | \ > @@ -4034,6 +4048,27 @@ int rte_eth_dev_adjust_nb_rx_tx_desc(uint16_t port_id, > void * > rte_eth_dev_get_sec_ctx(uint16_t port_id); > > +/** > + * If SRC_ONLY and DST_ONLY of the same level are used > + * simultaneously, it is the same case as none of them > + * are added. > + * > + * @param rss_hf > + * RSS types with SRC/DST_ONLY. > + * @return > + * RSS types. > + */ > +static inline uint64_t > +strip_out_src_dst_only(uint64_t rss_hf) Inline function in public header without corresponding prefix is a bad idea. Please, move it to C file and I think that inline should be removed. Let the compiler do its job. > +{ > + if ((rss_hf & ETH_RSS_L3_SRC_ONLY) && (rss_hf & ETH_RSS_L3_DST_ONLY)) > + rss_hf &= ~(ETH_RSS_L3_SRC_ONLY | ETH_RSS_L3_DST_ONLY); > + > + if ((rss_hf & ETH_RSS_L4_SRC_ONLY) && (rss_hf & ETH_RSS_L4_DST_ONLY)) > + rss_hf &= ~(ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY); > + > + return rss_hf; > +} > > #include >