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 83FDBA2EFC for ; Tue, 15 Oct 2019 13:09:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 49FEA1EBAA; Tue, 15 Oct 2019 13:09:14 +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 E510A44C7 for ; Tue, 15 Oct 2019 13:09:12 +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 6A7EA700080; Tue, 15 Oct 2019 11:09:11 +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 12:09:03 +0100 To: "Su, Simei" , "Zhang, Qi Z" , "Ye, Xiaolong" , "Yigit, Ferruh" CC: "dev@dpdk.org" 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> <501c0af4-0b1a-8b91-84b6-5da966eb48f3@solarflare.com> <65F28F834D25B54B9EC1999B623071B30C465921@SHSMSX104.ccr.corp.intel.com> From: Andrew Rybchenko Message-ID: Date: Tue, 15 Oct 2019 14:09:01 +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: <65F28F834D25B54B9EC1999B623071B30C465921@SHSMSX104.ccr.corp.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-9.381400-8.000000-10 X-TMASE-MatchedRID: vbSD0OnL8/LmLzc6AOD8DfHkpkyUphL9Ud7Bjfo+5jTVEYfep7SzpuMN Q/xRdQ+dsOgv3K25H2lPaSCGuTUzHH/BjdQS1Tt2DDlsUbcsIPoiyyRgkoGSpBHFkFAjR1tn2Jv 9cAEDvwqeMnFGyNlm5OF2iLf1P29tIeFIFB+CV+wD2WXLXdz+ATqu1ju/UImn33Nl3elSfsrtfr H67fQFiDsXiitJ1OqMBBdMQIHSDatas6sP1BUQLUrM69p7lDSsgcsVZH3dOCRi0lpUl7/AsSpYA mrFxIhimQdl7xwqvMY+CunI2waxsWkvSsmm5LbrqjZ865FPtpra7r6g8x1D7lezEE205dNvhWD4 TtDcfzRXq118+xiWxUSNBXP4uZXcaBevM/eurMcZSUX8zcPGn0H25SKd6AXRmyiLZetSf8nJ4y0 wP1A6AAOkBnb8H8GWp5scLHMFXhPdB/CxWTRRuwihQpoXbuXFP2tO8CHv5xzd0ohL0W7OHd1P3E v/p7D/CdY+6+p/AHkGxXIe2fbCcYdisDWDfiN7iaKdN7HvjhcII8KRtnGPeDci9GfIncRQooBB8 uyeEuspZK3gOa9uGmJwouYrZN4qaw+fkLqdalOeqD9WtJkSIw== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--9.381400-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24978.003 X-MDID: 1571137752-Vz85wOSPOLtM 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/15/19 1:55 PM, Su, Simei wrote: > Hi, Andrew > >> -----Original Message----- >> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com] >> Sent: Tuesday, October 15, 2019 5:08 PM >> To: Su, Simei ; Zhang, Qi Z ; Ye, >> Xiaolong ; Yigit, Ferruh >> Cc: dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH v12 2/3] ethdev: extend RSS offload types >> >> 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. > The history is > [Qi] The consideration is when handle rte_flow_action_rss, we still need to strip it out since this route will bypass the dev_configure or rss_update So there are two options 1, strip out at rte_flow_create , this relief all the PMDs, but code looks a little bit strange. > 2. handled by PMD themselves > Anyway both of the cases need this helper function be exposed by rte_ethdev.h, maybe we can define a macro named RTE_ETH_RSS_HF_REFINE? > > So I try to use a macro to replace the function of strip_out_src_dst_only. Now, there are two options: > (1)define a macro in rte_ethdev.h, just like above patch. > (2)define an inline function "rte_eth_rss_strip_out_src_dst_only" in rte_ethdev.h. > What do you think? Thanks! May be inline function rte_eth_rss_hf_refine()?