public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn•ch>
To: David Thompson <davthompson@nvidia•com>
Cc: davem@davemloft•net, kuba@kernel•org, netdev@vger•kernel.org,
	limings@nvidia•com, Asmaa Mnebhi <asmaa@nvidia•com>
Subject: Re: [PATCH net-next v8] Add Mellanox BlueField Gigabit Ethernet driver
Date: Sat, 26 Jun 2021 16:38:47 +0200	[thread overview]
Message-ID: <YNc790LXRWjFmT21@lunn.ch> (raw)
In-Reply-To: <20210625011146.18237-1-davthompson@nvidia.com>

> +static void mlxbf_gige_get_regs(struct net_device *netdev,
> +				struct ethtool_regs *regs, void *p)
> +{
> +	struct mlxbf_gige *priv = netdev_priv(netdev);
> +
> +	regs->version = MLXBF_GIGE_REGS_VERSION;
> +
> +	/* Read entire MMIO register space and store results
> +	 * into the provided buffer. Each 64-bit word is converted
> +	 * to big-endian to make the output more readable.
> +	 *
> +	 * NOTE: by design, a read to an offset without an existing
> +	 *       register will be acknowledged and return zero.
> +	 */
> +	memcpy_fromio(p, priv->base, MLXBF_GIGE_MMIO_REG_SZ);

Is the big-endian comment correct? memcpy_fromio() appears to be
native endian.

> +static int mlxbf_gige_do_ioctl(struct net_device *netdev,
> +			       struct ifreq *ifr, int cmd)
> +{
> +	if (!(netif_running(netdev)))
> +		return -EINVAL;
> +
> +	return phy_mii_ioctl(netdev->phydev, ifr, cmd);
> +}

You could use phy_do_ioctl_running() here.

For the MDIO, PHY and ethtool parts:

Reviewed-by: Andrew Lunn <andrew@lunn•ch>

    Andrew

      reply	other threads:[~2021-06-26 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-25  1:11 [PATCH net-next v8] Add Mellanox BlueField Gigabit Ethernet driver David Thompson
2021-06-26 14:38 ` Andrew Lunn [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=YNc790LXRWjFmT21@lunn.ch \
    --to=andrew@lunn$(echo .)ch \
    --cc=asmaa@nvidia$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=davthompson@nvidia$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=limings@nvidia$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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