DPDK patches and discussions
 help / color / mirror / Atom feed
From: Viacheslav Galaktionov <Viacheslav.Galaktionov@oktetlabs.ru>
To: "Xueming(Steven) Li" <xuemingl@nvidia.com>
Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Matan Azrad <matan@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	Slava Ovsiienko <viacheslavo@nvidia.com>,
	NBU-Contact-Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] ethdev: keep count of allocated and used representor ranges
Date: Sat, 03 Jul 2021 13:01:19 +0300
Message-ID: <6f3f6072c2ff6b1a10214392e41c18af@oktetlabs.ru> (raw)
In-Reply-To: <DM4PR12MB5373F42A3110F4A944ED7B65A11E9@DM4PR12MB5373.namprd12.prod.outlook.com>

Hello!

On 2021-07-03 04:32, Xueming(Steven) Li wrote:
>> +		if (i == n_entries)
>> +			break;
>>  	}
>>  out:
>> +	info->nb_ranges = i;
> 
> Here info maybe NULL.

Good catch, thanks for noticing!

>> faf3bd901d..d2b27c351f 100644
>> --- a/lib/ethdev/rte_ethdev.h
>> +++ b/lib/ethdev/rte_ethdev.h
>> @@ -4856,6 +4856,8 @@ struct rte_eth_representor_range {  struct 
>> rte_eth_representor_info {
>>  	uint16_t controller; /**< Controller ID of caller device. */
>>  	uint16_t pf; /**< Physical function ID of caller device. */
>> +	uint32_t nb_ranges_alloc; /**< Size of the ranges array. */
>> +	uint32_t nb_ranges; /**< Number of initialized ranges. */
> 
> How about rte_eth_representor_info_get(info) return max ranges size if
> info is NULL,
> return real initialized ranges if info not NULL?

I'm not sure how I feel about it. I think it'd be best if the function 
returned
just one thing.

Moreover, there are drivers that don't have a fixed structure for 
representor
IDs, e.g. net/sfc, where every range will contain a single ID. If a new
representor range is created between invocations of this function, there
probably should be a way for the caller to know about this.

Perhaps we should move the total number of representors to an out 
parameter and
use the return value for the number of initialized ranges. What do you 
think
about this?

  reply	other threads:[~2021-07-05  6:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 14:23 Andrew Rybchenko
2021-07-03  1:32 ` Xueming(Steven) Li
2021-07-03 10:01   ` Viacheslav Galaktionov [this message]
2021-07-05  2:50     ` Xueming(Steven) Li
2021-07-05 10:02 ` [dpdk-dev] [PATCH v2] " Andrew Rybchenko
2021-07-05 11:07   ` Xueming(Steven) Li
2021-07-10  9:46     ` Thomas Monjalon

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=6f3f6072c2ff6b1a10214392e41c18af@oktetlabs.ru \
    --to=viacheslav.galaktionov@oktetlabs.ru \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=matan@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    --cc=xuemingl@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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git