DPDK patches and discussions
 help / color / mirror / Atom feed
From: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Ajit Khaparde <ajit.khaparde@broadcom.com>,
	Somnath Kotur <somnath.kotur@broadcom.com>,
	John Daley <johndale@cisco.com>,
	Hyong Youb Kim <hyonkim@cisco.com>,
	Beilei Xing <beilei.xing@intel.com>,
	Qiming Yang <qiming.yang@intel.com>,
	Qi Zhang <qi.z.zhang@intel.com>,
	Haiyue Wang <haiyue.wang@intel.com>,
	Matan Azrad <matan@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Thomas Monjalon <thomas@monjalon.net>,
	dev@dpdk.org, declan.doherty@intel.com
Subject: Re: [dpdk-dev] [PATCH v4] ethdev: fix representor port ID search by name
Date: Mon, 06 Sep 2021 19:16:12 +0300	[thread overview]
Message-ID: <ffffadc0cf60e7ac5b4863bb232d0aad@oktetlabs.ru> (raw)
In-Reply-To: <fdddbb05-0e92-3d11-2052-e97272bb07ad@intel.com>

On 2021-09-01 17:55, Ferruh Yigit wrote:
> On 8/31/2021 5:06 PM, Andrew Rybchenko wrote:
>> From: Viacheslav Galaktionov <viacheslav.galaktionov@oktetlabs.ru>
>> 
>> Getting a list of representors from a representor does not make sense.
>> Instead, a parent device should be used.
>> 
> 
> Which code is getting list of the representors?
> 
> As far as I can see impacted APIs are:
> 'rte_eth_representor_id_get()'
> 'rte_eth_representor_info_get()'
> 
> Which are now getting 'parent_port_id' as argument, instead of
> representro port id.
> 
> 'rte_eth_representor_info_get()' is using 'representor_info_get()' 
> dev_ops,
> which is only implemented by 'mlx5', so is this problem only valid for 
> 'mlx5'
> and can it be solved within PMD implementation?

It's not an mlx5-specific problem, it's going to affect sfc as well once 
it
starts supporting representors. But that doesn't really matter as it's 
more
about the usage of representors in general, not specific to any PMD's 
internals.

Since representors are created through some device (which is probed and 
assigned
a port ID), it makes sense to query the list of representors from the 
same
device.

[snip]

>> index edf96de2dc..72fefa59c2 100644
>> --- a/lib/ethdev/rte_ethdev_core.h
>> +++ b/lib/ethdev/rte_ethdev_core.h
>> @@ -185,6 +185,12 @@ struct rte_eth_dev_data {
>>  			/**< Switch-specific identifier.
>>  			 *   Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags.
>>  			 */
>> +	uint16_t parent_port_id;
> 
> Why 'parent'? Isn't this for the port that port representator 
> represents, does
> it called 'parent'? Above that device mentioned as 'backing device' a 
> few times,
> so would something like 'peer_port_id' better?

This is true, the naming here is confusing and should be changed.
"parent_port_id" doesn't point at the represented entity, but at the 
device
that was used to create this representor. We call it the backing device, 
so
using "backer_port_id" sounds appropriate, what do you think?

>> +			/**< Port ID of the backing device.
>> +			 *   This device will be used to query representor
>> +			 *   info and calculate representor IDs.
>> +			 *   Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags.
>> +			 */
>> 
> 
> 
> Overall I am not feeling good about adding representor port related 
> information
> withing the device data struct.
> I wonder if this information can be kept in the device private data.
> 
> Or, it is hard to explain but can we use something like inheritance, a
> representor specific dev_data derived from original dev_data. We can 
> store
> dev_data pointers in 'struct rte_eth_dev' but can cast it to 
> representor
> specific dev_data when type is representor.
> 
> struct rte_eth_dev_data_rep
> 	struct rte_eth_dev_data
> 	<representor specific fields>
> 
> This brings lots of complexity though, specially in allocating/freeing 
> this
> struct, not sure if it worth to the effort.

This information is usually kept in the device private data as well, but 
we
need to use it from the generic code to redirect the representor info 
requests
to the appropriate ports.

Using "inheritance" is a good suggestion, but it does bring a lot of 
complexity,
as you've said, and we're not sure if the result is worth the effort.

We can also avoid storing this port ID in the device data by creating a 
special
callback that PMDs would use to return it. However, this also brings 
complexity
and this information is static anyway, so having a separate callback 
might be
a little too much.

What we're doing here just seems to be the simplest option.

  reply	other threads:[~2021-09-06 16:16 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 16:17 [dpdk-dev] [PATCH] " Andrew Rybchenko
2021-07-19  6:58 ` Xueming(Steven) Li
2021-07-19  8:46   ` Andrew Rybchenko
2021-07-19 11:54     ` Xueming(Steven) Li
2021-07-19 12:36       ` Andrew Rybchenko
2021-07-19 12:50         ` Xueming(Steven) Li
2021-07-20  8:59           ` Andrew Rybchenko
2021-07-29  4:13             ` Xueming(Steven) Li
2021-08-01  8:40               ` Andrew Rybchenko
2021-08-01 14:25                 ` Xueming(Steven) Li
2021-07-29  4:20 ` Xueming(Steven) Li
2021-08-01  8:50   ` Andrew Rybchenko
2021-08-01 14:15     ` Xueming(Steven) Li
2021-08-18 14:00 ` [dpdk-dev] [PATCH v2] " Andrew Rybchenko
2021-08-27  9:18   ` Xueming(Steven) Li
2021-08-27  9:48     ` Viacheslav Galaktionov
2021-08-28 13:22       ` Xueming(Steven) Li
2021-08-29  8:23         ` Andrew Rybchenko
2021-08-29 12:17           ` Xueming(Steven) Li
2021-08-31 15:42             ` Andrew Rybchenko
2021-08-20 12:18 ` [dpdk-dev] [PATCH v3] " Andrew Rybchenko
2021-08-31 15:41   ` Andrew Rybchenko
2021-08-31 16:06 ` [dpdk-dev] [PATCH v4] " Andrew Rybchenko
2021-08-31 16:32   ` Wang, Haiyue
2021-08-31 16:37     ` Andrew Rybchenko
2021-09-01  5:15   ` Xing, Beilei
2021-09-01 14:55   ` Ferruh Yigit
2021-09-06 16:16     ` Viacheslav Galaktionov [this message]
2021-09-13 11:26 ` [dpdk-dev] [PATCH v5] " Andrew Rybchenko
2021-09-29 11:13   ` Singh, Aman Deep
2021-09-30 12:03     ` Andrew Rybchenko
2021-09-30 12:51       ` Singh, Aman Deep
2021-09-30 13:40         ` Andrew Rybchenko
2021-10-01 11:39   ` Andrew Rybchenko
2021-10-08  8:39     ` Xueming(Steven) Li
2021-10-05 21:56   ` Thomas Monjalon
2021-10-07 10:20     ` Andrew Rybchenko
2021-10-07 12:39       ` Thomas Monjalon
2021-10-08  9:27 ` [dpdk-dev] [PATCH v6] " Andrew Rybchenko
2021-10-11  7:56   ` Slava Ovsiienko
2021-10-11 12:30 ` [dpdk-dev] [PATCH v7] " Andrew Rybchenko
2021-10-11 12:53 ` [dpdk-dev] [PATCH v8] " Andrew Rybchenko
2021-10-12 15:09   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ffffadc0cf60e7ac5b4863bb232d0aad@oktetlabs.ru \
    --to=viacheslav.galaktionov@oktetlabs.ru \
    --cc=ajit.khaparde@broadcom.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=beilei.xing@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=haiyue.wang@intel.com \
    --cc=hyonkim@cisco.com \
    --cc=johndale@cisco.com \
    --cc=matan@nvidia.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=shahafs@nvidia.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).