@@ -1139,22 +1139,7 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv)
1139
1139
return (rep -> vport == FDB_UPLINK_VPORT );
1140
1140
}
1141
1141
1142
- static bool mlx5e_is_vf_vport_rep (struct mlx5e_priv * priv )
1143
- {
1144
- struct mlx5e_rep_priv * rpriv = priv -> ppriv ;
1145
- struct mlx5_eswitch_rep * rep ;
1146
-
1147
- if (!MLX5_ESWITCH_MANAGER (priv -> mdev ))
1148
- return false;
1149
-
1150
- rep = rpriv -> rep ;
1151
- if (rep && rep -> vport != FDB_UPLINK_VPORT )
1152
- return true;
1153
-
1154
- return false;
1155
- }
1156
-
1157
- bool mlx5e_has_offload_stats (const struct net_device * dev , int attr_id )
1142
+ static bool mlx5e_rep_has_offload_stats (const struct net_device * dev , int attr_id )
1158
1143
{
1159
1144
switch (attr_id ) {
1160
1145
case IFLA_OFFLOAD_XSTATS_CPU_HIT :
@@ -1183,8 +1168,8 @@ mlx5e_get_sw_stats64(const struct net_device *dev,
1183
1168
return 0 ;
1184
1169
}
1185
1170
1186
- int mlx5e_get_offload_stats (int attr_id , const struct net_device * dev ,
1187
- void * sp )
1171
+ static int mlx5e_rep_get_offload_stats (int attr_id , const struct net_device * dev ,
1172
+ void * sp )
1188
1173
{
1189
1174
switch (attr_id ) {
1190
1175
case IFLA_OFFLOAD_XSTATS_CPU_HIT :
@@ -1235,8 +1220,8 @@ static const struct net_device_ops mlx5e_netdev_ops_vf_rep = {
1235
1220
.ndo_get_phys_port_name = mlx5e_rep_get_phys_port_name ,
1236
1221
.ndo_setup_tc = mlx5e_rep_setup_tc ,
1237
1222
.ndo_get_stats64 = mlx5e_vf_rep_get_stats ,
1238
- .ndo_has_offload_stats = mlx5e_has_offload_stats ,
1239
- .ndo_get_offload_stats = mlx5e_get_offload_stats ,
1223
+ .ndo_has_offload_stats = mlx5e_rep_has_offload_stats ,
1224
+ .ndo_get_offload_stats = mlx5e_rep_get_offload_stats ,
1240
1225
.ndo_change_mtu = mlx5e_vf_rep_change_mtu ,
1241
1226
};
1242
1227
@@ -1247,8 +1232,8 @@ static const struct net_device_ops mlx5e_netdev_ops_uplink_rep = {
1247
1232
.ndo_get_phys_port_name = mlx5e_rep_get_phys_port_name ,
1248
1233
.ndo_setup_tc = mlx5e_rep_setup_tc ,
1249
1234
.ndo_get_stats64 = mlx5e_get_stats ,
1250
- .ndo_has_offload_stats = mlx5e_has_offload_stats ,
1251
- .ndo_get_offload_stats = mlx5e_get_offload_stats ,
1235
+ .ndo_has_offload_stats = mlx5e_rep_has_offload_stats ,
1236
+ .ndo_get_offload_stats = mlx5e_rep_get_offload_stats ,
1252
1237
.ndo_change_mtu = mlx5e_uplink_rep_change_mtu ,
1253
1238
};
1254
1239
@@ -1550,69 +1535,6 @@ static const struct mlx5e_profile mlx5e_rep_profile = {
1550
1535
};
1551
1536
1552
1537
/* e-Switch vport representors */
1553
-
1554
- static int
1555
- mlx5e_nic_rep_load (struct mlx5_core_dev * dev , struct mlx5_eswitch_rep * rep )
1556
- {
1557
- struct mlx5e_rep_priv * rpriv = mlx5e_rep_to_rep_priv (rep );
1558
- struct mlx5e_priv * priv = netdev_priv (rpriv -> netdev );
1559
- struct mlx5_rep_uplink_priv * uplink_priv = & rpriv -> uplink_priv ;
1560
- int err ;
1561
-
1562
- if (test_bit (MLX5E_STATE_OPENED , & priv -> state )) {
1563
- err = mlx5e_add_sqs_fwd_rules (priv );
1564
- if (err )
1565
- return err ;
1566
- }
1567
-
1568
- err = mlx5e_rep_neigh_init (rpriv );
1569
- if (err )
1570
- goto err_remove_sqs ;
1571
-
1572
- /* init shared tc flow table */
1573
- err = mlx5e_tc_esw_init (& uplink_priv -> tc_ht );
1574
- if (err )
1575
- goto err_neigh_cleanup ;
1576
-
1577
- /* init indirect block notifications */
1578
- INIT_LIST_HEAD (& uplink_priv -> tc_indr_block_priv_list );
1579
- uplink_priv -> netdevice_nb .notifier_call = mlx5e_nic_rep_netdevice_event ;
1580
- err = register_netdevice_notifier (& uplink_priv -> netdevice_nb );
1581
- if (err ) {
1582
- mlx5_core_err (priv -> mdev , "Failed to register netdev notifier\n" );
1583
- goto err_indirect_block_cleanup ;
1584
- }
1585
-
1586
- return 0 ;
1587
-
1588
- err_indirect_block_cleanup :
1589
- mlx5e_tc_esw_cleanup (& uplink_priv -> tc_ht );
1590
- err_neigh_cleanup :
1591
- mlx5e_rep_neigh_cleanup (rpriv );
1592
- err_remove_sqs :
1593
- mlx5e_remove_sqs_fwd_rules (priv );
1594
- return err ;
1595
- }
1596
-
1597
- static void
1598
- mlx5e_nic_rep_unload (struct mlx5_eswitch_rep * rep )
1599
- {
1600
- struct mlx5e_rep_priv * rpriv = mlx5e_rep_to_rep_priv (rep );
1601
- struct mlx5e_priv * priv = netdev_priv (rpriv -> netdev );
1602
-
1603
- if (test_bit (MLX5E_STATE_OPENED , & priv -> state ))
1604
- mlx5e_remove_sqs_fwd_rules (priv );
1605
-
1606
- /* clean indirect TC block notifications */
1607
- unregister_netdevice_notifier (& rpriv -> uplink_priv .netdevice_nb );
1608
- mlx5e_rep_indr_clean_block_privs (rpriv );
1609
-
1610
- /* clean uplink offloaded TC rules, delete shared tc flow table */
1611
- mlx5e_tc_esw_cleanup (& rpriv -> uplink_priv .tc_ht );
1612
-
1613
- mlx5e_rep_neigh_cleanup (rpriv );
1614
- }
1615
-
1616
1538
static int
1617
1539
mlx5e_vport_rep_load (struct mlx5_core_dev * dev , struct mlx5_eswitch_rep * rep )
1618
1540
{
@@ -1726,16 +1648,3 @@ void mlx5e_rep_unregister_vport_reps(struct mlx5e_priv *priv)
1726
1648
for (vport = total_vfs - 1 ; vport >= 0 ; vport -- )
1727
1649
mlx5_eswitch_unregister_vport_rep (esw , vport , REP_ETH );
1728
1650
}
1729
-
1730
- void * mlx5e_alloc_nic_rep_priv (struct mlx5_core_dev * mdev )
1731
- {
1732
- struct mlx5_eswitch * esw = mdev -> priv .eswitch ;
1733
- struct mlx5e_rep_priv * rpriv ;
1734
-
1735
- rpriv = kzalloc (sizeof (* rpriv ), GFP_KERNEL );
1736
- if (!rpriv )
1737
- return NULL ;
1738
-
1739
- rpriv -> rep = & esw -> offloads .vport_reps [0 ];
1740
- return rpriv ;
1741
- }
0 commit comments