From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
Thomas Monjalon <thomas@monjalon.net>,
Laurent Hardy <laurent.hardy@6wind.com>,
"David Marchand" <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, Olivier Matz <olivier.matz@6wind.com>
Subject: Re: [dpdk-dev] [PATCH] librte_ethdev: extend dpdk api led control to query capability
Date: Wed, 8 Jan 2020 17:15:27 +0300 [thread overview]
Message-ID: <817d82f8-18b4-1f2a-e531-3052fd8c48f3@solarflare.com> (raw)
In-Reply-To: <736913fa-3ad9-af6e-c1ad-bc6e72b8059e@intel.com>
On 1/8/20 4:52 PM, Ferruh Yigit wrote:
> On 1/8/2020 1:25 PM, Thomas Monjalon wrote:
>> 08/01/2020 14:20, Ferruh Yigit:
>>> On 1/8/2020 1:06 PM, Thomas Monjalon wrote:
>>>> 08/01/2020 13:59, Ferruh Yigit:
>>>>> But for dev_ops, instead of having another capabilities indicator, which
>>>>> requires PMDs to keep this synchronized, I think it is better if we can self
>>>>> contain this information within dev_ops, like not implementing dev_ops would
>>>>> mean it is not supported, this way it is easier to maintain and less error prone.
>>>>
>>>> It means the dev_ops is resetted at init if a device does not support the feature.
>>>> It is against having const dev_ops.
>>>
>>> I didn't get your comment.
>>> For example getting FW version, I am saying instead of keeping another piece of
>>> information to say if it is supported by device/driver, better to grasp this
>>> from if the driver implemented 'fw_version_get' dev_ops or not.
>>
>> I like this approach.
>> Capabilities should be expressed by setting the function pointer or not (NULL).
>> But a driver may support a feature for a subset of devices.
>
> In that case dev_ops itself can return the '-ENOTSUP', since application
> interaction will be through the ethdev API, either API send '-ENOTSUP' because
> the dev_ops is NULL or dev_ops itself send the '-ENOTSUP' because of the
> underlying version of the device, for application it will be clear that that
> feature is not supported.
I think it is a good illustration why deriving the capability
from dev_ops pointer is not that good idea.
>> If a device does not support a feature, the function pointer must be set to NULL.
>> The only issue is having dev_ops as a const struct.
>
> Not sure about changing the dev_ops on runtime, it can be very hard to debug.
I hope it was just an idea to copy dev_ops and adjust in
accordance with the device capabilities on register.
I.e. not fully dynamic changes in runtime.
next prev parent reply other threads:[~2020-01-08 14:15 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-07 14:56 Laurent Hardy
2020-01-08 8:56 ` David Marchand
2020-01-08 9:09 ` Ferruh Yigit
2020-01-08 9:42 ` Olivier Matz
2020-01-08 12:12 ` Ferruh Yigit
2020-01-08 12:27 ` Olivier Matz
2020-01-08 14:08 ` Ferruh Yigit
2020-01-08 14:45 ` Laurent Hardy
2020-01-08 9:55 ` David Marchand
2020-01-08 10:31 ` Laurent Hardy
2020-01-08 12:59 ` Ferruh Yigit
2020-01-08 13:06 ` Thomas Monjalon
2020-01-08 13:20 ` Ferruh Yigit
2020-01-08 13:25 ` Thomas Monjalon
2020-01-08 13:34 ` Thomas Monjalon
2020-01-08 13:53 ` Ferruh Yigit
2020-01-08 13:52 ` Ferruh Yigit
2020-01-08 14:01 ` Ferruh Yigit
2020-01-08 14:15 ` Andrew Rybchenko [this message]
2020-01-08 14:27 ` Thomas Monjalon
2020-01-08 14:37 ` Andrew Rybchenko
2020-01-08 13:58 ` Laurent Hardy
2020-01-08 14:07 ` Thomas Monjalon
2020-01-08 15:16 ` Laurent Hardy
2020-05-08 12:03 ` Ferruh Yigit
2020-05-08 12:11 ` Ferruh Yigit
2020-01-08 12:30 ` Ferruh Yigit
2020-01-08 13:00 ` David Marchand
2020-01-08 13:11 ` 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=817d82f8-18b4-1f2a-e531-3052fd8c48f3@solarflare.com \
--to=arybchenko@solarflare.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=laurent.hardy@6wind.com \
--cc=olivier.matz@6wind.com \
--cc=thomas@monjalon.net \
/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).