From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next v2 RFC 7/8] devlink: Add a generic port parameter Date: Thu, 13 Dec 2018 13:56:04 +0100 Message-ID: <20181213125604.GB2177@nanopsycho> References: <1544518008-15289-1-git-send-email-vasundhara-v.volam@broadcom.com> <1544518008-15289-8-git-send-email-vasundhara-v.volam@broadcom.com> <20181212091534.GC21324@unicorn.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: mkubecek@suse.cz, David Miller , "michael.chan@broadcom.com" , Jiri Pirko , jakub.kicinski@netronome.com, Netdev To: Vasundhara Volam Return-path: Received: from mail-wr1-f67.google.com ([209.85.221.67]:46649 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729175AbeLMNDa (ORCPT ); Thu, 13 Dec 2018 08:03:30 -0500 Received: by mail-wr1-f67.google.com with SMTP id l9so1900077wrt.13 for ; Thu, 13 Dec 2018 05:03:29 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Wed, Dec 12, 2018 at 01:30:23PM CET, vasundhara-v.volam@broadcom.com wrote: >On Wed, Dec 12, 2018 at 2:45 PM Michal Kubecek wrote: >> >> On Tue, Dec 11, 2018 at 02:16:47PM +0530, Vasundhara Volam wrote: >> > wake-on-lan - Enables Wake on Lan for this port. If enabled, >> > the controller asserts a wake pin based on the wake-on-lan type. >> > >> > Cc: Jiri Pirko >> > Signed-off-by: Vasundhara Volam >> > --- >> > include/net/devlink.h | 16 ++++++++++++++++ >> > net/core/devlink.c | 5 +++++ >> > 2 files changed, 21 insertions(+) >> > >> > diff --git a/include/net/devlink.h b/include/net/devlink.h >> > index db413d3..93a1030 100644 >> > --- a/include/net/devlink.h >> > +++ b/include/net/devlink.h >> > @@ -367,12 +367,25 @@ enum devlink_param_generic_id { >> > DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MAX, >> > DEVLINK_PARAM_GENERIC_ID_MSIX_VEC_PER_PF_MIN, >> > DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY, >> > + DEVLINK_PARAM_GENERIC_ID_WOL, >> > >> > /* add new param generic ids above here*/ >> > __DEVLINK_PARAM_GENERIC_ID_MAX, >> > DEVLINK_PARAM_GENERIC_ID_MAX = __DEVLINK_PARAM_GENERIC_ID_MAX - 1, >> > }; >> > >> > +enum devlink_param_wol_types { >> > + DEVLINK_PARAM_WOL_DISABLE = 0, >> > + DEVLINK_PARAM_WOL_MAGIC_PKT, >> > + DEVLINK_PARAM_WOL_PHY, >> > + DEVLINK_PARAM_WOL_UNICAST, >> > + DEVLINK_PARAM_WOL_MULTICAST, >> > + DEVLINK_PARAM_WOL_BROADCAST, >> > + DEVLINK_PARAM_WOL_ARP, >> > + DEVLINK_PARAM_WOL_SECURE, >> > + DEVLINK_PARAM_WOL_FILTERS, >> > +}; >> > + >> > #define DEVLINK_PARAM_GENERIC_INT_ERR_RESET_NAME "internal_error_reset" >> > #define DEVLINK_PARAM_GENERIC_INT_ERR_RESET_TYPE DEVLINK_PARAM_TYPE_BOOL >> > >> > @@ -397,6 +410,9 @@ enum devlink_param_generic_id { >> > #define DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_NAME "fw_load_policy" >> > #define DEVLINK_PARAM_GENERIC_FW_LOAD_POLICY_TYPE DEVLINK_PARAM_TYPE_U8 >> > >> > +#define DEVLINK_PARAM_GENERIC_WOL_NAME "wake-on-lan" >> >> Nitpick: the other two parameter names use underscores, it would be more >> consistent to use them as well. >Sure, I will fix this in next version. Thanks. >> >> > +#define DEVLINK_PARAM_GENERIC_WOL_TYPE DEVLINK_PARAM_TYPE_U8 >> >> Can you be sure it will be always sufficient to enable only one WoL type >> unlike in ethtool where bitfield is used so that you can enable multiple >> types? >Since this is a persistent setting, NIC may not support multiple types >of WOL upon power on. >If there is any requirement in future to add multiple types, data type >can be modified, It can't. It will become a UAPI. You need to prepare now. >as other WOL types are also not added now. >> >> Michal Kubecek