@@ -381,7 +381,8 @@ static const struct ethtool_ops mlx5e_uplink_rep_ethtool_ops = {
381
381
.set_pauseparam = mlx5e_uplink_rep_set_pauseparam ,
382
382
};
383
383
384
- static int mlx5e_attr_get (struct net_device * dev , struct switchdev_attr * attr )
384
+ static int mlx5e_rep_get_port_parent_id (struct net_device * dev ,
385
+ struct netdev_phys_item_id * ppid )
385
386
{
386
387
struct mlx5e_priv * priv = netdev_priv (dev );
387
388
struct mlx5_eswitch * esw = priv -> mdev -> priv .eswitch ;
@@ -398,20 +399,14 @@ static int mlx5e_attr_get(struct net_device *dev, struct switchdev_attr *attr)
398
399
uplink_priv = netdev_priv (uplink_dev );
399
400
}
400
401
401
- switch (attr -> id ) {
402
- case SWITCHDEV_ATTR_ID_PORT_PARENT_ID :
403
- attr -> u .ppid .id_len = ETH_ALEN ;
404
- if (uplink_upper && mlx5_lag_is_sriov (uplink_priv -> mdev )) {
405
- ether_addr_copy (attr -> u .ppid .id , uplink_upper -> dev_addr );
406
- } else {
407
- struct mlx5e_rep_priv * rpriv = priv -> ppriv ;
408
- struct mlx5_eswitch_rep * rep = rpriv -> rep ;
402
+ ppid -> id_len = ETH_ALEN ;
403
+ if (uplink_upper && mlx5_lag_is_sriov (uplink_priv -> mdev )) {
404
+ ether_addr_copy (ppid -> id , uplink_upper -> dev_addr );
405
+ } else {
406
+ struct mlx5e_rep_priv * rpriv = priv -> ppriv ;
407
+ struct mlx5_eswitch_rep * rep = rpriv -> rep ;
409
408
410
- ether_addr_copy (attr -> u .ppid .id , rep -> hw_id );
411
- }
412
- break ;
413
- default :
414
- return - EOPNOTSUPP ;
409
+ ether_addr_copy (ppid -> id , rep -> hw_id );
415
410
}
416
411
417
412
return 0 ;
@@ -1284,10 +1279,6 @@ static int mlx5e_uplink_rep_set_vf_vlan(struct net_device *dev, int vf, u16 vlan
1284
1279
return 0 ;
1285
1280
}
1286
1281
1287
- static const struct switchdev_ops mlx5e_rep_switchdev_ops = {
1288
- .switchdev_port_attr_get = mlx5e_attr_get ,
1289
- };
1290
-
1291
1282
static const struct net_device_ops mlx5e_netdev_ops_vf_rep = {
1292
1283
.ndo_open = mlx5e_vf_rep_open ,
1293
1284
.ndo_stop = mlx5e_vf_rep_close ,
@@ -1298,6 +1289,7 @@ static const struct net_device_ops mlx5e_netdev_ops_vf_rep = {
1298
1289
.ndo_has_offload_stats = mlx5e_rep_has_offload_stats ,
1299
1290
.ndo_get_offload_stats = mlx5e_rep_get_offload_stats ,
1300
1291
.ndo_change_mtu = mlx5e_vf_rep_change_mtu ,
1292
+ .ndo_get_port_parent_id = mlx5e_rep_get_port_parent_id ,
1301
1293
};
1302
1294
1303
1295
static const struct net_device_ops mlx5e_netdev_ops_uplink_rep = {
@@ -1319,6 +1311,7 @@ static const struct net_device_ops mlx5e_netdev_ops_uplink_rep = {
1319
1311
.ndo_get_vf_config = mlx5e_get_vf_config ,
1320
1312
.ndo_get_vf_stats = mlx5e_get_vf_stats ,
1321
1313
.ndo_set_vf_vlan = mlx5e_uplink_rep_set_vf_vlan ,
1314
+ .ndo_get_port_parent_id = mlx5e_rep_get_port_parent_id ,
1322
1315
};
1323
1316
1324
1317
bool mlx5e_eswitch_rep (struct net_device * netdev )
@@ -1393,8 +1386,6 @@ static void mlx5e_build_rep_netdev(struct net_device *netdev)
1393
1386
netdev -> watchdog_timeo = 15 * HZ ;
1394
1387
1395
1388
1396
- netdev -> switchdev_ops = & mlx5e_rep_switchdev_ops ;
1397
-
1398
1389
netdev -> features |= NETIF_F_HW_TC | NETIF_F_NETNS_LOCAL ;
1399
1390
netdev -> hw_features |= NETIF_F_HW_TC ;
1400
1391
0 commit comments