Skip to content

Commit 02d21b5

Browse files
idoschdavem330
authored andcommitted
mlxsw: spectrum_nve: Enable VXLAN on Spectrum-2
Enable VXLAN on Spectrum-2 as previous patches added the required functionality. Note that for now Spectrum-1 and Spectrum-2 use the same function to determine whether the VXLAN configuration is valid or not. In the future, when the driver will be extended to support features not present in Spectrum-1, two different functions will be needed. Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Petr Machata <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4ee70ef commit 02d21b5

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
#define MLXSW_SP_NVE_VXLAN_SUPPORTED_FLAGS (VXLAN_F_UDP_ZERO_CSUM_TX | \
2222
VXLAN_F_LEARN)
2323

24-
static bool mlxsw_sp1_nve_vxlan_can_offload(const struct mlxsw_sp_nve *nve,
25-
const struct net_device *dev,
26-
struct netlink_ext_ack *extack)
24+
static bool mlxsw_sp_nve_vxlan_can_offload(const struct mlxsw_sp_nve *nve,
25+
const struct net_device *dev,
26+
struct netlink_ext_ack *extack)
2727
{
2828
struct vxlan_dev *vxlan = netdev_priv(dev);
2929
struct vxlan_config *cfg = &vxlan->cfg;
@@ -240,21 +240,14 @@ mlxsw_sp_nve_vxlan_clear_offload(const struct net_device *nve_dev, __be32 vni)
240240

241241
const struct mlxsw_sp_nve_ops mlxsw_sp1_nve_vxlan_ops = {
242242
.type = MLXSW_SP_NVE_TYPE_VXLAN,
243-
.can_offload = mlxsw_sp1_nve_vxlan_can_offload,
243+
.can_offload = mlxsw_sp_nve_vxlan_can_offload,
244244
.nve_config = mlxsw_sp_nve_vxlan_config,
245245
.init = mlxsw_sp1_nve_vxlan_init,
246246
.fini = mlxsw_sp1_nve_vxlan_fini,
247247
.fdb_replay = mlxsw_sp_nve_vxlan_fdb_replay,
248248
.fdb_clear_offload = mlxsw_sp_nve_vxlan_clear_offload,
249249
};
250250

251-
static bool mlxsw_sp2_nve_vxlan_can_offload(const struct mlxsw_sp_nve *nve,
252-
const struct net_device *dev,
253-
struct netlink_ext_ack *extack)
254-
{
255-
return false;
256-
}
257-
258251
static bool mlxsw_sp2_nve_vxlan_learning_set(struct mlxsw_sp *mlxsw_sp,
259252
bool learning_en)
260253
{
@@ -374,7 +367,7 @@ static void mlxsw_sp2_nve_vxlan_fini(struct mlxsw_sp_nve *nve)
374367

375368
const struct mlxsw_sp_nve_ops mlxsw_sp2_nve_vxlan_ops = {
376369
.type = MLXSW_SP_NVE_TYPE_VXLAN,
377-
.can_offload = mlxsw_sp2_nve_vxlan_can_offload,
370+
.can_offload = mlxsw_sp_nve_vxlan_can_offload,
378371
.nve_config = mlxsw_sp_nve_vxlan_config,
379372
.init = mlxsw_sp2_nve_vxlan_init,
380373
.fini = mlxsw_sp2_nve_vxlan_fini,

0 commit comments

Comments
 (0)