mempool/dpaa2: add functions for CMDIF
[dpdk.git] / drivers / net / enic / base / vnic_dev.c
index eccbb30..8880ab9 100644 (file)
@@ -485,7 +485,7 @@ int vnic_dev_capable_adv_filters(struct vnic_dev *vdev)
  *   Retrun true in filter_tags if supported
  */
 int vnic_dev_capable_filter_mode(struct vnic_dev *vdev, u32 *mode,
-                                u8 *filter_tags)
+                                u8 *filter_actions)
 {
        u64 args[4];
        int err;
@@ -493,14 +493,10 @@ int vnic_dev_capable_filter_mode(struct vnic_dev *vdev, u32 *mode,
 
        err = vnic_dev_advanced_filters_cap(vdev, args, 4);
 
-       /* determine if filter tags are available */
-       if (err)
-               *filter_tags = 0;
-       if ((args[2] == FILTER_CAP_MODE_V1) &&
-           (args[3] & FILTER_ACTION_FILTER_ID_FLAG))
-               *filter_tags = 1;
-       else
-               *filter_tags = 0;
+       /* determine supported filter actions */
+       *filter_actions = FILTER_ACTION_RQ_STEERING_FLAG; /* always available */
+       if (args[2] == FILTER_CAP_MODE_V1)
+               *filter_actions = args[3];
 
        if (err || ((args[0] == 1) && (args[1] == 0))) {
                /* Adv filter Command not supported or adv filters available but
@@ -1066,3 +1062,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);
+}