summaryrefslogtreecommitdiff
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2022-06-28 11:51:52 +0300
committerJakub Kicinski <kuba@kernel.org>2022-06-30 06:17:11 +0300
commit3d410403a572766628947754e2f62c29bcbf9035 (patch)
tree77db4664c1a15bb6b598f7557fa54f2b18bc5f64 /net/dsa/slave.c
parent702e70143291b09e6245deb8ab904d1c18ed4f47 (diff)
downloadlinux-3d410403a572766628947754e2f62c29bcbf9035.tar.xz
net: dsa: add get_pause_stats support
Add support for pause stats Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r--net/dsa/slave.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 760ca58307a3..ad6a6663feeb 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1109,6 +1109,16 @@ static int dsa_slave_set_link_ksettings(struct net_device *dev,
return phylink_ethtool_ksettings_set(dp->pl, cmd);
}
+static void dsa_slave_get_pause_stats(struct net_device *dev,
+ struct ethtool_pause_stats *pause_stats)
+{
+ struct dsa_port *dp = dsa_slave_to_port(dev);
+ struct dsa_switch *ds = dp->ds;
+
+ if (ds->ops->get_pause_stats)
+ ds->ops->get_pause_stats(ds, dp->index, pause_stats);
+}
+
static void dsa_slave_get_pauseparam(struct net_device *dev,
struct ethtool_pauseparam *pause)
{
@@ -2100,6 +2110,7 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = {
.get_eee = dsa_slave_get_eee,
.get_link_ksettings = dsa_slave_get_link_ksettings,
.set_link_ksettings = dsa_slave_set_link_ksettings,
+ .get_pause_stats = dsa_slave_get_pause_stats,
.get_pauseparam = dsa_slave_get_pauseparam,
.set_pauseparam = dsa_slave_set_pauseparam,
.get_rxnfc = dsa_slave_get_rxnfc,