From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 2C57DA04B1;
	Tue, 25 Aug 2020 11:32:46 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id F26481C1EE;
	Tue, 25 Aug 2020 11:31:41 +0200 (CEST)
Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])
 by dpdk.org (Postfix) with ESMTP id BD2C31C1B7
 for <dev@dpdk.org>; Tue, 25 Aug 2020 11:31:29 +0200 (CEST)
Received: from Internal Mail-Server by MTLPINE1 (envelope-from
 ophirmu@nvidia.com) with SMTP; 25 Aug 2020 12:31:25 +0300
Received: from nvidia.com (pegasus05.mtr.labs.mlnx [10.210.16.100])
 by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 07P9VPMx030009;
 Tue, 25 Aug 2020 12:31:25 +0300
From: Ophir Munk <ophirmu@nvidia.com>
To: dev@dpdk.org
Cc: Ophir Munk <ophirmu@mellanox.com>
Date: Tue, 25 Aug 2020 09:31:12 +0000
Message-Id: <20200825093116.26538-10-ophirmu@nvidia.com>
X-Mailer: git-send-email 2.8.4
In-Reply-To: <20200825093116.26538-1-ophirmu@nvidia.com>
References: <20200820145028.4090-1-ophirmu@nvidia.com>
 <20200825093116.26538-1-ophirmu@nvidia.com>
Subject: [dpdk-dev] [PATCH v2 09/13] net/mlx5: add ICMP protocol number
	definition
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

From: Ophir Munk <ophirmu@mellanox.com>

Some Windows distributions do not include ICMP protocol definitions
IPPROTO_ICMP and IPPROTO_ICMPV6. This commit defines them if needed.

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 9aad24e..4c29898 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1244,6 +1244,10 @@ mlx5_flow_validate_attributes(struct rte_eth_dev *dev,
  * @return
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
+
+#ifndef IPPROTO_ICMPV6
+#define IPPROTO_ICMPV6  58
+#endif
 int
 mlx5_flow_validate_item_icmp6(const struct rte_flow_item *item,
 			       uint64_t item_flags,
@@ -1296,6 +1300,9 @@ mlx5_flow_validate_item_icmp6(const struct rte_flow_item *item,
  * @return
  *   0 on success, a negative errno value otherwise and rte_errno is set.
  */
+#ifndef IPPROTO_ICMP
+#define IPPROTO_ICMP  1
+#endif
 int
 mlx5_flow_validate_item_icmp(const struct rte_flow_item *item,
 			     uint64_t item_flags,
-- 
2.8.4