forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
....@@ -130,14 +130,6 @@
130130 return mlx5e_ethtool_flash_device(priv, flash);
131131 }
132132
133
-enum mlx5_ptys_width {
134
- MLX5_PTYS_WIDTH_1X = 1 << 0,
135
- MLX5_PTYS_WIDTH_2X = 1 << 1,
136
- MLX5_PTYS_WIDTH_4X = 1 << 2,
137
- MLX5_PTYS_WIDTH_8X = 1 << 3,
138
- MLX5_PTYS_WIDTH_12X = 1 << 4,
139
-};
140
-
141133 static inline int mlx5_ptys_width_enum_to_int(enum mlx5_ptys_width width)
142134 {
143135 switch (width) {
....@@ -174,24 +166,6 @@
174166 }
175167 }
176168
177
-static int mlx5i_get_port_settings(struct net_device *netdev,
178
- u16 *ib_link_width_oper, u16 *ib_proto_oper)
179
-{
180
- struct mlx5e_priv *priv = mlx5i_epriv(netdev);
181
- struct mlx5_core_dev *mdev = priv->mdev;
182
- u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {0};
183
- int ret;
184
-
185
- ret = mlx5_query_port_ptys(mdev, out, sizeof(out), MLX5_PTYS_IB, 1);
186
- if (ret)
187
- return ret;
188
-
189
- *ib_link_width_oper = MLX5_GET(ptys_reg, out, ib_link_width_oper);
190
- *ib_proto_oper = MLX5_GET(ptys_reg, out, ib_proto_oper);
191
-
192
- return 0;
193
-}
194
-
195169 static int mlx5i_get_speed_settings(u16 ib_link_width_oper, u16 ib_proto_oper)
196170 {
197171 int rate, width;
....@@ -209,11 +183,14 @@
209183 static int mlx5i_get_link_ksettings(struct net_device *netdev,
210184 struct ethtool_link_ksettings *link_ksettings)
211185 {
186
+ struct mlx5e_priv *priv = mlx5i_epriv(netdev);
187
+ struct mlx5_core_dev *mdev = priv->mdev;
212188 u16 ib_link_width_oper;
213189 u16 ib_proto_oper;
214190 int speed, ret;
215191
216
- ret = mlx5i_get_port_settings(netdev, &ib_link_width_oper, &ib_proto_oper);
192
+ ret = mlx5_query_ib_port_oper(mdev, &ib_link_width_oper, &ib_proto_oper,
193
+ 1);
217194 if (ret)
218195 return ret;
219196
....@@ -235,6 +212,9 @@
235212 }
236213
237214 const struct ethtool_ops mlx5i_ethtool_ops = {
215
+ .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
216
+ ETHTOOL_COALESCE_MAX_FRAMES |
217
+ ETHTOOL_COALESCE_USE_ADAPTIVE,
238218 .get_drvinfo = mlx5i_get_drvinfo,
239219 .get_strings = mlx5i_get_strings,
240220 .get_sset_count = mlx5i_get_sset_count,