net/avf: fix Rx interrupt mapping
[dpdk.git] / drivers / net / enic / base / vnic_dev.c
index 364458a..8483f76 100644 (file)
@@ -528,23 +528,6 @@ parse_max_level:
        return 0;
 }
 
-int vnic_dev_capable_udp_rss(struct vnic_dev *vdev)
-{
-       u64 a0 = CMD_NIC_CFG, a1 = 0;
-       u64 rss_hash_type;
-       int wait = 1000;
-       int err;
-
-       err = vnic_dev_cmd(vdev, CMD_CAPABILITY, &a0, &a1, wait);
-       if (err)
-               return 0;
-       if (a0 == 0)
-               return 0;
-       rss_hash_type = (a1 >> NIC_CFG_RSS_HASH_TYPE_SHIFT) &
-               NIC_CFG_RSS_HASH_TYPE_MASK_FIELD;
-       return ((rss_hash_type & NIC_CFG_RSS_HASH_TYPE_UDP) ? 1 : 0);
-}
-
 int vnic_dev_capable(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd)
 {
        u64 a0 = (u32)cmd, a1 = 0;
@@ -1062,3 +1045,36 @@ int vnic_dev_classifier(struct vnic_dev *vdev, u8 cmd, u16 *entry,
 
        return ret;
 }
+
+int vnic_dev_overlay_offload_ctrl(struct vnic_dev *vdev, u8 overlay, u8 config)
+{
+       u64 a0 = overlay;
+       u64 a1 = config;
+       int wait = 1000;
+
+       return vnic_dev_cmd(vdev, CMD_OVERLAY_OFFLOAD_CTRL, &a0, &a1, wait);
+}
+
+int vnic_dev_overlay_offload_cfg(struct vnic_dev *vdev, u8 overlay,
+                                u16 vxlan_udp_port_number)
+{
+       u64 a1 = vxlan_udp_port_number;
+       u64 a0 = overlay;
+       int wait = 1000;
+
+       return vnic_dev_cmd(vdev, CMD_OVERLAY_OFFLOAD_CFG, &a0, &a1, wait);
+}
+
+int vnic_dev_capable_vxlan(struct vnic_dev *vdev)
+{
+       u64 a0 = VIC_FEATURE_VXLAN;
+       u64 a1 = 0;
+       int wait = 1000;
+       int ret;
+
+       ret = vnic_dev_cmd(vdev, CMD_GET_SUPP_FEATURE_VER, &a0, &a1, wait);
+       /* 1 if the NIC can do VXLAN for both IPv4 and IPv6 with multiple WQs */
+       return ret == 0 &&
+               (a1 & (FEATURE_VXLAN_IPV6 | FEATURE_VXLAN_MULTI_WQ)) ==
+               (FEATURE_VXLAN_IPV6 | FEATURE_VXLAN_MULTI_WQ);
+}