DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Question about 'rxm->hash.rss' and 'mb->hash.fdir'
@ 2021-06-30  2:45 Min Hu (Connor)
  2021-06-30  9:34 ` Ferruh Yigit
  0 siblings, 1 reply; 6+ messages in thread
From: Min Hu (Connor) @ 2021-06-30  2:45 UTC (permalink / raw)
  To: dev, Ferruh Yigit, Thomas Monjalon

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] Question about 'rxm->hash.rss' and 'mb->hash.fdir'
  2021-06-30  2:45 [dpdk-dev] Question about 'rxm->hash.rss' and 'mb->hash.fdir' Min Hu (Connor)
@ 2021-06-30  9:34 ` Ferruh Yigit
  2021-06-30 11:21   ` Min Hu (Connor)
  0 siblings, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2021-06-30  9:34 UTC (permalink / raw)
  To: Min Hu (Connor), dev, Thomas Monjalon, Andrew Rybchenko
  Cc: Beilei Xing, Qi Zhang, Raslan Darawsheh, Haiyue Wang,
	Viacheslav Ovsiienko

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] Question about 'rxm->hash.rss' and 'mb->hash.fdir'
  2021-06-30  9:34 ` Ferruh Yigit
@ 2021-06-30 11:21   ` Min Hu (Connor)
  2021-06-30 11:44     ` Slava Ovsiienko
  2021-07-01  1:31     ` Xing, Beilei
  0 siblings, 2 replies; 6+ messages in thread
From: Min Hu (Connor) @ 2021-06-30 11:21 UTC (permalink / raw)
  To: Ferruh Yigit, dev, Thomas Monjalon, Andrew Rybchenko
  Cc: Beilei Xing, Matan Azrad, shahafs, viacheslavo

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'.
> 
> 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?

> .
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] Question about 'rxm->hash.rss' and 'mb->hash.fdir'
  2021-06-30 11:21   ` Min Hu (Connor)
@ 2021-06-30 11:44     ` Slava Ovsiienko
  2021-07-01  0:23       ` Min Hu (Connor)
  2021-07-01  1:31     ` Xing, Beilei
  1 sibling, 1 reply; 6+ messages in thread
From: Slava Ovsiienko @ 2021-06-30 11:44 UTC (permalink / raw)
  To: Min Hu (Connor),
	Ferruh Yigit, dev, NBU-Contact-Thomas Monjalon, Andrew Rybchenko
  Cc: Beilei Xing, Matan Azrad, Shahaf Shuler

Hi,

> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Wednesday, June 30, 2021 14:22
> To: Ferruh Yigit <ferruh.yigit@intel.com>; dev@dpdk.org; NBU-Contact-Thomas
> Monjalon <thomas@monjalon.net>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>
> Cc: Beilei Xing <beilei.xing@intel.com>; Matan Azrad <matan@nvidia.com>;
> Shahaf Shuler <shahafs@nvidia.com>; Slava Ovsiienko
> <viacheslavo@nvidia.com>
> 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.

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).

With best regards,
Slava


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] Question about 'rxm->hash.rss' and 'mb->hash.fdir'
  2021-06-30 11:44     ` Slava Ovsiienko
@ 2021-07-01  0:23       ` Min Hu (Connor)
  0 siblings, 0 replies; 6+ messages in thread
From: Min Hu (Connor) @ 2021-07-01  0:23 UTC (permalink / raw)
  To: Slava Ovsiienko, Ferruh Yigit, dev, NBU-Contact-Thomas Monjalon,
	Andrew Rybchenko
  Cc: Beilei Xing, Matan Azrad, Shahaf Shuler

Hi, Slava

在 2021/6/30 19:44, Slava Ovsiienko 写道:
> Hi,
> 
>> -----Original Message-----
>> From: Min Hu (Connor) <humin29@huawei.com>
>> Sent: Wednesday, June 30, 2021 14:22
>> To: Ferruh Yigit <ferruh.yigit@intel.com>; dev@dpdk.org; NBU-Contact-Thomas
>> Monjalon <thomas@monjalon.net>; Andrew Rybchenko
>> <andrew.rybchenko@oktetlabs.ru>
>> Cc: Beilei Xing <beilei.xing@intel.com>; Matan Azrad <matan@nvidia.com>;
>> Shahaf Shuler <shahafs@nvidia.com>; Slava Ovsiienko
>> <viacheslavo@nvidia.com>
>> 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
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] Question about 'rxm->hash.rss' and 'mb->hash.fdir'
  2021-06-30 11:21   ` Min Hu (Connor)
  2021-06-30 11:44     ` Slava Ovsiienko
@ 2021-07-01  1:31     ` Xing, Beilei
  1 sibling, 0 replies; 6+ messages in thread
From: Xing, Beilei @ 2021-07-01  1:31 UTC (permalink / raw)
  To: Min Hu (Connor), Yigit, Ferruh, dev, Thomas Monjalon, Andrew Rybchenko
  Cc: Matan Azrad, shahafs, viacheslavo



> -----Original Message-----
> From: Min Hu (Connor) <humin29@huawei.com>
> Sent: Wednesday, June 30, 2021 7:22 PM
> To: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org; Thomas Monjalon
> <thomas@monjalon.net>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>
> Cc: Xing, Beilei <beilei.xing@intel.com>; Matan Azrad
> <matan@mellanox.com>; shahafs@nvidia.com; viacheslavo@nvidia.com
> Subject: Re: Question about 'rxm->hash.rss' and 'mb->hash.fdir'
> 
> Hi, Beilei, Matan, Shahaf, Viacheslav,
> 
> 	how about your opinion?

Agree with Ferruh.

> 
> 在 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'.
> >
> > 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?
> 
> > .
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-01  1:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30  2:45 [dpdk-dev] Question about 'rxm->hash.rss' and 'mb->hash.fdir' Min Hu (Connor)
2021-06-30  9:34 ` Ferruh Yigit
2021-06-30 11:21   ` Min Hu (Connor)
2021-06-30 11:44     ` Slava Ovsiienko
2021-07-01  0:23       ` Min Hu (Connor)
2021-07-01  1:31     ` Xing, Beilei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).