All of lore.kernel.org
 help / color / mirror / Atom feed
From: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Oleksij Rempel <o.rempel@pengutronix.de>
Subject: Re: [PATCH v4 ethtool-next 2/2] add support for IEEE 802.3cg-2019 Clause 148 - PLCA RS
Date: Thu, 2 Feb 2023 09:55:34 +0100	[thread overview]
Message-ID: <Y9t6hlh2eRHGyq5m@gvm01> (raw)
In-Reply-To: <20230201212845.t5qriiofktivtzse@lion.mk-sys.cz>

On Wed, Feb 01, 2023 at 10:28:45PM +0100, Michal Kubecek wrote:
> On Sat, Dec 17, 2022 at 01:50:39AM +0100, Piergiorgio Beruto wrote:
> > This patch adds support for the Physical Layer Collision Avoidance
> > Reconciliation Sublayer which was introduced in the IEEE 802.3
> > standard by the 802.3cg working group in 2019.
> > 
> > The ethtool interface has been extended as follows:
> > - show if the device supports PLCA when ethtool is invoked without FLAGS
> >    - additionally show what PLCA version is supported
> >    - show the current PLCA status
> > - add FLAGS for getting and setting the PLCA configuration
> > 
> > Signed-off-by: Piergiorgio Beruto <piergiorgio.beruto@gmail.com>
> > ---
> >  Makefile.am        |   1 +
> >  ethtool.c          |  21 ++++
> >  netlink/extapi.h   |   6 +
> >  netlink/plca.c     | 295 +++++++++++++++++++++++++++++++++++++++++++++
> >  netlink/settings.c |  86 ++++++++++++-
> 
> Please update also the manual page (ethtool.8.in), this should be done
> whenever adding a new feature so that documented and implemented
> features don't diverge.
I wrote the required text, please have a look and see it's ok!
> 
> [...]
> > diff --git a/netlink/extapi.h b/netlink/extapi.h
> > index 1bb580a889a8..0add156e644a 100644
> > --- a/netlink/extapi.h
> > +++ b/netlink/extapi.h
> [...]
> > @@ -114,6 +117,9 @@ nl_get_eeprom_page(struct cmd_context *ctx __maybe_unused,
> >  #define nl_getmodule		NULL
> >  #define nl_gmodule		NULL
> >  #define nl_smodule		NULL
> > +#define nl_get_plca_cfg		NULL
> > +#define nl_set_plca_cfg		NULL
> > +#define nl_get_plca_status	NULL
> >  
> >  #endif /* ETHTOOL_ENABLE_NETLINK */
> >  
> 
> The function names are misspelled here so that a build with
> --disable-netlink fails.
Ok, sorry about that. I've fixed the problem and tested with
--disable-netlink. Should be OK now.
> 
> [...]
> > diff --git a/netlink/plca.c b/netlink/plca.c
> > new file mode 100644
> > index 000000000000..f7d7bdbc5c84
> > --- /dev/null
> > +++ b/netlink/plca.c
> > @@ -0,0 +1,295 @@
> > +/*
> > + * plca.c - netlink implementation of plca command
> > + *
> > + * Implementation of "ethtool --show-plca <dev>" and
> > + * "ethtool --set-plca <dev> ..."
> > + */
> > +
> > +#include <errno.h>
> > +#include <string.h>
> > +#include <stdio.h>
> > +
> > +#include "../internal.h"
> > +#include "../common.h"
> > +#include "netlink.h"
> > +#include "bitset.h"
> > +#include "parser.h"
> > +
> > +/* PLCA_GET_CFG */
> [...]
> > +int plca_get_cfg_reply_cb(const struct nlmsghdr *nlhdr, void *data)
> > +{
> > +	const struct nlattr *tb[ETHTOOL_A_PLCA_MAX + 1] = {};
> > +	DECLARE_ATTR_TB_INFO(tb);
> > +	struct nl_context *nlctx = data;
> > +	bool silent;
> > +	int idv, val;
> > +	int err_ret;
> > +	int ret;
> [...]
> > +		// The node count is ignored by follower nodes. However, it can
> > +		// be pre-set to enable fast coordinator role switchover.
> > +		// Therefore, on a follower node we still wanto to show it,
> > +		// indicating it is not currently used.
> > +		if (tb[ETHTOOL_A_PLCA_NODE_ID] && idv != 0)
> > +			printf(" (ignored)");
> 
> The compiler warns that idv may be uninitialized here. While it's in
> wrong, AFAICS, not even gcc13 is smart enough to recognize that it's not
> actually possible so let's initialize the variable to make it happy.
> Also, both idv and val are used to store unsigned values so they should
> be unsigned int.
> 
> Other than these, the patch looks good to me. The next branch already
> has the UAPI updates needed for it so patch 1 won't be needed any more
> if you rebase on top of current next.
> 
> Michal
Thanks,
Piergiorgio

      reply	other threads:[~2023-02-02  8:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-17  0:50 [PATCH v4 ethtool-next 0/2] add support for PLCA RS Piergiorgio Beruto
2022-12-17  0:50 ` [PATCH v4 ethtool-next 1/2] update UAPI header copies Piergiorgio Beruto
2022-12-17  0:50 ` [PATCH v4 ethtool-next 2/2] add support for IEEE 802.3cg-2019 Clause 148 - PLCA RS Piergiorgio Beruto
2023-02-01 21:28   ` Michal Kubecek
2023-02-02  8:55     ` Piergiorgio Beruto [this message]

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=Y9t6hlh2eRHGyq5m@gvm01 \
    --to=piergiorgio.beruto@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.