diff mbox series

[ethtool,v2,1/5] ethtool: Extend ethtool link modes settings uAPI with lanes

Message ID 20210202182513.325864-2-danieller@nvidia.com (mailing list archive)
State Superseded
Delegated to: Michal Kubecek
Headers show
Series Extend uAPI with lanes parameter | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Danielle Ratson Feb. 2, 2021, 6:25 p.m. UTC
Add ETHTOOL_A_LINKMODES_LANES, expand ethtool_link_settings with
lanes attribute and define valid lanes in order to support a new
lanes-selector.

Signed-off-by: Danielle Ratson <danieller@nvidia.com>
---

Notes:
    v2:
    	* Update headers after changes in upstream patches.

 netlink/desc-ethtool.c       | 1 +
 uapi/linux/ethtool_netlink.h | 1 +
 2 files changed, 2 insertions(+)

Comments

Michal Kubecek Feb. 9, 2021, 7:40 p.m. UTC | #1
On Tue, Feb 02, 2021 at 08:25:09PM +0200, Danielle Ratson wrote:
> Add ETHTOOL_A_LINKMODES_LANES, expand ethtool_link_settings with
> lanes attribute and define valid lanes in order to support a new
> lanes-selector.
> 
> Signed-off-by: Danielle Ratson <danieller@nvidia.com>
> ---

When updating the UAPI header copies, please do it in a separate commit
which updates the whole uapi/ subdirectory to the state of a specific
kernel commit. You can use the script at

  https://www.kernel.org/pub/software/network/ethtool/ethtool-import-uapi

It expects the LINUX_GIT environment variable to point to your local git
repository with kernel tree and takes one argument identifying the
commit you want to import the uapi headers from (commit id, tag or
branch name can be used). In your case, net-next would be the most
likely choice.

Michal

> Notes:
>     v2:
>     	* Update headers after changes in upstream patches.
> 
>  netlink/desc-ethtool.c       | 1 +
>  uapi/linux/ethtool_netlink.h | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/netlink/desc-ethtool.c b/netlink/desc-ethtool.c
> index 96291b9..fe5d7ba 100644
> --- a/netlink/desc-ethtool.c
> +++ b/netlink/desc-ethtool.c
> @@ -87,6 +87,7 @@ static const struct pretty_nla_desc __linkmodes_desc[] = {
>  	NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_DUPLEX),
>  	NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG),
>  	NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE),
> +	NLATTR_DESC_U32(ETHTOOL_A_LINKMODES_LANES),
>  };
>  
>  static const struct pretty_nla_desc __linkstate_desc[] = {
> diff --git a/uapi/linux/ethtool_netlink.h b/uapi/linux/ethtool_netlink.h
> index c022883..0cd6906 100644
> --- a/uapi/linux/ethtool_netlink.h
> +++ b/uapi/linux/ethtool_netlink.h
> @@ -227,6 +227,7 @@ enum {
>  	ETHTOOL_A_LINKMODES_DUPLEX,		/* u8 */
>  	ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG,	/* u8 */
>  	ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE,	/* u8 */
> +	ETHTOOL_A_LINKMODES_LANES,		/* u32 */
>  
>  	/* add new constants above here */
>  	__ETHTOOL_A_LINKMODES_CNT,
> -- 
> 2.26.2
>
Danielle Ratson Feb. 10, 2021, 12:06 p.m. UTC | #2
> -----Original Message-----
> From: Michal Kubecek <mkubecek@suse.cz>
> Sent: Tuesday, February 9, 2021 9:40 PM
> To: Danielle Ratson <danieller@nvidia.com>
> Cc: netdev@vger.kernel.org; f.fainelli@gmail.com; kuba@kernel.org; andrew@lunn.ch; mlxsw <mlxsw@nvidia.com>
> Subject: Re: [PATCH ethtool v2 1/5] ethtool: Extend ethtool link modes settings uAPI with lanes
> 
> On Tue, Feb 02, 2021 at 08:25:09PM +0200, Danielle Ratson wrote:
> > Add ETHTOOL_A_LINKMODES_LANES, expand ethtool_link_settings with lanes
> > attribute and define valid lanes in order to support a new
> > lanes-selector.
> >
> > Signed-off-by: Danielle Ratson <danieller@nvidia.com>
> > ---
> 
> When updating the UAPI header copies, please do it in a separate commit which updates the whole uapi/ subdirectory to the state of
> a specific kernel commit. You can use the script at
> 
>   https://www.kernel.org/pub/software/network/ethtool/ethtool-import-uapi
> 
> It expects the LINUX_GIT environment variable to point to your local git repository with kernel tree and takes one argument
> identifying the commit you want to import the uapi headers from (commit id, tag or branch name can be used). In your case, net-next
> would be the most likely choice.
> 
> Michal

Should I use the commit in net-next that I added it uapi headers, or generally the last commit of net-next?

Thanks,
Danielle

> 
> > Notes:
> >     v2:
> >     	* Update headers after changes in upstream patches.
> >
> >  netlink/desc-ethtool.c       | 1 +
> >  uapi/linux/ethtool_netlink.h | 1 +
> >  2 files changed, 2 insertions(+)
> >
> > diff --git a/netlink/desc-ethtool.c b/netlink/desc-ethtool.c index
> > 96291b9..fe5d7ba 100644
> > --- a/netlink/desc-ethtool.c
> > +++ b/netlink/desc-ethtool.c
> > @@ -87,6 +87,7 @@ static const struct pretty_nla_desc __linkmodes_desc[] = {
> >  	NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_DUPLEX),
> >  	NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG),
> >  	NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE),
> > +	NLATTR_DESC_U32(ETHTOOL_A_LINKMODES_LANES),
> >  };
> >
> >  static const struct pretty_nla_desc __linkstate_desc[] = { diff --git
> > a/uapi/linux/ethtool_netlink.h b/uapi/linux/ethtool_netlink.h index
> > c022883..0cd6906 100644
> > --- a/uapi/linux/ethtool_netlink.h
> > +++ b/uapi/linux/ethtool_netlink.h
> > @@ -227,6 +227,7 @@ enum {
> >  	ETHTOOL_A_LINKMODES_DUPLEX,		/* u8 */
> >  	ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG,	/* u8 */
> >  	ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE,	/* u8 */
> > +	ETHTOOL_A_LINKMODES_LANES,		/* u32 */
> >
> >  	/* add new constants above here */
> >  	__ETHTOOL_A_LINKMODES_CNT,
> > --
> > 2.26.2
> >
Michal Kubecek Feb. 10, 2021, 12:19 p.m. UTC | #3
On Wed, Feb 10, 2021 at 12:06:04PM +0000, Danielle Ratson wrote:
> > When updating the UAPI header copies, please do it in a separate
> > commit which updates the whole uapi/ subdirectory to the state of a
> > specific kernel commit. You can use the script at
> > 
> >   https://www.kernel.org/pub/software/network/ethtool/ethtool-import-uapi
> > 
> > It expects the LINUX_GIT environment variable to point to your local
> > git repository with kernel tree and takes one argument identifying
> > the commit you want to import the uapi headers from (commit id, tag
> > or branch name can be used). In your case, net-next would be the
> > most likely choice.
> 
> Should I use the commit in net-next that I added it uapi headers, or
> generally the last commit of net-next?

That's up to you, I'm fine with either. The important point is to have
a consistent snapshot of all copied (and sanitized) uapi headers.

Michal
diff mbox series

Patch

diff --git a/netlink/desc-ethtool.c b/netlink/desc-ethtool.c
index 96291b9..fe5d7ba 100644
--- a/netlink/desc-ethtool.c
+++ b/netlink/desc-ethtool.c
@@ -87,6 +87,7 @@  static const struct pretty_nla_desc __linkmodes_desc[] = {
 	NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_DUPLEX),
 	NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG),
 	NLATTR_DESC_U8(ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE),
+	NLATTR_DESC_U32(ETHTOOL_A_LINKMODES_LANES),
 };
 
 static const struct pretty_nla_desc __linkstate_desc[] = {
diff --git a/uapi/linux/ethtool_netlink.h b/uapi/linux/ethtool_netlink.h
index c022883..0cd6906 100644
--- a/uapi/linux/ethtool_netlink.h
+++ b/uapi/linux/ethtool_netlink.h
@@ -227,6 +227,7 @@  enum {
 	ETHTOOL_A_LINKMODES_DUPLEX,		/* u8 */
 	ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG,	/* u8 */
 	ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE,	/* u8 */
+	ETHTOOL_A_LINKMODES_LANES,		/* u32 */
 
 	/* add new constants above here */
 	__ETHTOOL_A_LINKMODES_CNT,