enic: Check if hw supports multi wq with vxlan offload
authorGovindarajulu Varadarajan <gvaradar@cisco.com>
Thu, 1 Mar 2018 19:07:21 +0000 (11:07 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 4 Mar 2018 23:19:25 +0000 (18:19 -0500)
Some adaptors do not support vxlan offload when multi wq is configured.

If hw supports multi wq, BIT(2) is set in a1.

Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cisco/enic/enic_main.c
drivers/net/ethernet/cisco/enic/vnic_devcmd.h

index 848aac477cff87073c6fba5877d9bc323efadf12..3280a05f9cf1b40d181baa2f66b02e1c4439002b 100644 (file)
@@ -212,6 +212,11 @@ static void enic_udp_tunnel_add(struct net_device *netdev,
 
                goto error;
        }
+       if ((vnic_dev_get_res_count(enic->vdev, RES_TYPE_WQ) != 1) &&
+           !(enic->vxlan.flags & ENIC_VXLAN_MULTI_WQ)) {
+               netdev_info(netdev, "vxlan: vxlan offload with multi wq not supported on this adapter");
+               goto error;
+       }
 
        err = vnic_dev_overlay_offload_cfg(enic->vdev,
                                           OVERLAY_CFG_VXLAN_PORT_UPDATE,
index 69529a3516cdb67f3337d637ffe42cb164191884..8fce9ef1c9bc212abb127916a962a6f3958b0b32 100644 (file)
@@ -699,6 +699,7 @@ enum overlay_ofld_cmd {
 
 #define ENIC_VXLAN_INNER_IPV6          BIT(0)
 #define ENIC_VXLAN_OUTER_IPV6          BIT(1)
+#define ENIC_VXLAN_MULTI_WQ            BIT(2)
 
 /* Use this enum to get the supported versions for each of these features
  * If you need to use the devcmd_get_supported_feature_version(), add