From: Viacheslav Ovsiienko Date: Thu, 7 Nov 2019 17:09:46 +0000 (+0000) Subject: net/mlx5: convert internal tag endianness X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=cff811c7240e10369845bc263aca34f2011bb8fd;p=dpdk.git net/mlx5: convert internal tag endianness Public API RTE_FLOW_ACTION_TYPE_TAG and RTE_FLOW_ITEM_TYPE_TAG present data in host-endian format, as all metadata related entities. The internal mlx5 tag related action and item should use the same endianness to be conformed. Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 38b7e4b195..bcefc1bba5 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2725,7 +2725,7 @@ flow_hairpin_split(struct rte_eth_dev *dev, actions_rx++; set_tag = (void *)actions_rx; set_tag->id = flow_get_reg_id(dev, MLX5_HAIRPIN_RX, 0, &error); - set_tag->data = rte_cpu_to_be_32(*flow_id); + set_tag->data = *flow_id; tag_action->conf = set_tag; /* Create Tx item list. */ rte_memcpy(actions_tx, actions, sizeof(struct rte_flow_action)); @@ -2733,8 +2733,8 @@ flow_hairpin_split(struct rte_eth_dev *dev, item = pattern_tx; item->type = MLX5_RTE_FLOW_ITEM_TYPE_TAG; tag_item = (void *)addr; - tag_item->data = rte_cpu_to_be_32(*flow_id); - tag_item->id = flow_get_reg_id(dev, MLX5_HAIRPIN_TX, 0, &error); + tag_item->data = *flow_id; + tag_item->id = flow_get_reg_id(dev, MLX5_HAIRPIN_TX, 0, NULL); item->spec = tag_item; addr += sizeof(struct mlx5_rte_flow_item_tag); tag_item = (void *)addr; diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index d33d856ad2..f6f8f82d1d 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -56,13 +56,13 @@ enum mlx5_rte_flow_action_type { /* Matches on selected register. */ struct mlx5_rte_flow_item_tag { uint16_t id; - rte_be32_t data; + uint32_t data; }; /* Modify selected register. */ struct mlx5_rte_flow_action_set_tag { uint16_t id; - rte_be32_t data; + uint32_t data; }; /* Matches on source queue. */