|
@@ -820,6 +820,42 @@ static int mlx5e_set_tunable(struct net_device *dev,
|
|
return err;
|
|
return err;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void mlx5e_get_pauseparam(struct net_device *netdev,
|
|
|
|
+ struct ethtool_pauseparam *pauseparam)
|
|
|
|
+{
|
|
|
|
+ struct mlx5e_priv *priv = netdev_priv(netdev);
|
|
|
|
+ struct mlx5_core_dev *mdev = priv->mdev;
|
|
|
|
+ int err;
|
|
|
|
+
|
|
|
|
+ err = mlx5_query_port_pause(mdev, &pauseparam->rx_pause,
|
|
|
|
+ &pauseparam->tx_pause);
|
|
|
|
+ if (err) {
|
|
|
|
+ netdev_err(netdev, "%s: mlx5_query_port_pause failed:0x%x\n",
|
|
|
|
+ __func__, err);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int mlx5e_set_pauseparam(struct net_device *netdev,
|
|
|
|
+ struct ethtool_pauseparam *pauseparam)
|
|
|
|
+{
|
|
|
|
+ struct mlx5e_priv *priv = netdev_priv(netdev);
|
|
|
|
+ struct mlx5_core_dev *mdev = priv->mdev;
|
|
|
|
+ int err;
|
|
|
|
+
|
|
|
|
+ if (pauseparam->autoneg)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ err = mlx5_set_port_pause(mdev,
|
|
|
|
+ pauseparam->rx_pause ? 1 : 0,
|
|
|
|
+ pauseparam->tx_pause ? 1 : 0);
|
|
|
|
+ if (err) {
|
|
|
|
+ netdev_err(netdev, "%s: mlx5_set_port_pause failed:0x%x\n",
|
|
|
|
+ __func__, err);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return err;
|
|
|
|
+}
|
|
|
|
+
|
|
const struct ethtool_ops mlx5e_ethtool_ops = {
|
|
const struct ethtool_ops mlx5e_ethtool_ops = {
|
|
.get_drvinfo = mlx5e_get_drvinfo,
|
|
.get_drvinfo = mlx5e_get_drvinfo,
|
|
.get_link = ethtool_op_get_link,
|
|
.get_link = ethtool_op_get_link,
|
|
@@ -841,4 +877,6 @@ const struct ethtool_ops mlx5e_ethtool_ops = {
|
|
.get_rxnfc = mlx5e_get_rxnfc,
|
|
.get_rxnfc = mlx5e_get_rxnfc,
|
|
.get_tunable = mlx5e_get_tunable,
|
|
.get_tunable = mlx5e_get_tunable,
|
|
.set_tunable = mlx5e_set_tunable,
|
|
.set_tunable = mlx5e_set_tunable,
|
|
|
|
+ .get_pauseparam = mlx5e_get_pauseparam,
|
|
|
|
+ .set_pauseparam = mlx5e_set_pauseparam,
|
|
};
|
|
};
|