public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Justin Lai <justinlai0215@realtek•com>
To: Jakub Kicinski <kuba@kernel•org>
Cc: "davem@davemloft•net" <davem@davemloft•net>,
	"edumazet@google•com" <edumazet@google•com>,
	"pabeni@redhat•com" <pabeni@redhat•com>,
	"linux-kernel@vger•kernel.org" <linux-kernel@vger•kernel.org>,
	"netdev@vger•kernel.org" <netdev@vger•kernel.org>,
	"andrew@lunn•ch" <andrew@lunn•ch>,
	"jiri@resnulli•us" <jiri@resnulli•us>,
	"horms@kernel•org" <horms@kernel•org>,
	"rkannoth@marvell•com" <rkannoth@marvell•com>,
	"jdamato@fastly•com" <jdamato@fastly•com>,
	Ping-Ke Shih <pkshih@realtek•com>,
	Larry Chiu <larry.chiu@realtek•com>
Subject: RE: [PATCH net-next v27 10/13] rtase: Implement ethtool function
Date: Fri, 16 Aug 2024 06:44:17 +0000	[thread overview]
Message-ID: <ff91f4dd147f4493bd25a16c641f1806@realtek.com> (raw)
In-Reply-To: <20240815184635.4c074130@kernel.org>

> On Mon, 12 Aug 2024 14:35:36 +0800 Justin Lai wrote:
> > +static void rtase_get_drvinfo(struct net_device *dev,
> > +                           struct ethtool_drvinfo *info) {
> > +     const struct rtase_private *tp = netdev_priv(dev);
> > +
> > +     strscpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
> > +     strscpy(info->bus_info, pci_name(tp->pdev),
> > +sizeof(info->bus_info)); }
> 
> This shouldn't be necessary, can you delete this function from the driver and
> check if the output of ethtool -i changes?
> ethtool_get_drvinfo() should fill this in for you.

Thank you for your response. As you mentioned, ethtool_get_drvinfo()
will indeed populate the relevant information. I will remove
rtase_get_drvinfo().

> 
> > +static void rtase_get_pauseparam(struct net_device *dev,
> > +                              struct ethtool_pauseparam *pause) {
> > +     const struct rtase_private *tp = netdev_priv(dev);
> > +     u16 value = rtase_r16(tp, RTASE_CPLUS_CMD);
> > +
> > +     pause->autoneg = AUTONEG_DISABLE;
> > +
> > +     if ((value & (RTASE_FORCE_TXFLOW_EN |
> RTASE_FORCE_RXFLOW_EN)) ==
> > +         (RTASE_FORCE_TXFLOW_EN | RTASE_FORCE_RXFLOW_EN)) {
> > +             pause->rx_pause = 1;
> > +             pause->tx_pause = 1;
> > +     } else if (value & RTASE_FORCE_TXFLOW_EN) {
> > +             pause->tx_pause = 1;
> > +     } else if (value & RTASE_FORCE_RXFLOW_EN) {
> > +             pause->rx_pause = 1;
> > +     }
> 
> This 3 if statements can be replaced with just two lines:
> 
>         pause->rx_pause = !!(value & RTASE_FORCE_RXFLOW_EN);
>         pause->tx_pause = !!(value & RTASE_FORCE_TXFLOW_EN);

Ok, I will modify it.

Thanks
Justin

  reply	other threads:[~2024-08-16  6:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-12  6:35 [PATCH net-next v27 00/13] Add Realtek automotive PCIe driver Justin Lai
2024-08-12  6:35 ` [PATCH net-next v27 01/13] rtase: Add support for a pci table in this module Justin Lai
2024-08-12  6:35 ` [PATCH net-next v27 02/13] rtase: Implement the .ndo_open function Justin Lai
2024-08-12  6:35 ` [PATCH net-next v27 03/13] rtase: Implement the rtase_down function Justin Lai
2024-08-12  6:35 ` [PATCH net-next v27 04/13] rtase: Implement the interrupt routine and rtase_poll Justin Lai
2024-08-12  6:35 ` [PATCH net-next v27 05/13] rtase: Implement hardware configuration function Justin Lai
2024-08-12  6:35 ` [PATCH net-next v27 06/13] rtase: Implement .ndo_start_xmit function Justin Lai
2024-08-12  6:35 ` [PATCH net-next v27 07/13] rtase: Implement a function to receive packets Justin Lai
2024-08-16  1:54   ` Jakub Kicinski
2024-08-16  7:50     ` Justin Lai
2024-08-20  5:13     ` Larry Chiu
2024-08-20 14:41       ` Jakub Kicinski
2024-08-21  9:02         ` Larry Chiu
2024-08-21 22:21           ` Jakub Kicinski
2024-08-12  6:35 ` [PATCH net-next v27 08/13] rtase: Implement net_device_ops Justin Lai
2024-08-12  6:35 ` [PATCH net-next v27 09/13] rtase: Implement pci_driver suspend and resume function Justin Lai
2024-08-12  6:35 ` [PATCH net-next v27 10/13] rtase: Implement ethtool function Justin Lai
2024-08-16  1:46   ` Jakub Kicinski
2024-08-16  6:44     ` Justin Lai [this message]
2024-08-12  6:35 ` [PATCH net-next v27 11/13] rtase: Add a Makefile in the rtase folder Justin Lai
2024-08-12  6:35 ` [PATCH net-next v27 12/13] realtek: Update the Makefile and Kconfig in the realtek folder Justin Lai
2024-08-12  6:35 ` [PATCH net-next v27 13/13] MAINTAINERS: Add the rtase ethernet driver entry Justin Lai

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=ff91f4dd147f4493bd25a16c641f1806@realtek.com \
    --to=justinlai0215@realtek$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=horms@kernel$(echo .)org \
    --cc=jdamato@fastly$(echo .)com \
    --cc=jiri@resnulli$(echo .)us \
    --cc=kuba@kernel$(echo .)org \
    --cc=larry.chiu@realtek$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=pkshih@realtek$(echo .)com \
    --cc=rkannoth@marvell$(echo .)com \
    /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