DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix generic tunnel offloading compatibility check
@ 2018-05-23 11:59 Shahaf Shuler
  2018-05-23 22:45 ` Yongseok Koh
  2018-05-24  5:28 ` [dpdk-dev] [PATCH v2] " Shahaf Shuler
  0 siblings, 2 replies; 5+ messages in thread
From: Shahaf Shuler @ 2018-05-23 11:59 UTC (permalink / raw)
  To: nelio.laranjeiro, adrien.mazarguil, yskoh; +Cc: dev, xuemingl

On some distros, the inbox rdma-core tree can contain the Software
Parser enum while the remaining structs still missing.

Fixes: 5f8ba81c4228 ("net/mlx5: support generic tunnel offloading")
Cc: xuemingl@mellanox.com

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---
 drivers/net/mlx5/Makefile | 7 ++++++-
 drivers/net/mlx5/mlx5.c   | 4 ++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index 293144e8a0..b09dd785ad 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -118,11 +118,16 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
 		enum IBV_WQ_FLAG_RX_END_PADDING \
 		$(AUTOCONF_OUTPUT)
 	$Q sh -- '$<' '$@' \
-		HAVE_IBV_MLX5_MOD_SWP \
+		HAVE_IBV_MLX5_MOD_SWP_MASK \
 		infiniband/mlx5dv.h \
 		enum MLX5DV_CONTEXT_MASK_SWP \
 		$(AUTOCONF_OUTPUT)
 	$Q sh -- '$<' '$@' \
+		HAVE_IBV_MLX5_MOD_SWP_CAPS \
+		infiniband/mlx5dv.h \
+		type 'struct mlx5dv_sw_parsing_caps' \
+		$(AUTOCONF_OUTPUT)
+	$Q sh -- '$<' '$@' \
 		HAVE_IBV_MLX5_MOD_MPW \
 		infiniband/mlx5dv.h \
 		enum MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED \
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 006665600a..91dafe93ab 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -775,7 +775,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	}
 	ibv_dev = list[i];
 	DRV_LOG(DEBUG, "device opened");
-#ifdef HAVE_IBV_MLX5_MOD_SWP
+#ifdef HAVE_IBV_MLX5_MOD_SWP_MASK
 	attrs_out.comp_mask |= MLX5DV_CONTEXT_MASK_SWP;
 #endif
 	/*
@@ -801,7 +801,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		DRV_LOG(DEBUG, "MPW isn't supported");
 		mps = MLX5_MPW_DISABLED;
 	}
-#ifdef HAVE_IBV_MLX5_MOD_SWP
+#if defined(HAVE_IBV_MLX5_MOD_SWP_MASK) && defined(HAVE_IBV_MLX5_MOD_SWP_CAPS)
 	if (attrs_out.comp_mask & MLX5DV_CONTEXT_MASK_SWP)
 		swp = attrs_out.sw_parsing_caps.sw_parsing_offloads;
 	DRV_LOG(DEBUG, "SWP support: %u", swp);
-- 
2.12.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix generic tunnel offloading compatibility check
  2018-05-23 11:59 [dpdk-dev] [PATCH] net/mlx5: fix generic tunnel offloading compatibility check Shahaf Shuler
@ 2018-05-23 22:45 ` Yongseok Koh
  2018-05-24  5:28 ` [dpdk-dev] [PATCH v2] " Shahaf Shuler
  1 sibling, 0 replies; 5+ messages in thread
From: Yongseok Koh @ 2018-05-23 22:45 UTC (permalink / raw)
  To: Shahaf Shuler; +Cc: nelio.laranjeiro, adrien.mazarguil, dev, xuemingl

On Wed, May 23, 2018 at 02:59:37PM +0300, Shahaf Shuler wrote:
> On some distros, the inbox rdma-core tree can contain the Software
> Parser enum while the remaining structs still missing.
> 
> Fixes: 5f8ba81c4228 ("net/mlx5: support generic tunnel offloading")
> Cc: xuemingl@mellanox.com
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
>  drivers/net/mlx5/Makefile | 7 ++++++-
>  drivers/net/mlx5/mlx5.c   | 4 ++--
>  2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
> index 293144e8a0..b09dd785ad 100644
> --- a/drivers/net/mlx5/Makefile
> +++ b/drivers/net/mlx5/Makefile
> @@ -118,11 +118,16 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
>  		enum IBV_WQ_FLAG_RX_END_PADDING \
>  		$(AUTOCONF_OUTPUT)
>  	$Q sh -- '$<' '$@' \
> -		HAVE_IBV_MLX5_MOD_SWP \
> +		HAVE_IBV_MLX5_MOD_SWP_MASK \
>  		infiniband/mlx5dv.h \
>  		enum MLX5DV_CONTEXT_MASK_SWP \
>  		$(AUTOCONF_OUTPUT)
>  	$Q sh -- '$<' '$@' \
> +		HAVE_IBV_MLX5_MOD_SWP_CAPS \
> +		infiniband/mlx5dv.h \
> +		type 'struct mlx5dv_sw_parsing_caps' \
> +		$(AUTOCONF_OUTPUT)
> +	$Q sh -- '$<' '$@' \
>  		HAVE_IBV_MLX5_MOD_MPW \
>  		infiniband/mlx5dv.h \
>  		enum MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED \
> diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
> index 006665600a..91dafe93ab 100644
> --- a/drivers/net/mlx5/mlx5.c
> +++ b/drivers/net/mlx5/mlx5.c
> @@ -775,7 +775,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
>  	}
>  	ibv_dev = list[i];
>  	DRV_LOG(DEBUG, "device opened");
> -#ifdef HAVE_IBV_MLX5_MOD_SWP
> +#ifdef HAVE_IBV_MLX5_MOD_SWP_MASK
>  	attrs_out.comp_mask |= MLX5DV_CONTEXT_MASK_SWP;
>  #endif
>  	/*
> @@ -801,7 +801,7 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
>  		DRV_LOG(DEBUG, "MPW isn't supported");
>  		mps = MLX5_MPW_DISABLED;
>  	}
> -#ifdef HAVE_IBV_MLX5_MOD_SWP
> +#if defined(HAVE_IBV_MLX5_MOD_SWP_MASK) && defined(HAVE_IBV_MLX5_MOD_SWP_CAPS)
>  	if (attrs_out.comp_mask & MLX5DV_CONTEXT_MASK_SWP)
>  		swp = attrs_out.sw_parsing_caps.sw_parsing_offloads;
>  	DRV_LOG(DEBUG, "SWP support: %u", swp);

You mean, even if the mask is defined, the capability struct might not be
defined, right? If the capability struct is defined, is the mask always defined?
I guess so. Then, how about just checking the struct instead of enum in order to
define HAVE_IBV_MLX5_MOD_SWP, instead of splitting it into two macros?


Thanks,
Yongseok

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH v2] net/mlx5: fix generic tunnel offloading compatibility check
  2018-05-23 11:59 [dpdk-dev] [PATCH] net/mlx5: fix generic tunnel offloading compatibility check Shahaf Shuler
  2018-05-23 22:45 ` Yongseok Koh
@ 2018-05-24  5:28 ` Shahaf Shuler
  2018-05-24  5:45   ` Yongseok Koh
  1 sibling, 1 reply; 5+ messages in thread
From: Shahaf Shuler @ 2018-05-24  5:28 UTC (permalink / raw)
  To: nelio.laranjeiro, adrien.mazarguil, yskoh; +Cc: dev, xuemingl

On some distros, the inbox rdma-core tree can contain the Software
Parser enum while the remaining structs still missing.

Fixes: 5f8ba81c4228 ("net/mlx5: support generic tunnel offloading")
Cc: xuemingl@mellanox.com

Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
---

On v2:
 - Check only for struct mlx5dv_sw_parsing_caps for the feature enablement.

---
 drivers/net/mlx5/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index 293144e8a0..8a5229e619 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -120,7 +120,7 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
 	$Q sh -- '$<' '$@' \
 		HAVE_IBV_MLX5_MOD_SWP \
 		infiniband/mlx5dv.h \
-		enum MLX5DV_CONTEXT_MASK_SWP \
+		type 'struct mlx5dv_sw_parsing_caps' \
 		$(AUTOCONF_OUTPUT)
 	$Q sh -- '$<' '$@' \
 		HAVE_IBV_MLX5_MOD_MPW \
-- 
2.12.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix generic tunnel offloading compatibility check
  2018-05-24  5:28 ` [dpdk-dev] [PATCH v2] " Shahaf Shuler
@ 2018-05-24  5:45   ` Yongseok Koh
  2018-05-24 11:55     ` Shahaf Shuler
  0 siblings, 1 reply; 5+ messages in thread
From: Yongseok Koh @ 2018-05-24  5:45 UTC (permalink / raw)
  To: Shahaf Shuler
  Cc: Nélio Laranjeiro, Adrien Mazarguil, dev, Xueming(Steven) Li


> On May 23, 2018, at 10:28 PM, Shahaf Shuler <shahafs@mellanox.com> wrote:
> 
> On some distros, the inbox rdma-core tree can contain the Software
> Parser enum while the remaining structs still missing.
> 
> Fixes: 5f8ba81c4228 ("net/mlx5: support generic tunnel offloading")
> Cc: xuemingl@mellanox.com
> 
> Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> ---
Acked-by: Yongseok Koh <yskoh@mellanox.com>
 
Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix generic tunnel offloading compatibility check
  2018-05-24  5:45   ` Yongseok Koh
@ 2018-05-24 11:55     ` Shahaf Shuler
  0 siblings, 0 replies; 5+ messages in thread
From: Shahaf Shuler @ 2018-05-24 11:55 UTC (permalink / raw)
  To: Yongseok Koh
  Cc: Nélio Laranjeiro, Adrien Mazarguil, dev, Xueming(Steven) Li

Thursday, May 24, 2018 8:46 AM, Yongseok Koh:
> Subject: Re: [PATCH v2] net/mlx5: fix generic tunnel offloading compatibility
> check
> 
> 
> > On May 23, 2018, at 10:28 PM, Shahaf Shuler <shahafs@mellanox.com>
> wrote:
> >
> > On some distros, the inbox rdma-core tree can contain the Software
> > Parser enum while the remaining structs still missing.
> >
> > Fixes: 5f8ba81c4228 ("net/mlx5: support generic tunnel offloading")
> > Cc: xuemingl@mellanox.com
> >
> > Signed-off-by: Shahaf Shuler <shahafs@mellanox.com>
> > ---
> Acked-by: Yongseok Koh <yskoh@mellanox.com>

Applied to next-net-mlx, thanks. 

> 
> Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-24 11:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23 11:59 [dpdk-dev] [PATCH] net/mlx5: fix generic tunnel offloading compatibility check Shahaf Shuler
2018-05-23 22:45 ` Yongseok Koh
2018-05-24  5:28 ` [dpdk-dev] [PATCH v2] " Shahaf Shuler
2018-05-24  5:45   ` Yongseok Koh
2018-05-24 11:55     ` Shahaf Shuler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).