]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
octeon_ep: Add support to retrieve hardware channel information
authorSathesh B Edara <sedara@marvell.com>
Thu, 25 Sep 2025 12:51:33 +0000 (05:51 -0700)
committerJakub Kicinski <kuba@kernel.org>
Sat, 27 Sep 2025 00:43:23 +0000 (17:43 -0700)
This patch introduces support for retrieving hardware channel
configuration through the ethtool interface.

Signed-off-by: Sathesh B Edara <sedara@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250925125134.22421-2-sedara@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeon_ep/octep_ethtool.c

index a88c006ea65b7121825021e4be052142f4e2d455..01c6c0a2f2838279bf72f76dc4a099fcdda02ae1 100644 (file)
@@ -437,6 +437,15 @@ 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_combined = CFG_GET_PORTS_MAX_IO_RINGS(oct->conf);
+       channel->combined_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 +454,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)