net/mlx5: Emit port affinity event for multipath offloads
authorRoi Dayan <roid@mellanox.com>
Thu, 21 Feb 2019 14:29:27 +0000 (16:29 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 1 Mar 2019 20:04:17 +0000 (12:04 -0800)
Under multipath offload scheme, as part of handling fib events, emit
mlx5 port affinity event on the enabled ports which will be handled by
the tc offloads code.

Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c
include/linux/mlx5/driver.h

index 5680beba8c07ed1c41cc69004fe98fc992a3513f..5633f8572800e63efe51102365c40537c443a98c 100644 (file)
@@ -6,6 +6,7 @@
 #include "lag_mp.h"
 #include "mlx5_core.h"
 #include "eswitch.h"
+#include "lib/mlx5.h"
 
 static bool mlx5_lag_multipath_check_prereq(struct mlx5_lag *ldev)
 {
@@ -73,6 +74,16 @@ static void mlx5_lag_set_port_affinity(struct mlx5_lag *ldev, int port)
                return;
        }
 
+       if (tracker.netdev_state[0].tx_enabled)
+               mlx5_notifier_call_chain(ldev->pf[0].dev->priv.events,
+                                        MLX5_DEV_EVENT_PORT_AFFINITY,
+                                        (void *)0);
+
+       if (tracker.netdev_state[1].tx_enabled)
+               mlx5_notifier_call_chain(ldev->pf[1].dev->priv.events,
+                                        MLX5_DEV_EVENT_PORT_AFFINITY,
+                                        (void *)0);
+
        mlx5_modify_lag(ldev, &tracker);
 }
 
index ee109b3fbfb8a3d4abb0bba9685e1d78c435730d..5ffb5df1a2c242630bfc71f48267efe091af53c6 100644 (file)
@@ -195,6 +195,7 @@ struct mlx5_rsc_debug {
 
 enum mlx5_dev_event {
        MLX5_DEV_EVENT_SYS_ERROR = 128, /* 0 - 127 are FW events */
+       MLX5_DEV_EVENT_PORT_AFFINITY = 129,
 };
 
 enum mlx5_port_status {