mbox series

[net-next,v7,0/8] devlink: Add configuration parameters support for devlink_port

Message ID 1547795385-12354-1-git-send-email-vasundhara-v.volam@broadcom.com
Headers show
Series devlink: Add configuration parameters support for devlink_port | expand

Message

Vasundhara Volam Jan. 18, 2019, 7:09 a.m. UTC
This patchset adds support for configuration parameters setting through
devlink_port.  Each device registers supported configuration parameters
table.

The user can retrieve data on these parameters by
"devlink port param show" command and can set new value to a
parameter by "devlink port param set" command.
All configuration modes supported by devlink_dev are supported
by devlink_port also.

Command examples and output:

# devlink port param show
pci/0000:3b:00.0/0:
  name wake-on-lan type generic
    values:
      cmode permanent value false

pci/0000:3b:00.1/1:
  name wake-on-lan type generic
    values:
      cmode permanent value false

pci/0000:af:00.0/0:
  name wake-on-lan type generic
    values:
      cmode permanent value true

# devlink port param show pci/0000:3b:00.0/0 name wake-on-lan
pci/0000:3b:00.0/0:
  name wake-on-lan type generic
    values:
      cmode permanent value false

# devlink port param set pci/0000:3b:00.0/0 name wake-on-lan cmode permanent value true

There is difference of opinion on adding WOL parameter to devlink, between
Jakub Kicinski and Michael Chan.

Quote from Jakud Kicinski:
********
As explained previously I think it's a very bad idea to add existing
configuration options to devlink, just because devlink has the ability
to persist the setting in NVM.  Especially that for WoL you have to get
the link up so you potentially have all link config stuff as well.  And
that n-tuple filters are one of the WoL options, meaning we'd need the
ability to persist n-tuple filters via devlink.

The effort would be far better spent helping with migrating ethtool to
netlink, and allowing persisting there.

I have not heard any reason why devlink is a better fit.  I can imagine
you're just doing it here because it's less effort for you since
ethtool is not yet migrated.
********

Quote from Michael Chan:
********
The devlink's WoL parameter is a persistent WoL parameter stored in the
NIC's NVRAM. It is different from ethtool's WoL parameter in a number of
ways. ethtool WoL is not persistent over AC power cycle and is considered
OS-present WoL. As such, ethtool WoL can use a more sophisticated pattern
including n-tuple with IP address in addition to the more basic types
(e.g. magic packet). Whereas OS-absent power up WoL should only include
magic packet and other simple types. The devlink WoL setting does not have
to match the ethtool WoL setting. The card will autoneg up to the speed
supported by Vaux so no special devlink link setting is needed.
********

v6->v7:
* Remove RFC tag from the patch-set.

v5->v6:
* Replace '-' with '*' in cover letter to avoid cutoff by git.

v4->v5:
* Added quotes from Jakub Kicinski and Michael chan on devlink's WOL
  parameter in the cover letter.

v3->v4:
* Update changes done from v2 to v3 version in individual patch
  descriptions.

v2->v3:
Make following changes as per suggestions from Jiri Pirko and
Michal Kubecek.
* Add a helper __devlink_params_register() with common code used by
  both devlink_params_register() and devlink_port_params_register().
* Define only WOL types used now and define them as bitfield, so that
  mutliple WOL types can be enabled upon power on.
* Modify "wake-on-lan" name to "wake_on_lan" to be symmetric with
  previous definitions.
* Rename DEVLINK_PARAM_WOL_XXX to DEVLINK_PARAM_WAKE_XXX to be
  symmetrical with ethtool WOL definitions.
* Modify bnxt_dl_wol_validate(), to throw error message when user gives
  value other than DEVLINK_PARAM_WAKE_MAGIC or to disable WOL.
* Use netdev_err() instead of netdev_warn(), when devlink_port_register()
  and devlink_port_params_register() returns error. Also, don't log rc
  in this message.

v1->v2:
Make following changes as per suggestions from Jiri Pirko.
* Remove separate enum devlink_port_param_generic_id for port params.
  Instead club it with existing device params. Accordingly refactor
  remaining patchset.
* Move INIT_LIST_HEAD of port param_list to devlink_port_register()
* Add a helper devlink_param_verify() to be used for both
  devlink_params_register() and devlink_port_params_register().
* Add a helper __devlink_params_unregister() for common code in
  devlink_params_unregister() and devlink_port_params_unregister().
* Move DEVLINK_CMD_PORT_PARAM_XXX definitions to the end of the enum.
* Split the patches for devlink_port_param_driverinit_value_get() and
  devlink_port_param_driverinit_value_set() into separate patches.
* define DEVLINK_PARAM_GENERIC_ID_WOL type as u8 and define enum for
  different types of WOL. Accordingly modify bnxt_en patch to validate
  wol type.

Vasundhara Volam (8):
  devlink: Add devlink_param for port register and unregister
  devlink: Add port param get command
  devlink: Add port param set command
  devlink: Add support for driverinit get value for devlink_port
  devlink: Add support for driverinit set value for devlink_port
  devlink: Add devlink notifications support for port params
  devlink: Add a generic wake_on_lan port parameter
  bnxt_en: Add bnxt_en initial port params table and register it

 drivers/net/ethernet/broadcom/bnxt/bnxt.h         |   1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c |  43 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.h |   1 +
 include/net/devlink.h                             |  57 +++
 include/uapi/linux/devlink.h                      |   5 +
 net/core/devlink.c                                | 464 ++++++++++++++++++----
 6 files changed, 489 insertions(+), 82 deletions(-)

Comments

Michal Kubecek Jan. 18, 2019, 2:33 p.m. UTC | #1
On Fri, Jan 18, 2019 at 12:39:37PM +0530, Vasundhara Volam wrote:
> There is difference of opinion on adding WOL parameter to devlink, between
> Jakub Kicinski and Michael Chan.
> 
> Quote from Jakud Kicinski:
> ********
> As explained previously I think it's a very bad idea to add existing
> configuration options to devlink, just because devlink has the ability
> to persist the setting in NVM.  Especially that for WoL you have to get
> the link up so you potentially have all link config stuff as well.  And
> that n-tuple filters are one of the WoL options, meaning we'd need the
> ability to persist n-tuple filters via devlink.
> 
> The effort would be far better spent helping with migrating ethtool to
> netlink, and allowing persisting there.
> 
> I have not heard any reason why devlink is a better fit.  I can imagine
> you're just doing it here because it's less effort for you since
> ethtool is not yet migrated.
> ********
> 
> Quote from Michael Chan:
> ********
> The devlink's WoL parameter is a persistent WoL parameter stored in the
> NIC's NVRAM. It is different from ethtool's WoL parameter in a number of
> ways. ethtool WoL is not persistent over AC power cycle and is considered
> OS-present WoL. As such, ethtool WoL can use a more sophisticated pattern
> including n-tuple with IP address in addition to the more basic types
> (e.g. magic packet). Whereas OS-absent power up WoL should only include
> magic packet and other simple types.

If I understand correctly, it's that way now. I'm not sure there is a
technical reason preventing more complex WoL types in the OS-absent case
in the future. Also, even with traditional ethtool WoL setting, most
NICs only support some of the types (I'm not sure if there is a NIC
which would support all of them.)

> The devlink WoL setting does not have to match the ethtool WoL
> setting.

IMHO this is not really a problem. We can either use an additional flag
telling kernel/driver if we are setting runtime or persistent WoL mask
or we can pass (up to) two bitmaps.

> The card will autoneg up to the speed supported by Vaux so no special
> devlink link setting is needed.
> ********

Like Jakub, I'm not convinced there is a strong technical reason to have
each of the WoL settings handled through a different interface. I don't
say, though, that ethtool is necessarily the right one. If there is
a consensus that it better fits into devlink, I can imagine that both
could be accessible through devlink (for start, in drivers which choose
so, e.g. because they want to implement the persistent setting).

Michal Kubecek
Jakub Kicinski Jan. 22, 2019, 10:18 p.m. UTC | #2
On Fri, 18 Jan 2019 15:33:19 +0100, Michal Kubecek wrote:
> On Fri, Jan 18, 2019 at 12:39:37PM +0530, Vasundhara Volam wrote:
> > There is difference of opinion on adding WOL parameter to devlink, between
> > Jakub Kicinski and Michael Chan.
> > 
> > Quote from Jakud Kicinski:
> > ********
> > As explained previously I think it's a very bad idea to add existing
> > configuration options to devlink, just because devlink has the ability
> > to persist the setting in NVM.  Especially that for WoL you have to get
> > the link up so you potentially have all link config stuff as well.  And
> > that n-tuple filters are one of the WoL options, meaning we'd need the
> > ability to persist n-tuple filters via devlink.
> > 
> > The effort would be far better spent helping with migrating ethtool to
> > netlink, and allowing persisting there.
> > 
> > I have not heard any reason why devlink is a better fit.  I can imagine
> > you're just doing it here because it's less effort for you since
> > ethtool is not yet migrated.
> > ********
> > 
> > Quote from Michael Chan:
> > ********
> > The devlink's WoL parameter is a persistent WoL parameter stored in the
> > NIC's NVRAM. It is different from ethtool's WoL parameter in a number of
> > ways. ethtool WoL is not persistent over AC power cycle and is considered
> > OS-present WoL. As such, ethtool WoL can use a more sophisticated pattern
> > including n-tuple with IP address in addition to the more basic types
> > (e.g. magic packet). Whereas OS-absent power up WoL should only include
> > magic packet and other simple types.  
> 
> If I understand correctly, it's that way now. I'm not sure there is a
> technical reason preventing more complex WoL types in the OS-absent case
> in the future. Also, even with traditional ethtool WoL setting, most
> NICs only support some of the types (I'm not sure if there is a NIC
> which would support all of them.)
> 
> > The devlink WoL setting does not have to match the ethtool WoL
> > setting.  
> 
> IMHO this is not really a problem. We can either use an additional flag
> telling kernel/driver if we are setting runtime or persistent WoL mask
> or we can pass (up to) two bitmaps.

I think reusing new netlink ethtool with a special flag would be a nice,
complete solution.  We could also address link settings this way (which
are a pre-requisite for WoL).

I have no strong preference on the mechanism, but for ease of setting
as well as dumping would it be workable to use a nesting, like this:

Run time settings:
  [ETHTOOL_SETTINGS_BLA]
    [ETHTOOL_BLA_VAL_1]
    [ETHTOOL_BLA_VAL_2]
    ...

Persistent:
  [ETHTOOL_PERSISTENT]
    [ETHTOOL_SETTINGS_BLA]
      [ETHTOOL_BLA_VAL_1]
      [ETHTOOL_BLA_VAL_2]

IOW encapsulate settings into a "persistent" attribute?

How does that look to you, Michal?

> > The card will autoneg up to the speed supported by Vaux so no special
> > devlink link setting is needed.
> > ********  
> 
> Like Jakub, I'm not convinced there is a strong technical reason to have
> each of the WoL settings handled through a different interface. I don't
> say, though, that ethtool is necessarily the right one. If there is
> a consensus that it better fits into devlink, I can imagine that both
> could be accessible through devlink (for start, in drivers which choose
> so, e.g. because they want to implement the persistent setting).
> 
> Michal Kubecek
Vasundhara Volam Jan. 24, 2019, 9:42 a.m. UTC | #3
On Fri, Jan 18, 2019 at 8:03 PM Michal Kubecek <mkubecek@suse.cz> wrote:
>
> On Fri, Jan 18, 2019 at 12:39:37PM +0530, Vasundhara Volam wrote:
> > There is difference of opinion on adding WOL parameter to devlink, between
> > Jakub Kicinski and Michael Chan.
> >
> > Quote from Jakud Kicinski:
> > ********
> > As explained previously I think it's a very bad idea to add existing
> > configuration options to devlink, just because devlink has the ability
> > to persist the setting in NVM.  Especially that for WoL you have to get
> > the link up so you potentially have all link config stuff as well.  And
> > that n-tuple filters are one of the WoL options, meaning we'd need the
> > ability to persist n-tuple filters via devlink.
> >
> > The effort would be far better spent helping with migrating ethtool to
> > netlink, and allowing persisting there.
> >
> > I have not heard any reason why devlink is a better fit.  I can imagine
> > you're just doing it here because it's less effort for you since
> > ethtool is not yet migrated.
> > ********
> >
> > Quote from Michael Chan:
> > ********
> > The devlink's WoL parameter is a persistent WoL parameter stored in the
> > NIC's NVRAM. It is different from ethtool's WoL parameter in a number of
> > ways. ethtool WoL is not persistent over AC power cycle and is considered
> > OS-present WoL. As such, ethtool WoL can use a more sophisticated pattern
> > including n-tuple with IP address in addition to the more basic types
> > (e.g. magic packet). Whereas OS-absent power up WoL should only include
> > magic packet and other simple types.
>
> If I understand correctly, it's that way now. I'm not sure there is a
> technical reason preventing more complex WoL types in the OS-absent case
> in the future. Also, even with traditional ethtool WoL setting, most
> NICs only support some of the types (I'm not sure if there is a NIC
> which would support all of them.)
Agreed. This can be extended in future for other types of WoL.

>
> > The devlink WoL setting does not have to match the ethtool WoL
> > setting.
>
> IMHO this is not really a problem. We can either use an additional flag
> telling kernel/driver if we are setting runtime or persistent WoL mask
> or we can pass (up to) two bitmaps.
This already supports as persistent or runtime WoL. All devlink parameters
have this option to be either persistent or runtime which is defined
by the driver
when defining the parameter.

>
> > The card will autoneg up to the speed supported by Vaux so no special
> > devlink link setting is needed.
> > ********
>
> Like Jakub, I'm not convinced there is a strong technical reason to have
> each of the WoL settings handled through a different interface. I don't
> say, though, that ethtool is necessarily the right one. If there is
> a consensus that it better fits into devlink, I can imagine that both
> could be accessible through devlink (for start, in drivers which choose
> so, e.g. because they want to implement the persistent setting).
Devlink supports both persistent and runtime WoL setting. It depends on
driver's use case.

>
> Michal Kubecek
Vasundhara Volam Jan. 24, 2019, 9:46 a.m. UTC | #4
On Wed, Jan 23, 2019 at 3:48 AM Jakub Kicinski
<jakub.kicinski@netronome.com> wrote:
>
> On Fri, 18 Jan 2019 15:33:19 +0100, Michal Kubecek wrote:
> > On Fri, Jan 18, 2019 at 12:39:37PM +0530, Vasundhara Volam wrote:
> > > There is difference of opinion on adding WOL parameter to devlink, between
> > > Jakub Kicinski and Michael Chan.
> > >
> > > Quote from Jakud Kicinski:
> > > ********
> > > As explained previously I think it's a very bad idea to add existing
> > > configuration options to devlink, just because devlink has the ability
> > > to persist the setting in NVM.  Especially that for WoL you have to get
> > > the link up so you potentially have all link config stuff as well.  And
> > > that n-tuple filters are one of the WoL options, meaning we'd need the
> > > ability to persist n-tuple filters via devlink.
> > >
> > > The effort would be far better spent helping with migrating ethtool to
> > > netlink, and allowing persisting there.
> > >
> > > I have not heard any reason why devlink is a better fit.  I can imagine
> > > you're just doing it here because it's less effort for you since
> > > ethtool is not yet migrated.
> > > ********
> > >
> > > Quote from Michael Chan:
> > > ********
> > > The devlink's WoL parameter is a persistent WoL parameter stored in the
> > > NIC's NVRAM. It is different from ethtool's WoL parameter in a number of
> > > ways. ethtool WoL is not persistent over AC power cycle and is considered
> > > OS-present WoL. As such, ethtool WoL can use a more sophisticated pattern
> > > including n-tuple with IP address in addition to the more basic types
> > > (e.g. magic packet). Whereas OS-absent power up WoL should only include
> > > magic packet and other simple types.
> >
> > If I understand correctly, it's that way now. I'm not sure there is a
> > technical reason preventing more complex WoL types in the OS-absent case
> > in the future. Also, even with traditional ethtool WoL setting, most
> > NICs only support some of the types (I'm not sure if there is a NIC
> > which would support all of them.)
> >
> > > The devlink WoL setting does not have to match the ethtool WoL
> > > setting.
> >
> > IMHO this is not really a problem. We can either use an additional flag
> > telling kernel/driver if we are setting runtime or persistent WoL mask
> > or we can pass (up to) two bitmaps.
>
> I think reusing new netlink ethtool with a special flag would be a nice,
> complete solution.  We could also address link settings this way (which
> are a pre-requisite for WoL).
>
> I have no strong preference on the mechanism, but for ease of setting
> as well as dumping would it be workable to use a nesting, like this:
>
> Run time settings:
>   [ETHTOOL_SETTINGS_BLA]
>     [ETHTOOL_BLA_VAL_1]
>     [ETHTOOL_BLA_VAL_2]
>     ...
>
> Persistent:
>   [ETHTOOL_PERSISTENT]
>     [ETHTOOL_SETTINGS_BLA]
>       [ETHTOOL_BLA_VAL_1]
>       [ETHTOOL_BLA_VAL_2]
>
> IOW encapsulate settings into a "persistent" attribute?
Not sure if current devlink framework allows to encapsulate additional
settings now.
But we can think of extending it to support this when there is a requirement.

>
> How does that look to you, Michal?
>
> > > The card will autoneg up to the speed supported by Vaux so no special
> > > devlink link setting is needed.
> > > ********
> >
> > Like Jakub, I'm not convinced there is a strong technical reason to have
> > each of the WoL settings handled through a different interface. I don't
> > say, though, that ethtool is necessarily the right one. If there is
> > a consensus that it better fits into devlink, I can imagine that both
> > could be accessible through devlink (for start, in drivers which choose
> > so, e.g. because they want to implement the persistent setting).
> >
> > Michal Kubecek
Jakub Kicinski Jan. 24, 2019, 6:50 p.m. UTC | #5
On Thu, 24 Jan 2019 15:16:27 +0530, Vasundhara Volam wrote:
> > > > The devlink WoL setting does not have to match the ethtool WoL
> > > > setting.  
> > >
> > > IMHO this is not really a problem. We can either use an additional flag
> > > telling kernel/driver if we are setting runtime or persistent WoL mask
> > > or we can pass (up to) two bitmaps.  
> >
> > I think reusing new netlink ethtool with a special flag would be a nice,
> > complete solution.  We could also address link settings this way (which
> > are a pre-requisite for WoL).
> >
> > I have no strong preference on the mechanism, but for ease of setting
> > as well as dumping would it be workable to use a nesting, like this:
> >
> > Run time settings:
> >   [ETHTOOL_SETTINGS_BLA]
> >     [ETHTOOL_BLA_VAL_1]
> >     [ETHTOOL_BLA_VAL_2]
> >     ...
> >
> > Persistent:
> >   [ETHTOOL_PERSISTENT]
> >     [ETHTOOL_SETTINGS_BLA]
> >       [ETHTOOL_BLA_VAL_1]
> >       [ETHTOOL_BLA_VAL_2]
> >
> > IOW encapsulate settings into a "persistent" attribute?  
> Not sure if current devlink framework allows to encapsulate additional
> settings now.
> But we can think of extending it to support this when there is a requirement.

To be clear the question was to Michal and about ethtool netlink, where
this configuration belongs.
Michal Kubecek Jan. 27, 2019, 11:07 p.m. UTC | #6
On Tue, Jan 22, 2019 at 02:18:42PM -0800, Jakub Kicinski wrote:
> 
> I think reusing new netlink ethtool with a special flag would be a nice,
> complete solution.  We could also address link settings this way (which
> are a pre-requisite for WoL).
> 
> I have no strong preference on the mechanism, but for ease of setting
> as well as dumping would it be workable to use a nesting, like this:
> 
> Run time settings:
>   [ETHTOOL_SETTINGS_BLA]
>     [ETHTOOL_BLA_VAL_1]
>     [ETHTOOL_BLA_VAL_2]
>     ...
> 
> Persistent:
>   [ETHTOOL_PERSISTENT]
>     [ETHTOOL_SETTINGS_BLA]
>       [ETHTOOL_BLA_VAL_1]
>       [ETHTOOL_BLA_VAL_2]
> 
> IOW encapsulate settings into a "persistent" attribute?
> 
> How does that look to you, Michal?

It's certainly one of the options worth considering. What I like is that
this approach would not require knowing (or rather guessing) which
attributes are going to allow persistent settings in the future.

Michal
David Miller Jan. 28, 2019, 3:45 a.m. UTC | #7
From: Michal Kubecek <mkubecek@suse.cz>
Date: Mon, 28 Jan 2019 00:07:30 +0100

> What I like is that this approach would not require knowing (or
> rather guessing) which attributes are going to allow persistent
> settings in the future.

+1
Vasundhara Volam Feb. 4, 2019, 6:55 a.m. UTC | #8
On Wed, Jan 23, 2019 at 3:48 AM Jakub Kicinski
<jakub.kicinski@netronome.com> wrote:
>
> On Fri, 18 Jan 2019 15:33:19 +0100, Michal Kubecek wrote:
> > On Fri, Jan 18, 2019 at 12:39:37PM +0530, Vasundhara Volam wrote:
> > > There is difference of opinion on adding WOL parameter to devlink, between
> > > Jakub Kicinski and Michael Chan.
> > >
> > > Quote from Jakud Kicinski:
> > > ********
> > > As explained previously I think it's a very bad idea to add existing
> > > configuration options to devlink, just because devlink has the ability
> > > to persist the setting in NVM.  Especially that for WoL you have to get
> > > the link up so you potentially have all link config stuff as well.  And
> > > that n-tuple filters are one of the WoL options, meaning we'd need the
> > > ability to persist n-tuple filters via devlink.
> > >
> > > The effort would be far better spent helping with migrating ethtool to
> > > netlink, and allowing persisting there.
> > >
> > > I have not heard any reason why devlink is a better fit.  I can imagine
> > > you're just doing it here because it's less effort for you since
> > > ethtool is not yet migrated.
> > > ********
> > >
> > > Quote from Michael Chan:
> > > ********
> > > The devlink's WoL parameter is a persistent WoL parameter stored in the
> > > NIC's NVRAM. It is different from ethtool's WoL parameter in a number of
> > > ways. ethtool WoL is not persistent over AC power cycle and is considered
> > > OS-present WoL. As such, ethtool WoL can use a more sophisticated pattern
> > > including n-tuple with IP address in addition to the more basic types
> > > (e.g. magic packet). Whereas OS-absent power up WoL should only include
> > > magic packet and other simple types.
> >
> > If I understand correctly, it's that way now. I'm not sure there is a
> > technical reason preventing more complex WoL types in the OS-absent case
> > in the future. Also, even with traditional ethtool WoL setting, most
> > NICs only support some of the types (I'm not sure if there is a NIC
> > which would support all of them.)
> >
> > > The devlink WoL setting does not have to match the ethtool WoL
> > > setting.
> >
> > IMHO this is not really a problem. We can either use an additional flag
> > telling kernel/driver if we are setting runtime or persistent WoL mask
> > or we can pass (up to) two bitmaps.
Jakub, I will add another two bitmask parameters for WoL named as
wake_on_lan_runtime
and wake_on_lan_persistent. This will give information about what
types are runtime and
what types are persistent, does the device support for any given WoL types.

Does that sound good?
>
> I think reusing new netlink ethtool with a special flag would be a nice,
> complete solution.  We could also address link settings this way (which
> are a pre-requisite for WoL).
>
> I have no strong preference on the mechanism, but for ease of setting
> as well as dumping would it be workable to use a nesting, like this:
>
> Run time settings:
>   [ETHTOOL_SETTINGS_BLA]
>     [ETHTOOL_BLA_VAL_1]
>     [ETHTOOL_BLA_VAL_2]
>     ...
>
> Persistent:
>   [ETHTOOL_PERSISTENT]
>     [ETHTOOL_SETTINGS_BLA]
>       [ETHTOOL_BLA_VAL_1]
>       [ETHTOOL_BLA_VAL_2]
>
> IOW encapsulate settings into a "persistent" attribute?
>
> How does that look to you, Michal?
>
> > > The card will autoneg up to the speed supported by Vaux so no special
> > > devlink link setting is needed.
> > > ********
> >
> > Like Jakub, I'm not convinced there is a strong technical reason to have
> > each of the WoL settings handled through a different interface. I don't
> > say, though, that ethtool is necessarily the right one. If there is
> > a consensus that it better fits into devlink, I can imagine that both
> > could be accessible through devlink (for start, in drivers which choose
> > so, e.g. because they want to implement the persistent setting).
> >
> > Michal Kubecek
Jakub Kicinski Feb. 5, 2019, 2:56 a.m. UTC | #9
On Mon, 4 Feb 2019 12:25:13 +0530, Vasundhara Volam wrote:
> > > IMHO this is not really a problem. We can either use an additional flag
> > > telling kernel/driver if we are setting runtime or persistent WoL mask
> > > or we can pass (up to) two bitmaps.  
> Jakub, I will add another two bitmask parameters for WoL named as
> wake_on_lan_runtime
> and wake_on_lan_persistent. This will give information about what
> types are runtime and
> what types are persistent, does the device support for any given WoL types.
> 
> Does that sound good?

No?  We were talking about using the soon-too-come ethtool netlink
API with additional indication that given configuration request is
supposed to be persisted.  Adding more devlink parameters is exactly 
the opposite of what you should be doing.
Vasundhara Volam Feb. 5, 2019, 4:23 a.m. UTC | #10
On Tue, Feb 5, 2019 at 8:26 AM Jakub Kicinski
<jakub.kicinski@netronome.com> wrote:
>
> On Mon, 4 Feb 2019 12:25:13 +0530, Vasundhara Volam wrote:
> > > > IMHO this is not really a problem. We can either use an additional flag
> > > > telling kernel/driver if we are setting runtime or persistent WoL mask
> > > > or we can pass (up to) two bitmaps.
> > Jakub, I will add another two bitmask parameters for WoL named as
> > wake_on_lan_runtime
> > and wake_on_lan_persistent. This will give information about what
> > types are runtime and
> > what types are persistent, does the device support for any given WoL types.
> >
> > Does that sound good?
>
> No?  We were talking about using the soon-too-come ethtool netlink
> API with additional indication that given configuration request is
> supposed to be persisted.  Adding more devlink parameters is exactly
> the opposite of what you should be doing.
Okay. So, till then can we have the devlink wake_on_lan parameter or
you want this to be removed? Could you please clarify?

Once ethtool netlink API is available with persisted support, I can remove
this wake_on_lan parameter from devlink. Thanks.
Michal Kubecek Feb. 5, 2019, 4:51 p.m. UTC | #11
On Tue, Feb 05, 2019 at 09:53:26AM +0530, Vasundhara Volam wrote:
> On Tue, Feb 5, 2019 at 8:26 AM Jakub Kicinski
> >
> > No?  We were talking about using the soon-too-come ethtool netlink
> > API with additional indication that given configuration request is
> > supposed to be persisted.  Adding more devlink parameters is exactly
> > the opposite of what you should be doing.
> 
> Okay. So, till then can we have the devlink wake_on_lan parameter or
> you want this to be removed? Could you please clarify?
> 
> Once ethtool netlink API is available with persisted support, I can remove
> this wake_on_lan parameter from devlink. Thanks.

Once you provide an interface for userspace and applications start using
it, it's hard to get rid of it. As an extreme example, the legacy ioctl
interface used by ifconfig has been declared obsolete since kernel 2.2.0
(January 1999, i.e. 20 years ago) and we still have to maintain it.

Michal Kubecek
Vasundhara Volam Feb. 6, 2019, 10:13 a.m. UTC | #12
On Tue, Feb 5, 2019 at 10:21 PM Michal Kubecek <mkubecek@suse.cz> wrote:
>
> On Tue, Feb 05, 2019 at 09:53:26AM +0530, Vasundhara Volam wrote:
> > On Tue, Feb 5, 2019 at 8:26 AM Jakub Kicinski
> > >
> > > No?  We were talking about using the soon-too-come ethtool netlink
> > > API with additional indication that given configuration request is
> > > supposed to be persisted.  Adding more devlink parameters is exactly
> > > the opposite of what you should be doing.
> >
> > Okay. So, till then can we have the devlink wake_on_lan parameter or
> > you want this to be removed? Could you please clarify?
> >
> > Once ethtool netlink API is available with persisted support, I can remove
> > this wake_on_lan parameter from devlink. Thanks.
>
> Once you provide an interface for userspace and applications start using
> it, it's hard to get rid of it. As an extreme example, the legacy ioctl
> interface used by ifconfig has been declared obsolete since kernel 2.2.0
> (January 1999, i.e. 20 years ago) and we still have to maintain it.
>
Okay Got it. I will revert only the wake_on_lan parameter and send the patch.
We will wait for soon-too-come ethtool netlink API.

Thank you.
> Michal Kubecek