Commit 8c253df
net/mlx5: E-switch, Devcom, sync devcom events and devcom comp register
devcom events are sent to all registered component. Following the
cited patch, it is possible for two components, e.g.: two eswitches,
to send devcom events, while both components are registered. This
means eswitch layer will do double un/pairing, which is double
allocation and free of resources, even though only one un/pairing is
needed. flow example:
cpu0 cpu1
---- ----
mlx5_devlink_eswitch_mode_set(dev0)
esw_offloads_devcom_init()
mlx5_devcom_register_component(esw0)
mlx5_devlink_eswitch_mode_set(dev1)
esw_offloads_devcom_init()
mlx5_devcom_register_component(esw1)
mlx5_devcom_send_event()
mlx5_devcom_send_event()
Hence, check whether the eswitches are already un/paired before
free/allocation of resources.
Fixes: 09b2784 ("net: devlink: enable parallel ops on netlink interface")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>1 parent dfa1e46 commit 8c253df
2 files changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| 345 | + | |
345 | 346 | | |
346 | 347 | | |
347 | 348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2742 | 2742 | | |
2743 | 2743 | | |
2744 | 2744 | | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
2745 | 2748 | | |
2746 | 2749 | | |
2747 | 2750 | | |
| |||
2753 | 2756 | | |
2754 | 2757 | | |
2755 | 2758 | | |
| 2759 | + | |
| 2760 | + | |
2756 | 2761 | | |
2757 | 2762 | | |
2758 | 2763 | | |
2759 | 2764 | | |
2760 | | - | |
| 2765 | + | |
2761 | 2766 | | |
2762 | 2767 | | |
2763 | 2768 | | |
| 2769 | + | |
| 2770 | + | |
2764 | 2771 | | |
2765 | 2772 | | |
2766 | 2773 | | |
| |||
0 commit comments