Skip to content

Commit

Permalink
net/mlx5e: Use the correct pause values for ethtool advertising
Browse files Browse the repository at this point in the history
Query the operational pause from firmware (PFCC register) instead of
always passing zeros.

Fixes: 665bc53 ("net/mlx5e: Use new ethtool get/set link ksettings API")
Signed-off-by: Gal Pressman <[email protected]>
Cc: [email protected]
Signed-off-by: Saeed Mahameed <[email protected]>
  • Loading branch information
Gal Pressman authored and Saeed Mahameed committed May 14, 2017
1 parent 1c4d5f5 commit b383b54
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,8 @@ static int mlx5e_get_link_ksettings(struct net_device *netdev,
struct mlx5e_priv *priv = netdev_priv(netdev);
struct mlx5_core_dev *mdev = priv->mdev;
u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {0};
u32 rx_pause = 0;
u32 tx_pause = 0;
u32 eth_proto_cap;
u32 eth_proto_admin;
u32 eth_proto_lp;
Expand All @@ -871,11 +873,13 @@ static int mlx5e_get_link_ksettings(struct net_device *netdev,
an_disable_admin = MLX5_GET(ptys_reg, out, an_disable_admin);
an_status = MLX5_GET(ptys_reg, out, an_status);

mlx5_query_port_pause(mdev, &rx_pause, &tx_pause);

ethtool_link_ksettings_zero_link_mode(link_ksettings, supported);
ethtool_link_ksettings_zero_link_mode(link_ksettings, advertising);

get_supported(eth_proto_cap, link_ksettings);
get_advertising(eth_proto_admin, 0, 0, link_ksettings);
get_advertising(eth_proto_admin, tx_pause, rx_pause, link_ksettings);
get_speed_duplex(netdev, eth_proto_oper, link_ksettings);

eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap;
Expand Down

0 comments on commit b383b54

Please sign in to comment.