From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 80D9FA034E; Thu, 7 Nov 2019 18:10:16 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0595F1BEAF; Thu, 7 Nov 2019 18:10:15 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 556D61BEAF for ; Thu, 7 Nov 2019 18:10:13 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from viacheslavo@mellanox.com) with ESMTPS (AES256-SHA encrypted); 7 Nov 2019 19:10:11 +0200 Received: from pegasus11.mtr.labs.mlnx (pegasus11.mtr.labs.mlnx [10.210.16.104]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id xA7HAB1a020513; Thu, 7 Nov 2019 19:10:11 +0200 Received: from pegasus11.mtr.labs.mlnx (localhost [127.0.0.1]) by pegasus11.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id xA7HABcx017936; Thu, 7 Nov 2019 17:10:11 GMT Received: (from viacheslavo@localhost) by pegasus11.mtr.labs.mlnx (8.14.7/8.14.7/Submit) id xA7HABIv017935; Thu, 7 Nov 2019 17:10:11 GMT X-Authentication-Warning: pegasus11.mtr.labs.mlnx: viacheslavo set sender to viacheslavo@mellanox.com using -f From: Viacheslav Ovsiienko To: dev@dpdk.org Cc: matan@mellanox.com, rasland@mellanox.com, thomas@monjalon.net, orika@mellanox.com Date: Thu, 7 Nov 2019 17:09:46 +0000 Message-Id: <1573146604-17803-2-git-send-email-viacheslavo@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1573146604-17803-1-git-send-email-viacheslavo@mellanox.com> References: <1572940915-29416-1-git-send-email-viacheslavo@mellanox.com> <1573146604-17803-1-git-send-email-viacheslavo@mellanox.com> Subject: [dpdk-dev] [PATCH v3 01/19] net/mlx5: convert internal tag endianness X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/mlx5/mlx5_flow.c | 6 +++--- drivers/net/mlx5/mlx5_flow.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index b4b08f4..5408797 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -2707,7 +2707,7 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority, 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)); @@ -2715,8 +2715,8 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority, 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 7559810..8cc6c47 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. */ -- 1.8.3.1