]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Properly check applicability of devlink eswitch commands
authorOr Gerlitz <ogerlitz@mellanox.com>
Sun, 4 Jun 2017 16:36:17 +0000 (19:36 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 15 Jun 2017 20:27:46 +0000 (23:27 +0300)
commitf2fd2bac4195c1cf741bbfc4ec8d281beb591787
treed23200f1fd611f390f4201c9363215d9662bc02a
parenta5833e51129da0388ae46f7aa8a863724f17c5a2
net/mlx5: Properly check applicability of devlink eswitch commands

Currently we don't check that the link type is Eth and hence crash
on IB ports when attempting to deref esw->xxx, fix that.

To avoid repeating this check over and over, put the existing
checks and the one on link type in a single helper.

Fixes: 09a0a4c7df25 ('net/mlx5: E-Switch, Add control for encapsulation')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Mohamad Badarnah <mohamadb@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c