@@ -183,18 +183,7 @@ void mlx5e_rep_bond_unslave(struct mlx5_eswitch *esw,
183
183
184
184
static bool mlx5e_rep_is_lag_netdev (struct net_device * netdev )
185
185
{
186
- struct mlx5e_rep_priv * rpriv ;
187
- struct mlx5e_priv * priv ;
188
-
189
- /* A given netdev is not a representor or not a slave of LAG configuration */
190
- if (!mlx5e_eswitch_rep (netdev ) || !netif_is_lag_port (netdev ))
191
- return false;
192
-
193
- priv = netdev_priv (netdev );
194
- rpriv = priv -> ppriv ;
195
-
196
- /* Egress acl forward to vport is supported only non-uplink representor */
197
- return rpriv -> rep -> vport != MLX5_VPORT_UPLINK ;
186
+ return netif_is_lag_port (netdev ) && mlx5e_eswitch_vf_rep (netdev );
198
187
}
199
188
200
189
static void mlx5e_rep_changelowerstate_event (struct net_device * netdev , void * ptr )
@@ -210,9 +199,6 @@ static void mlx5e_rep_changelowerstate_event(struct net_device *netdev, void *pt
210
199
u16 fwd_vport_num ;
211
200
int err ;
212
201
213
- if (!mlx5e_rep_is_lag_netdev (netdev ))
214
- return ;
215
-
216
202
info = ptr ;
217
203
lag_info = info -> lower_state_info ;
218
204
/* This is not an event of a representor becoming active slave */
@@ -266,9 +252,6 @@ static void mlx5e_rep_changeupper_event(struct net_device *netdev, void *ptr)
266
252
struct net_device * lag_dev ;
267
253
struct mlx5e_priv * priv ;
268
254
269
- if (!mlx5e_rep_is_lag_netdev (netdev ))
270
- return ;
271
-
272
255
priv = netdev_priv (netdev );
273
256
rpriv = priv -> ppriv ;
274
257
lag_dev = info -> upper_dev ;
@@ -293,6 +276,19 @@ static int mlx5e_rep_esw_bond_netevent(struct notifier_block *nb,
293
276
unsigned long event , void * ptr )
294
277
{
295
278
struct net_device * netdev = netdev_notifier_info_to_dev (ptr );
279
+ struct mlx5e_rep_priv * rpriv ;
280
+ struct mlx5e_rep_bond * bond ;
281
+ struct mlx5e_priv * priv ;
282
+
283
+ if (!mlx5e_rep_is_lag_netdev (netdev ))
284
+ return NOTIFY_DONE ;
285
+
286
+ bond = container_of (nb , struct mlx5e_rep_bond , nb );
287
+ priv = netdev_priv (netdev );
288
+ rpriv = mlx5_eswitch_get_uplink_priv (priv -> mdev -> priv .eswitch , REP_ETH );
289
+ /* Verify VF representor is on the same device of the bond handling the netevent. */
290
+ if (rpriv -> uplink_priv .bond != bond )
291
+ return NOTIFY_DONE ;
296
292
297
293
switch (event ) {
298
294
case NETDEV_CHANGELOWERSTATE :
0 commit comments