diff options
author | Roi Dayan <roid@mellanox.com> | 2016-09-25 14:27:17 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2017-04-22 20:26:40 +0300 |
commit | 7768d1971de676b0e12f57450ba7a6b38ff4cfb2 (patch) | |
tree | fef447a29b79a97cb1537314b800220e7f1548dc /drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | |
parent | 1967ce6ea5c8a03e5f963b639fe33ece60b2dc91 (diff) | |
download | linux-7768d1971de676b0e12f57450ba7a6b38ff4cfb2.tar.xz |
net/mlx5: E-Switch, Add control for encapsulation
Implement the devlink e-switch encapsulation control set and get
callbacks. Apply the value set by the user on the switchdev offloads
mode when creating the fast FDB table where offloaded rules will be set.
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/eswitch.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/eswitch.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c index b3281d1118b3..21bed3c3334d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c @@ -1806,6 +1806,11 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev) esw->enabled_vports = 0; esw->mode = SRIOV_NONE; esw->offloads.inline_mode = MLX5_INLINE_MODE_NONE; + if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, encap) && + MLX5_CAP_ESW_FLOWTABLE_FDB(dev, decap)) + esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_BASIC; + else + esw->offloads.encap = DEVLINK_ESWITCH_ENCAP_MODE_NONE; dev->priv.eswitch = esw; return 0; |