[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200326145953.GY11304@nanopsycho.orion>
Date: Thu, 26 Mar 2020 15:59:53 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: netdev@...r.kernel.org, davem@...emloft.net, parav@...lanox.com,
yuvalav@...lanox.com, jgg@...pe.ca, saeedm@...lanox.com,
leon@...nel.org, andrew.gospodarek@...adcom.com,
michael.chan@...adcom.com, moshe@...lanox.com, ayal@...lanox.com,
eranbe@...lanox.com, vladbu@...lanox.com, kliteyn@...lanox.com,
dchickles@...vell.com, sburla@...vell.com, fmanlunas@...vell.com,
tariqt@...lanox.com, oss-drivers@...ronome.com,
snelson@...sando.io, drivers@...sando.io, aelior@...vell.com,
GR-everest-linux-l2@...vell.com, grygorii.strashko@...com,
mlxsw@...lanox.com, idosch@...lanox.com, markz@...lanox.com,
jacob.e.keller@...el.com, valex@...lanox.com,
linyunsheng@...wei.com, lihong.yang@...el.com,
vikas.gupta@...adcom.com, magnus.karlsson@...el.com
Subject: Re: [RFC] current devlink extension plan for NICs
>> >> >> $ devlink slice add pci/0000.06.00.0/100 flavour pcisf pfnum 1 sfnum 10 hw_addr aa:bb:cc:aa:bb:cc
>> >> >
>> >> >Why is the SF number specified by the user rather than allocated?
>> >>
>> >> Because it is snown in representor netdevice name. And you need to have
>> >> it predetermined: enp6s0pf1sf10
>> >
>> >I'd think you need to know what was assigned, not necessarily pick
>> >upfront.. I feel like we had this conversation before as well.
>>
>> Yeah. For the scripting sake, always when you create something, you can
>> directly use it later in the script. Like if you create a bridge, you
>> assign it a name so you can use it.
>>
>> The "what was assigned" would mean that the assigne
>> value has to be somehow returned from the kernel and passed to the
>> script. Not sure how. Do you have any example where this is happening in
>> networking?
>
>Not really, but when allocating objects it seems idiomatic to get the
>id / handle / address of the new entity in response. Seems to me we're
>not doing it because the infrastructure for it is not in place, but
>it'd be a good extension.
>
>Times are a little crazy but I can take a poke at implementing
>something along those lines once I find some time..
I can't really see how is this supposed to work efficiently. Imagine a
simple dummy script:
devlink slice add pci/0000.06.00.0/100 flavour pcisf pfnum 1 sfnum 10
devlink slice set pci/0000.06.00.0/100 hw_addr aa:bb:cc:aa:bb:cc
devlink slice del pci/0000.06.00.0/100
The handle is clear then, used for add/set/del. The same thing.
Now with dynamically allocated index that you suggest:
devlink slice add pci/0000.06.00.0 flavour pcisf pfnum 1 sfnum 10
#somehow get the 100 into variable $XXX
XXX=???
devlink slice set pci/0000.06.00.0/$XXX hw_addr aa:bb:cc:aa:bb:cc
devlink slice del pci/0000.06.00.0/$XXX
there are two things I don't like about this:
1) You use different handles for different actions.
2) You need to somehow get the number into variable $XXX
What is the benefit of this approach?
Powered by blists - more mailing lists