net/mlx5: convert internal tag endianness
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>
Thu, 7 Nov 2019 17:09:46 +0000 (17:09 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 11 Nov 2019 13:23:01 +0000 (14:23 +0100)
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 <viacheslavo@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/net/mlx5/mlx5_flow.c
drivers/net/mlx5/mlx5_flow.h

index 38b7e4b..bcefc1b 100644 (file)
@@ -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;
index d33d856..f6f8f82 100644 (file)
@@ -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. */