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 AC7F3A2EFC for ; Tue, 15 Oct 2019 11:07:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 852FC1BFB7; Tue, 15 Oct 2019 11:07:52 +0200 (CEST) Received: from dispatchb-us1.ppe-hosted.com (dispatchb-us1.ppe-hosted.com [148.163.129.53]) by dpdk.org (Postfix) with ESMTP id 3D1101BF8D for ; Tue, 15 Oct 2019 11:07:51 +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-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id D3480940064; Tue, 15 Oct 2019 09:07:49 +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; Tue, 15 Oct 2019 10:07:43 +0100 To: Simei Su , , , CC: References: <1570604240-97643-1-git-send-email-simei.su@intel.com> <1571060169-311974-1-git-send-email-simei.su@intel.com> <1571060169-311974-3-git-send-email-simei.su@intel.com> From: Andrew Rybchenko Message-ID: <501c0af4-0b1a-8b91-84b6-5da966eb48f3@solarflare.com> Date: Tue, 15 Oct 2019 12:07:39 +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: <1571060169-311974-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-24978.003 X-TM-AS-Result: No-6.623400-8.000000-10 X-TMASE-MatchedRID: QfHZjzml1E/mLzc6AOD8DfHkpkyUphL9APiR4btCEeaXbcZfsC7t1C1E Xi73WJBa/xTu/qITlN028sDkxWLWknD1AgDzNq7tPaBTJyy84wVp4xorO9dSmQaYevV4zG3ZQBz oPKhLashO9UxJ8vboSYMbgi+POklc19DsBT1i13i0pHkVd9vKzFjWwaUPviNZV8ukjx868O5FAP lc4VGMQssDZ/QWaNswWaHkVO9e7sPHt8FegNoXIfzTlJK+gA833V4UShoTXadFvs6gBBu7rKPFj JEFr+olA9Mriq0CDAgBi3kqJOK62QtuKBGekqUpm+MB6kaZ2g7d9Mt/oW87gRStuZ2b/NnfBE44 8W+GDJ5i/hZ/IpoGWuwAGwKKGU0YA4fWkgBn6Bwae2LRUEHqwCifoEnJhPA+PotLI4gRRFOHzGT HoCwyHhlNKSp2rPkW5wiX7RWZGYs2CWDRVNNHuzflzkGcoK72 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--6.623400-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24978.003 X-MDID: 1571130470-hm7oEXXMRsQk Subject: Re: [dpdk-dev] [PATCH v12 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/14/19 4:36 PM, 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. This patch also checks the simultaneous > use of SRC_ONLY and DST_ONLY of the same level. > > 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 | 25 +++++++++++++++++++++++++ > 2 files changed, 30 insertions(+) > > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c > index 7caaa0b..69a3d71 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; > } > > + RTE_ETH_RSS_HF_REFINE(dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf, > + 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; > > + RTE_ETH_RSS_HF_REFINE(rss_conf->rss_hf, 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 40aa6a3..389a3e6 100644 > --- a/lib/librte_ethdev/rte_ethdev.h > +++ b/lib/librte_ethdev/rte_ethdev.h > @@ -165,6 +165,17 @@ > #define RTE_ETHDEV_LOG(level, ...) \ > rte_log(RTE_LOG_ ## level, rte_eth_dev_logtype, "" __VA_ARGS__) > > +#define RTE_ETH_RSS_HF_REFINE(output, input) do { \ > + if ((input & ETH_RSS_L3_SRC_ONLY) && \ > + (input & ETH_RSS_L3_DST_ONLY)) \ > + output = input & (~(ETH_RSS_L3_SRC_ONLY | \ > + ETH_RSS_L3_DST_ONLY)); \ > + if ((input & ETH_RSS_L4_SRC_ONLY) && \ > + (input & ETH_RSS_L4_DST_ONLY)) \ > + output = input & (~(ETH_RSS_L4_SRC_ONLY | \ > + ETH_RSS_L4_DST_ONLY)); \ > +} while (0) > + > struct rte_mbuf; > > /** Sorry, I missed why macro is used. Inline function is better and easier to read since macros which modify one of its parameters are very error-prone.