net/mlx5: fix bit width of item and action flags

Most of the code uses uint64_t for MLX5_FLOW_LAYER_* and
MLX5_FLOW_ACTION_*, but there're some code using uint32_t.

Fixes: 2ed2fe5f0a ("net/mlx5: rewrite IP address UDP/TCP port by E-Switch")
Fixes: 57123c00c1 ("net/mlx5: add Linux TC flower driver for E-Switch flow")
Fixes: fc2c498ccb ("net/mlx5: add Direct Verbs translate items")
Fixes: 3d69434113 ("net/mlx5: add Direct Verbs validation function")
Fixes: 84c406e745 ("net/mlx5: add flow translate function")
Fixes: 23c1d42c71 ("net/mlx5: split flow validation to dedicated function")

Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
This commit is contained in:
Yongseok Koh 2018-10-24 15:36:15 +03:00 committed by Ferruh Yigit
parent 2466364115
commit 0ddd11437a
5 changed files with 11 additions and 11 deletions

View 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;

View 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);

View 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;

View 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:

View 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;