net/mlx5: support Sub-Function
[dpdk.git] / drivers / net / mlx5 / windows / mlx5_flow_os.h
index 1e762c1..df92f25 100644 (file)
@@ -6,6 +6,7 @@
 #define RTE_PMD_MLX5_FLOW_OS_H_
 
 #include "mlx5_flow.h"
+#include "mlx5_malloc.h"
 
 #if defined(HAVE_IBV_FLOW_DV_SUPPORT) || !defined(HAVE_INFINIBAND_VERBS_H)
 extern const struct mlx5_flow_driver_ops mlx5_flow_dv_drv_ops;
@@ -41,6 +42,8 @@ mlx5_flow_os_item_supported(int item)
        case RTE_FLOW_ITEM_TYPE_ETH:
        case RTE_FLOW_ITEM_TYPE_IPV4:
        case RTE_FLOW_ITEM_TYPE_UDP:
+       case RTE_FLOW_ITEM_TYPE_TCP:
+       case RTE_FLOW_ITEM_TYPE_IPV6:
                return true;
        default:
                return false;
@@ -320,6 +323,58 @@ mlx5_flow_os_create_flow_action_default_miss(void **action)
        return 0;
 }
 
+/**
+ * Create flow action: sampler
+ *
+ * @param[in] attr
+ *   Pointer to sampler attribute
+ * @param[out] action
+ *   Pointer to a valid action on success, NULL otherwise.
+ *
+ * @return
+ *   0 on success, or -1 on failure and errno is set.
+ */
+static inline int
+mlx5_os_flow_dr_create_flow_action_sampler
+                       (struct mlx5dv_dr_flow_sampler_attr *attr,
+                       void **action)
+{
+       RTE_SET_USED(attr);
+       *action = NULL;
+       rte_errno = ENOTSUP;
+       return -rte_errno;
+}
+
+/**
+ * Create flow action: dest_array
+ *
+ * @param[in] domain
+ *   Pointer to relevant domain.
+ * @param[in] num_dest
+ *   Number of destinations array.
+ * @param[in] dests
+ *   Array of destination attributes.
+ * @param[out] action
+ *   Pointer to a valid action on success, NULL otherwise.
+ *
+ * @return
+ *   0 on success, or -1 on failure and errno is set.
+ */
+static inline int
+mlx5_os_flow_dr_create_flow_action_dest_array
+                       (void *domain,
+                        size_t num_dest,
+                        struct mlx5dv_dr_action_dest_attr *dests[],
+                        void **action)
+{
+       RTE_SET_USED(domain);
+       RTE_SET_USED(num_dest);
+       RTE_SET_USED(dests);
+       *action = NULL;
+       rte_errno = ENOTSUP;
+       return -rte_errno;
+}
+
 /**
  * OS stub for mlx5_flow_adjust_priority() API.
  * Windows only supports flow priority 0 that cannot be adjusted.
@@ -344,6 +399,15 @@ mlx5_os_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,
        return 0;
 }
 
+static inline int
+mlx5_os_flow_dr_sync_domain(void *domain, uint32_t flags)
+{
+       RTE_SET_USED(domain);
+       RTE_SET_USED(flags);
+       errno = ENOTSUP;
+       return errno;
+}
+
 int mlx5_flow_os_validate_flow_attributes(struct rte_eth_dev *dev,
                                        const struct rte_flow_attr *attributes,
                                        bool external,