DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ophir Munk <ophirmu@nvidia.com>
To: dev@dpdk.org
Cc: Ophir Munk <ophirmu@mellanox.com>
Subject: [dpdk-dev] [PATCH v2 03/13] net/mlx5: rename mlx5 enumeration REG_NONE
Date: Tue, 25 Aug 2020 09:31:06 +0000
Message-ID: <20200825093116.26538-4-ophirmu@nvidia.com> (raw)
In-Reply-To: <20200825093116.26538-1-ophirmu@nvidia.com>

From: Ophir Munk <ophirmu@mellanox.com>

Enumerated variable REG_NONE (defined in mlx5_prm.h) is in conflict with
Windows definition (winnt.h): #define REG_NONE ( 0ul ) // No value type
To enable mlx5 PMD Windows compilation - rename REG_NONE as REG_NON.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/common/mlx5/mlx5_prm.h  |  2 +-
 drivers/net/mlx5/mlx5_flow.c    | 22 +++++++++++-----------
 drivers/net/mlx5/mlx5_flow_dv.c |  8 ++++----
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
index 69511bc..563e7c8 100644
--- a/drivers/common/mlx5/mlx5_prm.h
+++ b/drivers/common/mlx5/mlx5_prm.h
@@ -539,7 +539,7 @@ enum mlx5_modification_field {
 #define MLX5_MREG_C_NUM (MLX5_MODI_META_REG_C_7 - MLX5_MODI_META_REG_C_0 + 1)
 
 enum modify_reg {
-	REG_NONE = 0,
+	REG_NON = 0,
 	REG_A,
 	REG_B,
 	REG_C_0,
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 7150173..9aad24e 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -353,7 +353,7 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev,
 	case MLX5_METADATA_FDB:
 		switch (config->dv_xmeta_en) {
 		case MLX5_XMETA_MODE_LEGACY:
-			return REG_NONE;
+			return REG_NON;
 		case MLX5_XMETA_MODE_META16:
 			return REG_C_0;
 		case MLX5_XMETA_MODE_META32:
@@ -363,7 +363,7 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev,
 	case MLX5_FLOW_MARK:
 		switch (config->dv_xmeta_en) {
 		case MLX5_XMETA_MODE_LEGACY:
-			return REG_NONE;
+			return REG_NON;
 		case MLX5_XMETA_MODE_META16:
 			return REG_C_1;
 		case MLX5_XMETA_MODE_META32:
@@ -381,7 +381,7 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev,
 			return priv->mtr_color_reg != REG_C_2 ? REG_C_2 :
 			       REG_C_3;
 	case MLX5_MTR_COLOR:
-		MLX5_ASSERT(priv->mtr_color_reg != REG_NONE);
+		MLX5_ASSERT(priv->mtr_color_reg != REG_NON);
 		return priv->mtr_color_reg;
 	case MLX5_COPY_MARK:
 		/*
@@ -404,7 +404,7 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev,
 			return rte_flow_error_set(error, EINVAL,
 						  RTE_FLOW_ERROR_TYPE_ITEM,
 						  NULL, "invalid tag id");
-		if (config->flow_mreg_c[id + start_reg - REG_C_0] == REG_NONE)
+		if (config->flow_mreg_c[id + start_reg - REG_C_0] == REG_NON)
 			return rte_flow_error_set(error, ENOTSUP,
 						  RTE_FLOW_ERROR_TYPE_ITEM,
 						  NULL, "unsupported tag id");
@@ -421,7 +421,7 @@ mlx5_flow_get_reg_id(struct rte_eth_dev *dev,
 						       RTE_FLOW_ERROR_TYPE_ITEM,
 							NULL, "invalid tag id");
 			if (config->flow_mreg_c
-			    [id + 1 + start_reg - REG_C_0] != REG_NONE)
+			    [id + 1 + start_reg - REG_C_0] != REG_NON)
 				return config->flow_mreg_c
 					       [id + 1 + start_reg - REG_C_0];
 			return rte_flow_error_set(error, ENOTSUP,
@@ -459,7 +459,7 @@ mlx5_flow_ext_mreg_supported(struct rte_eth_dev *dev)
 	 * - reg_c's are preserved across different domain (FDB and NIC) on
 	 *   packet loopback by flow lookup miss.
 	 */
-	return config->flow_mreg_c[2] != REG_NONE;
+	return config->flow_mreg_c[2] != REG_NON;
 }
 
 /**
@@ -3011,7 +3011,7 @@ flow_mreg_add_copy_action(struct rte_eth_dev *dev, uint32_t mark_id,
 	};
 	struct mlx5_flow_action_copy_mreg cp_mreg = {
 		.dst = REG_B,
-		.src = REG_NONE,
+		.src = REG_NON,
 	};
 	struct rte_flow_action_jump jump = {
 		.group = MLX5_FLOW_MREG_ACT_TABLE_GROUP,
@@ -3499,7 +3499,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
 	actions_rx++;
 	set_tag = (void *)actions_rx;
 	set_tag->id = mlx5_flow_get_reg_id(dev, MLX5_HAIRPIN_RX, 0, NULL);
-	MLX5_ASSERT(set_tag->id > REG_NONE);
+	MLX5_ASSERT(set_tag->id > REG_NON);
 	set_tag->data = *flow_id;
 	tag_action->conf = set_tag;
 	/* Create Tx item list. */
@@ -3511,7 +3511,7 @@ flow_hairpin_split(struct rte_eth_dev *dev,
 	tag_item = (void *)addr;
 	tag_item->data = *flow_id;
 	tag_item->id = mlx5_flow_get_reg_id(dev, MLX5_HAIRPIN_TX, 0, NULL);
-	MLX5_ASSERT(set_tag->id > REG_NONE);
+	MLX5_ASSERT(set_tag->id > REG_NON);
 	item->spec = tag_item;
 	addr += sizeof(struct mlx5_rte_flow_item_tag);
 	tag_item = (void *)addr;
@@ -4066,7 +4066,7 @@ flow_create_split_metadata(struct rte_eth_dev *dev,
 		/* Internal PMD action to set register. */
 		struct mlx5_rte_flow_item_tag q_tag_spec = {
 			.data = qrss_id,
-			.id = REG_NONE,
+			.id = REG_NON,
 		};
 		struct rte_flow_item q_items[] = {
 			{
@@ -6236,7 +6236,7 @@ mlx5_flow_discover_mreg_c(struct rte_eth_dev *dev)
 		flow_list_destroy(dev, NULL, flow_idx);
 	}
 	for (; n < MLX5_MREG_C_NUM; ++n)
-		config->flow_mreg_c[n] = REG_NONE;
+		config->flow_mreg_c[n] = REG_NON;
 	return 0;
 }
 
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index dd35959..58358ce 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -945,7 +945,7 @@ flow_dv_convert_action_modify_tcp_ack
 }
 
 static enum mlx5_modification_field reg_to_field[] = {
-	[REG_NONE] = MLX5_MODI_OUT_NONE,
+	[REG_NON] = MLX5_MODI_OUT_NONE,
 	[REG_A] = MLX5_MODI_META_DATA_REG_A,
 	[REG_B] = MLX5_MODI_META_DATA_REG_B,
 	[REG_C_0] = MLX5_MODI_META_REG_C_0,
@@ -985,7 +985,7 @@ flow_dv_convert_action_set_reg
 		return rte_flow_error_set(error, EINVAL,
 					  RTE_FLOW_ERROR_TYPE_ACTION, NULL,
 					  "too many items to modify");
-	MLX5_ASSERT(conf->id != REG_NONE);
+	MLX5_ASSERT(conf->id != REG_NON);
 	MLX5_ASSERT(conf->id < RTE_DIM(reg_to_field));
 	actions[i] = (struct mlx5_modification_cmd) {
 		.action_type = MLX5_MODIFICATION_TYPE_SET,
@@ -1035,7 +1035,7 @@ flow_dv_convert_action_set_tag
 	ret = mlx5_flow_get_reg_id(dev, MLX5_APP_TAG, conf->index, error);
 	if (ret < 0)
 		return ret;
-	MLX5_ASSERT(ret != REG_NONE);
+	MLX5_ASSERT(ret != REG_NON);
 	MLX5_ASSERT((unsigned int)ret < RTE_DIM(reg_to_field));
 	reg_type = reg_to_field[ret];
 	MLX5_ASSERT(reg_type > 0);
@@ -1558,7 +1558,7 @@ flow_dv_validate_item_tag(struct rte_eth_dev *dev,
 	ret = mlx5_flow_get_reg_id(dev, MLX5_APP_TAG, spec->index, error);
 	if (ret < 0)
 		return ret;
-	MLX5_ASSERT(ret != REG_NONE);
+	MLX5_ASSERT(ret != REG_NON);
 	return 0;
 }
 
-- 
2.8.4


  parent reply	other threads:[~2020-08-25  9:31 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20 14:50 [dpdk-dev] [PATCH v1 01/13] common/mlx5: replace strsep with strtok_r Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 02/13] common/mlx5: replace linux __bexx types with rte Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 03/13] net/mlx5: rename mlx5 enumeration REG_NONE Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 04/13] net/mlx5: move mlx5_get_ifname prototype under Linux Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 05/13] net/mlx5: fix removal of unused inclusion files Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 06/13] net/mlx5: remove Netlink dependency in shared code Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 07/13] net/mlx5: fix unused utility macros Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 08/13] net/mlx5: call meter detach only if DR is supported Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 09/13] net/mlx5: add ICMP protocol number definition Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 10/13] net/mlx5: remove more DV dependencies Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 11/13] net/mlx5: remove ibv_* dependency in rx/tx objects Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 12/13] net/mlx5: separate vlan strip modification Ophir Munk
2020-08-20 14:50 ` [dpdk-dev] [PATCH v1 13/13] linux/mlx5: refactor VLAN Ophir Munk
2020-08-25  9:31 ` [dpdk-dev] [PATCH v2 00/13] mlx5 PMD multi OS support - part #4 Ophir Munk
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 01/13] common/mlx5: replace strsep with strtok_r Ophir Munk
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 02/13] common/mlx5: replace Linux __bexx types with rte Ophir Munk
2020-08-25  9:31   ` Ophir Munk [this message]
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 04/13] net/mlx5: move mlx5_get_ifname prototype under Linux Ophir Munk
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 05/13] net/mlx5: fix removal of unused inclusion files Ophir Munk
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 06/13] net/mlx5: remove Netlink dependency in shared code Ophir Munk
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 07/13] net/mlx5: fix unused utility macros Ophir Munk
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 08/13] net/mlx5: call meter detach only if DR is supported Ophir Munk
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 09/13] net/mlx5: add ICMP protocol number definition Ophir Munk
2020-09-22 11:49     ` Thomas Monjalon
2020-09-22 12:20       ` Ophir Munk
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 10/13] net/mlx5: remove more DV dependencies Ophir Munk
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 11/13] net/mlx5: remove ibv_* dependency in Rx/Tx objects Ophir Munk
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 12/13] net/mlx5: separate VLAN strip modification Ophir Munk
2020-08-25  9:31   ` [dpdk-dev] [PATCH v2 13/13] linux/mlx5: refactor VLAN Ophir Munk
     [not found] ` <20200825092943.26312-1-ophirmu@mellanox.com>
2020-08-27  9:53   ` [dpdk-dev] [PATCH v2 00/13] mlx5 PMD multi OS support - part #4 Raslan Darawsheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200825093116.26538-4-ophirmu@nvidia.com \
    --to=ophirmu@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=ophirmu@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git