]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mlxsw: spectrum_nve: Enable VXLAN on Spectrum-2
authorIdo Schimmel <idosch@mellanox.com>
Wed, 23 Jan 2019 14:32:59 +0000 (14:32 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Jan 2019 17:28:27 +0000 (09:28 -0800)
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 <idosch@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c

index 91b3c71bf0315f38b0fc64ba187319ae3d47d20f..93ccd9fc22662d78ea91f12de0d9a2ea01ab4d30 100644 (file)
@@ -21,9 +21,9 @@
 #define MLXSW_SP_NVE_VXLAN_SUPPORTED_FLAGS     (VXLAN_F_UDP_ZERO_CSUM_TX | \
                                                 VXLAN_F_LEARN)
 
-static bool mlxsw_sp1_nve_vxlan_can_offload(const struct mlxsw_sp_nve *nve,
-                                           const struct net_device *dev,
-                                           struct netlink_ext_ack *extack)
+static bool mlxsw_sp_nve_vxlan_can_offload(const struct mlxsw_sp_nve *nve,
+                                          const struct net_device *dev,
+                                          struct netlink_ext_ack *extack)
 {
        struct vxlan_dev *vxlan = netdev_priv(dev);
        struct vxlan_config *cfg = &vxlan->cfg;
@@ -240,7 +240,7 @@ mlxsw_sp_nve_vxlan_clear_offload(const struct net_device *nve_dev, __be32 vni)
 
 const struct mlxsw_sp_nve_ops mlxsw_sp1_nve_vxlan_ops = {
        .type           = MLXSW_SP_NVE_TYPE_VXLAN,
-       .can_offload    = mlxsw_sp1_nve_vxlan_can_offload,
+       .can_offload    = mlxsw_sp_nve_vxlan_can_offload,
        .nve_config     = mlxsw_sp_nve_vxlan_config,
        .init           = mlxsw_sp1_nve_vxlan_init,
        .fini           = mlxsw_sp1_nve_vxlan_fini,
@@ -248,13 +248,6 @@ const struct mlxsw_sp_nve_ops mlxsw_sp1_nve_vxlan_ops = {
        .fdb_clear_offload = mlxsw_sp_nve_vxlan_clear_offload,
 };
 
-static bool mlxsw_sp2_nve_vxlan_can_offload(const struct mlxsw_sp_nve *nve,
-                                           const struct net_device *dev,
-                                           struct netlink_ext_ack *extack)
-{
-       return false;
-}
-
 static bool mlxsw_sp2_nve_vxlan_learning_set(struct mlxsw_sp *mlxsw_sp,
                                             bool learning_en)
 {
@@ -374,7 +367,7 @@ static void mlxsw_sp2_nve_vxlan_fini(struct mlxsw_sp_nve *nve)
 
 const struct mlxsw_sp_nve_ops mlxsw_sp2_nve_vxlan_ops = {
        .type           = MLXSW_SP_NVE_TYPE_VXLAN,
-       .can_offload    = mlxsw_sp2_nve_vxlan_can_offload,
+       .can_offload    = mlxsw_sp_nve_vxlan_can_offload,
        .nve_config     = mlxsw_sp_nve_vxlan_config,
        .init           = mlxsw_sp2_nve_vxlan_init,
        .fini           = mlxsw_sp2_nve_vxlan_fini,