From: Sathesh B Edara <sedara@marvell.com>
To: <linux-kernel@vger.kernel.org>, <sburla@marvell.com>,
<vburru@marvell.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<netdev@vger.kernel.org>, <hgani@marvell.com>, <andrew@lunn.ch>,
<srasheed@marvell.com>
Cc: <sedara@marvell.com>, Andrew Lunn <andrew+netdev@lunn.ch>
Subject: [net-next PATCH v1 1/2] octeon_ep: Add support to retrieve hardware channel information
Date: Thu, 18 Sep 2025 07:48:57 -0700 [thread overview]
Message-ID: <20250918144858.29960-2-sedara@marvell.com> (raw)
In-Reply-To: <20250918144858.29960-1-sedara@marvell.com>
This patch introduces support for retrieving hardware channel
configuration through the ethtool interface.
Signed-off-by: Sathesh B Edara <sedara@marvell.com>
---
.../net/ethernet/marvell/octeon_ep/octep_ethtool.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_ethtool.c b/drivers/net/ethernet/marvell/octeon_ep/octep_ethtool.c
index a88c006ea65b..9d57e2da0b4b 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_ethtool.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_ethtool.c
@@ -437,6 +437,17 @@ static int octep_set_link_ksettings(struct net_device *netdev,
return 0;
}
+static void octep_get_channels(struct net_device *dev,
+ struct ethtool_channels *channel)
+{
+ struct octep_device *oct = netdev_priv(dev);
+
+ channel->max_rx = CFG_GET_PORTS_MAX_IO_RINGS(oct->conf);
+ channel->max_tx = CFG_GET_PORTS_MAX_IO_RINGS(oct->conf);
+ channel->rx_count = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
+ channel->tx_count = CFG_GET_PORTS_ACTIVE_IO_RINGS(oct->conf);
+}
+
static const struct ethtool_ops octep_ethtool_ops = {
.get_drvinfo = octep_get_drvinfo,
.get_link = ethtool_op_get_link,
@@ -445,6 +456,7 @@ static const struct ethtool_ops octep_ethtool_ops = {
.get_ethtool_stats = octep_get_ethtool_stats,
.get_link_ksettings = octep_get_link_ksettings,
.set_link_ksettings = octep_set_link_ksettings,
+ .get_channels = octep_get_channels,
};
void octep_set_ethtool_ops(struct net_device *netdev)
--
2.36.0
next prev parent reply other threads:[~2025-09-18 14:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 14:48 [net-next PATCH v1 0/2] " Sathesh B Edara
2025-09-18 14:48 ` Sathesh B Edara [this message]
2025-09-18 14:48 ` [net-next PATCH v1 2/2] octeon_ep_vf: " Sathesh B Edara
2025-09-18 15:15 ` [net-next PATCH v1 0/2] " Jakub Kicinski
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=20250918144858.29960-2-sedara@marvell.com \
--to=sedara@marvell.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hgani@marvell.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sburla@marvell.com \
--cc=srasheed@marvell.com \
--cc=vburru@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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
all inboxes | Powered by JetHome®