[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ff91f4dd147f4493bd25a16c641f1806@realtek.com>
Date: Fri, 16 Aug 2024 06:44:17 +0000
From: Justin Lai <justinlai0215@...ltek.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com"
<edumazet@...gle.com>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"andrew@...n.ch"
<andrew@...n.ch>,
"jiri@...nulli.us" <jiri@...nulli.us>,
"horms@...nel.org"
<horms@...nel.org>,
"rkannoth@...vell.com" <rkannoth@...vell.com>,
"jdamato@...tly.com" <jdamato@...tly.com>,
Ping-Ke Shih <pkshih@...ltek.com>, Larry Chiu <larry.chiu@...ltek.com>
Subject: RE: [PATCH net-next v27 10/13] rtase: Implement ethtool function
> 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
Powered by blists - more mailing lists