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 EB986A0A0C; Thu, 1 Jul 2021 02:24:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8096B40141; Thu, 1 Jul 2021 02:24:03 +0200 (CEST) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by mails.dpdk.org (Postfix) with ESMTP id 4B2C940040 for ; Thu, 1 Jul 2021 02:24:01 +0200 (CEST) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GFf4g4QVPz76Pc; Thu, 1 Jul 2021 08:20:35 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 1 Jul 2021 08:23:57 +0800 To: Slava Ovsiienko , Ferruh Yigit , "dev@dpdk.org" , NBU-Contact-Thomas Monjalon , Andrew Rybchenko CC: Beilei Xing , Matan Azrad , Shahaf Shuler References: <6ac31917-8ae6-b61f-c0c1-07d907066752@huawei.com> <50258962-ee1b-e045-aba2-9ef7912a304e@intel.com> <5b0f7327-a089-edd1-163b-7b57cd90b575@huawei.com> From: "Min Hu (Connor)" Message-ID: <2b603c31-49d7-12aa-5546-53e9a798df61@huawei.com> Date: Thu, 1 Jul 2021 08:23:57 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] Question about 'rxm->hash.rss' and 'mb->hash.fdir' 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 Sender: "dev" Hi, Slava 在 2021/6/30 19:44, Slava Ovsiienko 写道: > Hi, > >> -----Original Message----- >> From: Min Hu (Connor) >> Sent: Wednesday, June 30, 2021 14:22 >> To: Ferruh Yigit ; dev@dpdk.org; NBU-Contact-Thomas >> Monjalon ; Andrew Rybchenko >> >> Cc: Beilei Xing ; Matan Azrad ; >> Shahaf Shuler ; Slava Ovsiienko >> >> Subject: Re: Question about 'rxm->hash.rss' and 'mb->hash.fdir' >> >> Hi, Beilei, Matan, Shahaf, Viacheslav, >> >> how about your opinion? >> >> 在 2021/6/30 17:34, Ferruh Yigit 写道: >>> On 6/30/2021 3:45 AM, Min Hu (Connor) wrote: >>>> Hi, all >>>>     one question about 'rxm->hash.rss' and 'mb->hash.fdir'. >>>> >>>>     In Rx recv packets function, >>>>     'rxm->hash.rss' will report rss hash result from Rx desc. >>>>     'rxm->hash.fdir' will report filter identifier from Rx desc. >>>> >>>>     But function implementation differs from some PMDs. for example: >>>>     i40e, MLX5 report the two at the same time if pkt_flags is set,like: >>>> ****************************************** >>>>         if (pkt_flags & PKT_RX_RSS_HASH) { >>>>             rxm->hash.rss = >>>> rte_le_to_cpu_32(rxd.wb.qword0.hi_dword.rss); >>>>         } >>>>         if (pkt_flags & PKT_RX_FDIR) { >>>>             mb->hash.fdir.hi = >>>>         rte_le_to_cpu_32(rxdp->wb.qword3.hi_dword.fd_id); >>>>         } >>>> ******************************************** >>>> >>>>     While, ixgbe only report one of the two. like: >>>> ****************************************** >>>>         if (likely(pkt_flags & PKT_RX_RSS_HASH)) >>>>             mb->hash.rss = rte_le_to_cpu_32( >>>>                 rxdp[j].wb.lower.hi_dword.rss); >>>>         else if (pkt_flags & PKT_RX_FDIR) { >>>>             mb->hash.fdir.hash = rte_le_to_cpu_16( >>>>                 rxdp[j].wb.lower.hi_dword.csum_ip.csum) & >>>>                 IXGBE_ATR_HASH_MASK; >>>>             mb->hash.fdir.id = rte_le_to_cpu_16( >>>>                 rxdp[j].wb.lower.hi_dword.csum_ip.ip_id); >>>>         } >>>> ******************************************** >>>>     So, what is application scenario for 'rxm->hash.rss' and >>>> 'mb->hash.fdir', that is, why the two should be reported? How about >>>> reporting the two at the same time? >>>>     Thanks for  your reply. >>> >>> >>> Hi Connor, >>> >>> mbuf->hash is union, so it is not possible to set both 'hash.rss' & 'hash.fdir'. > > hash.rss is uint32_t and shares the memory with hash.dir.lo. > hash.dir.hi is untouched by access to hash.rss. > Hence, IIUC, we can provide both valid hash.rss and hash.fdir.hi at the same time. > if reported at the same time, what do users(or APP)use them for ? > At least mlx5 provides both (at least if CQE compression option allows it). > RSS hash is provided in the hash.rss, and MARK RTE Flow action result is > reported in hash.fdir.hi in independent way. > >>> >>> I assume for i40e & mlx5 case 'pkt_flags' indicate which one is valid >>> and only one is set in practice. Cc'ed driver mainteriners for more comment. >> >> Thanks Ferruh, >> another question, why does user need this information: rxm->hash.rss >> or mb->hash.fdir.hi ? what is the function? > > IIRC, hash.rss is the lower bits if calculated hash function result over the packet. > hash.fdir.hi is the result of MARK RTE Flow action (at least for mlx5). > Thanks for your reply. > With best regards, > Slava >