]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
fbnic: Add support for setting/getting pause configuration
authorAlexander Duyck <alexanderduyck@fb.com>
Wed, 18 Jun 2025 22:08:09 +0000 (15:08 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 24 Jun 2025 07:31:46 +0000 (09:31 +0200)
Phylink already handles most of the pieces necessary for configuring
autonegotation. With that being the case we can add support for
getting/setting pause now by just passing through the ethtool call to the
phylink code.

Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/175028448974.625704.14427543910503058114.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c
drivers/net/ethernet/meta/fbnic/fbnic_netdev.h
drivers/net/ethernet/meta/fbnic/fbnic_phylink.c

index 7cb191155d795eb3a730e9eb86332b836b9221b7..7fe9983d3c0e51efc109677f26fd188adab82dce 100644 (file)
@@ -1688,6 +1688,8 @@ static const struct ethtool_ops fbnic_ethtool_ops = {
        .set_coalesce           = fbnic_set_coalesce,
        .get_ringparam          = fbnic_get_ringparam,
        .set_ringparam          = fbnic_set_ringparam,
+       .get_pauseparam         = fbnic_phylink_get_pauseparam,
+       .set_pauseparam         = fbnic_phylink_set_pauseparam,
        .get_strings            = fbnic_get_strings,
        .get_ethtool_stats      = fbnic_get_ethtool_stats,
        .get_sset_count         = fbnic_get_sset_count,
index 943a52c77ed324e700d0f7feaa527e554fba83ef..a3dc85d3838b7be4ca939136a50e5a1b2d46ba7e 100644 (file)
@@ -92,6 +92,10 @@ void fbnic_time_stop(struct fbnic_net *fbn);
 void __fbnic_set_rx_mode(struct net_device *netdev);
 void fbnic_clear_rx_mode(struct net_device *netdev);
 
+void fbnic_phylink_get_pauseparam(struct net_device *netdev,
+                                 struct ethtool_pauseparam *pause);
+int fbnic_phylink_set_pauseparam(struct net_device *netdev,
+                                struct ethtool_pauseparam *pause);
 int fbnic_phylink_ethtool_ksettings_get(struct net_device *netdev,
                                        struct ethtool_link_ksettings *cmd);
 int fbnic_phylink_get_fecparam(struct net_device *netdev,
index 3a11d2a27de958d56077f690547ac439f2357352..7ce3fdd252828dfe8518bf4c82d5a8ae815e8e44 100644 (file)
@@ -24,6 +24,22 @@ static phy_interface_t fbnic_phylink_select_interface(u8 aui)
        return PHY_INTERFACE_MODE_NA;
 }
 
+void fbnic_phylink_get_pauseparam(struct net_device *netdev,
+                                 struct ethtool_pauseparam *pause)
+{
+       struct fbnic_net *fbn = netdev_priv(netdev);
+
+       phylink_ethtool_get_pauseparam(fbn->phylink, pause);
+}
+
+int fbnic_phylink_set_pauseparam(struct net_device *netdev,
+                                struct ethtool_pauseparam *pause)
+{
+       struct fbnic_net *fbn = netdev_priv(netdev);
+
+       return phylink_ethtool_set_pauseparam(fbn->phylink, pause);
+}
+
 static void
 fbnic_phylink_get_supported_fec_modes(unsigned long *supported)
 {