From patchwork Thu Aug 20 14:50:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ophir Munk X-Patchwork-Id: 75788 X-Patchwork-Delegate: rasland@nvidia.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 54F8DA04AF; Thu, 20 Aug 2020 16:52:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 31B4F1C13A; Thu, 20 Aug 2020 16:51:25 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 1DE2F1C112 for ; Thu, 20 Aug 2020 16:51:16 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from ophirmu@nvidia.com) with SMTP; 20 Aug 2020 17:51:10 +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 07KEoq3x015127; Thu, 20 Aug 2020 17:51:10 +0300 From: Ophir Munk To: dev@dpdk.org Cc: Ophir Munk , Gregory Etelson , Ophir Munk Date: Thu, 20 Aug 2020 14:50:24 +0000 Message-Id: <20200820145028.4090-9-ophirmu@nvidia.com> X-Mailer: git-send-email 2.8.4 In-Reply-To: <20200820145028.4090-1-ophirmu@nvidia.com> References: <20200820145028.4090-1-ophirmu@nvidia.com> Subject: [dpdk-dev] [PATCH v1 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Ophir Munk 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 Acked-by: Matan Azrad --- 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,