]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "net/mlx5e: E-Switch, Initialize eswitch only if eswitch manager"
authorBodong Wang <bodong@mellanox.com>
Mon, 14 Jan 2019 04:47:26 +0000 (22:47 -0600)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 25 Jan 2019 20:00:28 +0000 (12:00 -0800)
commitef0785797ae937fc32ddd3c8148df9897d01b084
treea4d76f1017bff02590531861bfb5bbcc63a72d14
parent607d144b83b16847bc18fb058d4d51857c4ff9c6
Revert "net/mlx5e: E-Switch, Initialize eswitch only if eswitch manager"

This reverts commit d5cfa0355cfa524585ce0c9b4e7fb5b1c56c339c.

With the original commit, eswitch instance will not be initialized for
a function which is vport group manager but not eswitch manager such as
host PF on SmartNIC (BlueField) card. This will result in a kernel crash
when such a vport group manager is trying to access vports in its group.
E.g, PF vport manager (not eswitch manager) tries to configure the MAC
of its VF vport, a kernel trace will happen similar as bellow:

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
 ...
 RIP: 0010:mlx5_eswitch_get_vport_config+0xc/0x180 [mlx5_core]
 ...

Fixes: d5cfa0355cfa ("net/mlx5e: E-Switch, Initialize eswitch only if eswitch manager")
Signed-off-by: Bodong Wang <bodong@mellanox.com>
Reported-by: Yuval Avnery <yuvalav@mellanox.com>
Reviewed-by: Daniel Jurgens <danielj@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c