Messages in this thread | | | From | Wei Fang <> | Subject | RE: [EXT] [PATCH net-next] net: enetc: add ethtool::get_channels support | Date | Thu, 23 Nov 2023 01:49:48 +0000 |
| |
> -----Original Message----- > From: Suman Ghosh <sumang@marvell.com> > Sent: 2023年11月22日 18:50 > To: Wei Fang <wei.fang@nxp.com>; davem@davemloft.net; > edumazet@google.com; kuba@kernel.org; pabeni@redhat.com; Claudiu > Manoil <claudiu.manoil@nxp.com>; Vladimir Oltean > <vladimir.oltean@nxp.com>; netdev@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Subject: RE: [EXT] [PATCH net-next] net: enetc: add ethtool::get_channels > support > > >Subject: [EXT] [PATCH net-next] net: enetc: add ethtool::get_channels > >support > > > >External Email > > > >---------------------------------------------------------------------- > >Since ETHTOOL_MSG_RSS_GET netlink message [1] has been applied to > >ethtool tree, there is a netlink error when using "ethtool -x eno0" > >command to get RSS information from fsl-enetc driver, and the user > >cannot get the information, the error logs are as follows: > > > >root@ls1028ardb:~# ./ethtool -x eno0 > >netlink error: Operation not supported > > > >The rationale is that ethtool will issue a ETHTOOL_MSG_CHANNELS_GET > >netlink message to get the number of Rx ring. However, the fsl-enetc > >driver doesn't support ethtool::get_channels, so it directly returns - > >EOPNOTSUPP error. > > > >[1]: > >https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furlde > >fense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttps-&data=05%7C01%7Cwei.f > ang%40 > >nxp.com%7Ccb29522a88634f39882d08dbeb48c6b0%7C686ea1d3bc2b4c6fa > 92cd99c5c > >301635%7C0%7C0%7C638362470026457333%7CUnknown%7CTWFpbGZsb3 > d8eyJWIjoiMC4 > >wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000% > 7C%7C%7C > >&sdata=j8g%2Filjj0mneiVEbRln1QpxFtBbudmQDfzqBqyfP9%2BY%3D&reserv > ed=0 > >3A__git.kernel.org_pub_scm_linux_kernel_git_jkirsher_ethtool.git_commit > >_ > >-3Fid- > >3Dffab99c1f3820e21d65686e030dcf2c4fd0a8bd0&d=DwIDAg&c=nKjWec2b > 6R0mOyPaz > >7 > >xtfQ&r=7si3Xn9Ly-Se1a655kvEPIYU0nQ9HPeN280sEUv5ROU&m=- > >6bW3FaCKau7jio6XSUWDZw3IEqdetIwhU_Bgcv87QcnjyMDGD0slJGQYFlbVx7 > l&s=8vMev > >Y UEvNkyCjMDO278j67ir4daMquk6QK9wR65NSQ&e= > > > >Signed-off-by: Wei Fang <wei.fang@nxp.com> > >--- > > .../net/ethernet/freescale/enetc/enetc_ethtool.c | 13 +++++++++++++ > > 1 file changed, 13 insertions(+) > > > >diff --git a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c > >b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c > >index e993ed04ab57..5fa1000b9b83 100644 > >--- a/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c > >+++ b/drivers/net/ethernet/freescale/enetc/enetc_ethtool.c > >@@ -740,6 +740,17 @@ static int enetc_set_rxfh(struct net_device *ndev, > >const u32 *indir, > > return err; > > } > > > >+static void enetc_get_channels(struct net_device *ndev, > >+ struct ethtool_channels *ch) { > >+ struct enetc_ndev_priv *priv = netdev_priv(ndev); > >+ > >+ ch->max_rx = priv->num_rx_rings; > >+ ch->max_tx = priv->num_tx_rings; > >+ ch->rx_count = priv->num_rx_rings; > >+ ch->tx_count = priv->num_tx_rings; > [Suman] max_rx/tx and rx/tx_count can be different right? To me it seems like > max_rx/tx should read the max value not the current configured values.
[Wei] Yes, but the current fsl-enetc driver doesn't support to dynamically configure the number of tx/rx rings, so even we have more available rings than priv->num_rx_rings, we can only the use priv->num_rx_rings rings. So I make the max_rx = rx_count.
| |