nfp: separate VXLAN and GRE feature handling
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 4 Sep 2018 15:28:33 +0000 (08:28 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Sep 2018 05:18:11 +0000 (22:18 -0700)
VXLAN and GRE FW features have to currently be both advertised
for the driver to enable them.  Separate the handling.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c

index 253bdaef150557a7e20ded3de921021a051a9ca7..a2f88ae6953f0fda7d608ab1e1f897a5722fae81 100644 (file)
@@ -3762,15 +3762,18 @@ static void nfp_net_netdev_init(struct nfp_net *nn)
        }
        if (nn->cap & NFP_NET_CFG_CTRL_RSS_ANY)
                netdev->hw_features |= NETIF_F_RXHASH;
-       if (nn->cap & NFP_NET_CFG_CTRL_VXLAN &&
-           nn->cap & NFP_NET_CFG_CTRL_NVGRE) {
+       if (nn->cap & NFP_NET_CFG_CTRL_VXLAN) {
                if (nn->cap & NFP_NET_CFG_CTRL_LSO)
-                       netdev->hw_features |= NETIF_F_GSO_GRE |
-                                              NETIF_F_GSO_UDP_TUNNEL;
-               nn->dp.ctrl |= NFP_NET_CFG_CTRL_VXLAN | NFP_NET_CFG_CTRL_NVGRE;
-
-               netdev->hw_enc_features = netdev->hw_features;
+                       netdev->hw_features |= NETIF_F_GSO_UDP_TUNNEL;
+               nn->dp.ctrl |= NFP_NET_CFG_CTRL_VXLAN;
        }
+       if (nn->cap & NFP_NET_CFG_CTRL_NVGRE) {
+               if (nn->cap & NFP_NET_CFG_CTRL_LSO)
+                       netdev->hw_features |= NETIF_F_GSO_GRE;
+               nn->dp.ctrl |= NFP_NET_CFG_CTRL_NVGRE;
+       }
+       if (nn->cap & (NFP_NET_CFG_CTRL_VXLAN | NFP_NET_CFG_CTRL_NVGRE))
+               netdev->hw_enc_features = netdev->hw_features;
 
        netdev->vlan_features = netdev->hw_features;