[v2,09/13] net/mlx5: add ICMP protocol number definition

Message ID 20200825093116.26538-10-ophirmu@nvidia.com (mailing list archive)
State Rejected, archived
Delegated to: Raslan Darawsheh
Headers
Series mlx5 PMD multi OS support - part #4 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Ophir Munk Aug. 25, 2020, 9:31 a.m. UTC
  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(+)
  

Comments

Thomas Monjalon Sept. 22, 2020, 11:49 a.m. UTC | #1
> 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.

It is already defined (recently) in
lib/librte_eal/windows/include/netinet/in.h

I will drop this patch while pulling next-net.
  
Ophir Munk Sept. 22, 2020, 12:20 p.m. UTC | #2
Great. Thanks. It will save me a fix patch in my next series.

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Tuesday, September 22, 2020 2:50 PM
> To: Ophir Munk <ophirmu@nvidia.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>;
> ferruh.yigit@intel.com; Matan Azrad <matan@nvidia.com>
> Subject: Re: [dpdk-dev] [PATCH v2 09/13] net/mlx5: add ICMP protocol
> number definition
> 
> > 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.
> 
> It is already defined (recently) in
> lib/librte_eal/windows/include/netinet/in.h
> 
> I will drop this patch while pulling next-net.
>
  

Patch

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,