From: "Xueming(Steven) Li" <xuemingl@nvidia.com>
To: Viacheslav Galaktionov <Viacheslav.Galaktionov@oktetlabs.ru>
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" <dev@dpdk.org>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [PATCH] ethdev: keep count of allocated and used representor ranges
Date: Mon, 5 Jul 2021 02:50:32 +0000 [thread overview]
Message-ID: <DM4PR12MB53739A305ECDDEE3BD8446A1A11C9@DM4PR12MB5373.namprd12.prod.outlook.com> (raw)
In-Reply-To: <6f3f6072c2ff6b1a10214392e41c18af@oktetlabs.ru>
> -----Original Message-----
> From: Viacheslav Galaktionov <Viacheslav.Galaktionov@oktetlabs.ru>
> Sent: Saturday, July 3, 2021 6:01 PM
> 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: [PATCH] ethdev: keep count of allocated and used representor ranges
>
> 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?
No big difference, I'm ok with your original design.
next prev parent reply other threads:[~2021-07-05 2:50 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
2021-07-05 2:50 ` Xueming(Steven) Li [this message]
2021-07-05 10:02 ` [dpdk-stable] [PATCH v2] " Andrew Rybchenko
2021-07-05 11:07 ` Xueming(Steven) Li
2021-07-10 9:46 ` [dpdk-stable] [dpdk-dev] " 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=DM4PR12MB53739A305ECDDEE3BD8446A1A11C9@DM4PR12MB5373.namprd12.prod.outlook.com \
--to=xuemingl@nvidia.com \
--cc=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 \
/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).