net/mlx5: reorganise functions in the file
authorNélio Laranjeiro <nelio.laranjeiro@6wind.com>
Mon, 9 Oct 2017 14:45:02 +0000 (16:45 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 12 Oct 2017 00:36:58 +0000 (01:36 +0100)
Move mlx5_flow_validate/create/flush/isolate() to the end of the file.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
drivers/net/mlx5/mlx5_flow.c

index 6d7a29e..f809ed5 100644 (file)
@@ -1346,26 +1346,6 @@ free:
        rte_free(flow);
 }
 
-/**
- * Destroy a flow.
- *
- * @see rte_flow_destroy()
- * @see rte_flow_ops
- */
-int
-mlx5_flow_destroy(struct rte_eth_dev *dev,
-                 struct rte_flow *flow,
-                 struct rte_flow_error *error)
-{
-       struct priv *priv = dev->data->dev_private;
-
-       (void)error;
-       priv_lock(priv);
-       priv_flow_destroy(priv, &priv->flows, flow);
-       priv_unlock(priv);
-       return 0;
-}
-
 /**
  * Destroy all flows.
  *
@@ -1385,25 +1365,6 @@ priv_flow_flush(struct priv *priv, struct mlx5_flows *list)
        }
 }
 
-/**
- * Destroy all flows.
- *
- * @see rte_flow_flush()
- * @see rte_flow_ops
- */
-int
-mlx5_flow_flush(struct rte_eth_dev *dev,
-               struct rte_flow_error *error)
-{
-       struct priv *priv = dev->data->dev_private;
-
-       (void)error;
-       priv_lock(priv);
-       priv_flow_flush(priv, &priv->flows);
-       priv_unlock(priv);
-       return 0;
-}
-
 /**
  * Create drop queue.
  *
@@ -1608,33 +1569,6 @@ flow_create:
        return 0;
 }
 
-/**
- * Isolated mode.
- *
- * @see rte_flow_isolate()
- * @see rte_flow_ops
- */
-int
-mlx5_flow_isolate(struct rte_eth_dev *dev,
-                 int enable,
-                 struct rte_flow_error *error)
-{
-       struct priv *priv = dev->data->dev_private;
-
-       priv_lock(priv);
-       if (dev->data->dev_started) {
-               rte_flow_error_set(error, EBUSY,
-                                  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
-                                  NULL,
-                                  "port must be stopped first");
-               priv_unlock(priv);
-               return -rte_errno;
-       }
-       priv->isolated = !!enable;
-       priv_unlock(priv);
-       return 0;
-}
-
 /**
  * Verify the flow list is empty
  *
@@ -1745,3 +1679,69 @@ mlx5_ctrl_flow(struct rte_eth_dev *dev,
 {
        return mlx5_ctrl_flow_vlan(dev, eth_spec, eth_mask, NULL, NULL);
 }
+
+/**
+ * Destroy a flow.
+ *
+ * @see rte_flow_destroy()
+ * @see rte_flow_ops
+ */
+int
+mlx5_flow_destroy(struct rte_eth_dev *dev,
+                 struct rte_flow *flow,
+                 struct rte_flow_error *error)
+{
+       struct priv *priv = dev->data->dev_private;
+
+       (void)error;
+       priv_lock(priv);
+       priv_flow_destroy(priv, &priv->flows, flow);
+       priv_unlock(priv);
+       return 0;
+}
+
+/**
+ * Destroy all flows.
+ *
+ * @see rte_flow_flush()
+ * @see rte_flow_ops
+ */
+int
+mlx5_flow_flush(struct rte_eth_dev *dev,
+               struct rte_flow_error *error)
+{
+       struct priv *priv = dev->data->dev_private;
+
+       (void)error;
+       priv_lock(priv);
+       priv_flow_flush(priv, &priv->flows);
+       priv_unlock(priv);
+       return 0;
+}
+
+/**
+ * Isolated mode.
+ *
+ * @see rte_flow_isolate()
+ * @see rte_flow_ops
+ */
+int
+mlx5_flow_isolate(struct rte_eth_dev *dev,
+                 int enable,
+                 struct rte_flow_error *error)
+{
+       struct priv *priv = dev->data->dev_private;
+
+       priv_lock(priv);
+       if (dev->data->dev_started) {
+               rte_flow_error_set(error, EBUSY,
+                                  RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+                                  NULL,
+                                  "port must be stopped first");
+               priv_unlock(priv);
+               return -rte_errno;
+       }
+       priv->isolated = !!enable;
+       priv_unlock(priv);
+       return 0;
+}