net/mlx5: fix bit width of item and action flags
authorYongseok Koh <yskoh@mellanox.com>
Wed, 24 Oct 2018 12:36:15 +0000 (15:36 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 26 Oct 2018 20:14:06 +0000 (22:14 +0200)
Most of the code uses uint64_t for MLX5_FLOW_LAYER_* and
MLX5_FLOW_ACTION_*, but there're some code using uint32_t.

Fixes: 2ed2fe5f0a9c ("net/mlx5: rewrite IP address UDP/TCP port by E-Switch")
Fixes: 57123c00c1b8 ("net/mlx5: add Linux TC flower driver for E-Switch flow")
Fixes: fc2c498ccb94 ("net/mlx5: add Direct Verbs translate items")
Fixes: 3d69434113d1 ("net/mlx5: add Direct Verbs validation function")
Fixes: 84c406e74524 ("net/mlx5: add flow translate function")
Fixes: 23c1d42c7138 ("net/mlx5: split flow validation to dedicated function")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_flow.h
drivers/net/mlx5/mlx5_flow_dv.c
drivers/net/mlx5/mlx5_flow_tcf.c
drivers/net/mlx5/mlx5_flow_verbs.c

index b170856..280af0a 100644 (file)
@@ -477,7 +477,7 @@ mlx5_flow_item_acceptable(const struct rte_flow_item *item,
  */
 uint64_t
 mlx5_flow_hashfields_adjust(struct mlx5_flow *dev_flow,
-                           int tunnel __rte_unused, uint32_t layer_types,
+                           int tunnel __rte_unused, uint64_t layer_types,
                            uint64_t hash_fields)
 {
        struct rte_flow *flow = dev_flow->flow;
index 4b1f36f..61299d6 100644 (file)
@@ -215,7 +215,7 @@ struct mlx5_flow_verbs {
 struct mlx5_flow {
        LIST_ENTRY(mlx5_flow) next;
        struct rte_flow *flow; /**< Pointer to the main flow. */
-       uint32_t layers;
+       uint64_t layers;
        /**< Bit-fields of present layers, see MLX5_FLOW_LAYER_*. */
        union {
 #ifdef HAVE_IBV_FLOW_DV_SUPPORT
@@ -251,7 +251,7 @@ struct rte_flow {
        uint16_t (*queue)[]; /**< Destination queues to redirect traffic to. */
        LIST_HEAD(dev_flows, mlx5_flow) dev_flows;
        /**< Device flows that are part of the flow. */
-       uint32_t actions;
+       uint64_t actions;
        /**< Bit-fields of detected actions, see MLX5_FLOW_ACTION_*. */
 };
 typedef int (*mlx5_flow_validate_t)(struct rte_eth_dev *dev,
@@ -293,7 +293,7 @@ struct mlx5_flow_driver_ops {
 /* mlx5_flow.c */
 
 uint64_t mlx5_flow_hashfields_adjust(struct mlx5_flow *dev_flow, int tunnel,
-                                    uint32_t layer_types,
+                                    uint64_t layer_types,
                                     uint64_t hash_fields);
 uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority,
                                   uint32_t subpriority);
index 53e9a17..8f729f4 100644 (file)
@@ -165,8 +165,8 @@ flow_dv_validate(struct rte_eth_dev *dev, const struct rte_flow_attr *attr,
                 struct rte_flow_error *error)
 {
        int ret;
-       uint32_t action_flags = 0;
-       uint32_t item_flags = 0;
+       uint64_t action_flags = 0;
+       uint64_t item_flags = 0;
        int tunnel = 0;
        uint8_t next_protocol = 0xff;
        int actions_n = 0;
index dca9f71..719fb10 100644 (file)
@@ -963,8 +963,8 @@ flow_tcf_validate(struct rte_eth_dev *dev,
                const struct rte_flow_action_set_ipv4 *set_ipv4;
                const struct rte_flow_action_set_ipv6 *set_ipv6;
        } conf;
-       uint32_t item_flags = 0;
-       uint32_t action_flags = 0;
+       uint64_t item_flags = 0;
+       uint64_t action_flags = 0;
        uint8_t next_protocol = -1;
        unsigned int tcm_ifindex = 0;
        uint8_t pedit_validated = 0;
@@ -1181,7 +1181,7 @@ flow_tcf_validate(struct rte_eth_dev *dev,
        }
        for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
                unsigned int i;
-               uint32_t current_action_flag = 0;
+               uint64_t current_action_flag = 0;
 
                switch (actions->type) {
                case RTE_FLOW_ACTION_TYPE_VOID:
index a435d65..81bc39f 100644 (file)
@@ -1114,8 +1114,8 @@ flow_verbs_validate(struct rte_eth_dev *dev,
                    struct rte_flow_error *error)
 {
        int ret;
-       uint32_t action_flags = 0;
-       uint32_t item_flags = 0;
+       uint64_t action_flags = 0;
+       uint64_t item_flags = 0;
        int tunnel = 0;
        uint8_t next_protocol = 0xff;