net/mlx5: fix tunnel offload hub multi-thread protection
[dpdk.git] / drivers / net / mlx5 / mlx5_flow.h
index 5fac867..f643842 100644 (file)
@@ -950,8 +950,12 @@ struct mlx5_flow_tunnel {
 
 /** PMD tunnel related context */
 struct mlx5_flow_tunnel_hub {
+       /* Tunnels list
+        * Access to the list MUST be MT protected
+        */
        LIST_HEAD(, mlx5_flow_tunnel) tunnels;
-       rte_spinlock_t sl;                      /* Tunnel list spinlock. */
+        /* protect access to the tunnels list */
+       rte_spinlock_t sl;
        struct mlx5_hlist *groups;              /** non tunnel groups */
 };
 
@@ -991,8 +995,13 @@ mlx5_tunnel_hub(struct rte_eth_dev *dev)
 static inline bool
 is_tunnel_offload_active(struct rte_eth_dev *dev)
 {
+#ifdef HAVE_IBV_FLOW_DV_SUPPORT
        struct mlx5_priv *priv = dev->data->dev_private;
        return !!priv->config.dv_miss_info;
+#else
+       RTE_SET_USED(dev);
+       return false;
+#endif
 }
 
 static inline bool
@@ -1268,8 +1277,8 @@ tunnel_use_standard_attr_group_translate
 int mlx5_flow_group_to_table(struct rte_eth_dev *dev,
                             const struct mlx5_flow_tunnel *tunnel,
                             uint32_t group, uint32_t *table,
-                            struct flow_grp_info flags,
-                                struct rte_flow_error *error);
+                            const struct flow_grp_info *flags,
+                            struct rte_flow_error *error);
 uint64_t mlx5_flow_hashfields_adjust(struct mlx5_flow_rss_desc *rss_desc,
                                     int tunnel, uint64_t layer_types,
                                     uint64_t hash_fields);