netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Simon Horman <simon.horman@corigine.com>
Cc: David Miller <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, oss-drivers@corigine.com,
	Yu Xiao <yu.xiao@corigine.com>,
	Louis Peens <louis.peens@corigine.com>
Subject: Re: [PATCH net-next] nfp: ethtool: support reporting link modes
Date: Mon, 21 Nov 2022 20:26:52 -0800	[thread overview]
Message-ID: <20221121202652.57f0b901@kernel.org> (raw)
In-Reply-To: <20221121112045.862295-1-simon.horman@corigine.com>

On Mon, 21 Nov 2022 12:20:45 +0100 Simon Horman wrote:
> From: Yu Xiao <yu.xiao@corigine.com>
> 
> Add support for reporting link modes,
> including `Supported link modes` and `Advertised link modes`,
> via ethtool $DEV.
> 
> A new command `SPCODE_READ_MEDIA` is added to read info from
> management firmware. Also, the mapping table `nfp_eth_media_table`
> associates the link modes between NFP and kernel. Both of them
> help to support this ability.

> +static void nfp_add_media_link_mode(struct nfp_port *port,
> +				    struct nfp_eth_table_port *eth_port,
> +				    struct ethtool_link_ksettings *cmd)
> +{
> +	struct nfp_eth_media_buf ethm = {.eth_index = eth_port->eth_index};

nit: spaces, comma at the end

> +	struct nfp_cpp *cpp = port->app->cpp;
> +	u8 i;

nit: int or uint, don't pointlessly limit the size of iterators

> +struct nfp_eth_media_buf {
> +	u8 eth_index;
> +	u8 reserved[7];
> +	DECLARE_BITMAP(supported_modes, NFP_NSP_MAX_MODE_SIZE);
> +	DECLARE_BITMAP(advertised_modes, NFP_NSP_MAX_MODE_SIZE);

You can't use DECLATE_BITMAP() in FW APIs. unsigned long will have
different layout depending on word side and endian.

> +int nfp_eth_read_media(struct nfp_cpp *cpp, struct nfp_eth_media_buf *ethm)
> +{
> +	struct nfp_nsp *nsp;
> +	int err;

nit: you use your ret for variables which are returned both 
     on the success and failure paths.


  parent reply	other threads:[~2022-11-22  4:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 11:20 [PATCH net-next] nfp: ethtool: support reporting link modes Simon Horman
2022-11-22  0:51 ` Andrew Lunn
2022-11-22  2:10   ` Yinjun Zhang
2022-11-22  4:26 ` Jakub Kicinski [this message]
2022-11-22 16:47 ` Alexander Lobakin

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=20221121202652.57f0b901@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=louis.peens@corigine.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@corigine.com \
    --cc=pabeni@redhat.com \
    --cc=simon.horman@corigine.com \
    --cc=yu.xiao@corigine.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).