From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 078F1C49EA6 for ; Sat, 26 Jun 2021 14:38:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6E6A61C30 for ; Sat, 26 Jun 2021 14:38:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230064AbhFZOlR (ORCPT ); Sat, 26 Jun 2021 10:41:17 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:56982 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbhFZOlP (ORCPT ); Sat, 26 Jun 2021 10:41:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=Lp48kfF78w3pyeDPlT6JtePXbX+mrDANUfVxDqDs4RI=; b=zRBxUeDMnlbUSnbVkYUXmhyb9o lpGjx5sN4iEW6LAD4aNV1Trk0dUhPWI1PGUOesB6bMXLXbbDkzhZ1frSTyJSGkCWFUrp3TDnSQX36 H9s10qGTvyolt9dlsH0Op/ugPXSgNFLGIYBP1BmUAcFRvc2IlSP92NcrzReqwPr18Cq0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1lx9SJ-00BE7l-Hg; Sat, 26 Jun 2021 16:38:47 +0200 Date: Sat, 26 Jun 2021 16:38:47 +0200 From: Andrew Lunn To: David Thompson Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, limings@nvidia.com, Asmaa Mnebhi Subject: Re: [PATCH net-next v8] Add Mellanox BlueField Gigabit Ethernet driver Message-ID: References: <20210625011146.18237-1-davthompson@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210625011146.18237-1-davthompson@nvidia.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > +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