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 4923BA0A0F; Wed, 30 Jun 2021 11:34:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B30A440141; Wed, 30 Jun 2021 11:34:24 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 3A5D840040 for ; Wed, 30 Jun 2021 11:34:23 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10030"; a="272175063" X-IronPort-AV: E=Sophos;i="5.83,311,1616482800"; d="scan'208";a="272175063" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2021 02:34:18 -0700 X-IronPort-AV: E=Sophos;i="5.83,311,1616482800"; d="scan'208";a="408498310" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.221.90]) ([10.213.221.90]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2021 02:34:16 -0700 To: "Min Hu (Connor)" , "dev@dpdk.org" , Thomas Monjalon , Andrew Rybchenko References: <6ac31917-8ae6-b61f-c0c1-07d907066752@huawei.com> From: Ferruh Yigit Cc: Beilei Xing , Qi Zhang , Raslan Darawsheh , Haiyue Wang , Viacheslav Ovsiienko X-User: ferruhy Message-ID: <50258962-ee1b-e045-aba2-9ef7912a304e@intel.com> Date: Wed, 30 Jun 2021 10:34:15 +0100 MIME-Version: 1.0 In-Reply-To: <6ac31917-8ae6-b61f-c0c1-07d907066752@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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" 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'. 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.