All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mlx5-next] net/mlx5: Separate ODP capabilities
@ 2019-02-19 13:06 Leon Romanovsky
  2019-02-21 12:10 ` Leon Romanovsky
  0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2019-02-19 13:06 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Moni Shoua, RDMA mailing list, Saeed Mahameed, linux-netdev,
	Leon Romanovsky

From: Moni Shoua <monis@mellanox.com>

ODP support for XRC transport is not enabled by default in FW,
so we need separate ODP checks to enable/disable it.

While that, rewrite the set of ODP SRQ support capabilities in way
that tests each field separately for clearness, which is not needed
for current FW, but better to have it separated.

Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 .../net/ethernet/mellanox/mlx5/core/main.c    | 29 ++++++++++---------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c
index 025dfaf3466b..5cf557a77f0f 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c
@@ -474,11 +474,6 @@ static int handle_hca_cap_odp(struct mlx5_core_dev *dev)
 	if (err)
 		return err;
 
-	if (!(MLX5_CAP_ODP_MAX(dev, ud_odp_caps.srq_receive) ||
-	      MLX5_CAP_ODP_MAX(dev, rc_odp_caps.srq_receive) ||
-	      MLX5_CAP_ODP_MAX(dev, xrc_odp_caps.srq_receive)))
-		return 0;
-
 	set_sz = MLX5_ST_SZ_BYTES(set_hca_cap_in);
 	set_ctx = kzalloc(set_sz, GFP_KERNEL);
 	if (!set_ctx)
@@ -488,15 +483,21 @@ static int handle_hca_cap_odp(struct mlx5_core_dev *dev)
 	memcpy(set_hca_cap, dev->caps.hca_cur[MLX5_CAP_ODP],
 	       MLX5_ST_SZ_BYTES(odp_cap));
 
-	/* set ODP SRQ support for RC/UD and XRC transports */
-	MLX5_SET(odp_cap, set_hca_cap, ud_odp_caps.srq_receive,
-		 MLX5_CAP_ODP_MAX(dev, ud_odp_caps.srq_receive));
-
-	MLX5_SET(odp_cap, set_hca_cap, rc_odp_caps.srq_receive,
-		 MLX5_CAP_ODP_MAX(dev, rc_odp_caps.srq_receive));
-
-	MLX5_SET(odp_cap, set_hca_cap, xrc_odp_caps.srq_receive,
-		 MLX5_CAP_ODP_MAX(dev, xrc_odp_caps.srq_receive));
+#define ODP_CAP_SET_MAX(dev, field)                                            \
+	do {                                                                   \
+		u32 _res = MLX5_CAP_ODP_MAX(dev, field);                       \
+		if (_res)                                                      \
+			MLX5_SET(odp_cap, set_hca_cap, field, _res);           \
+	} while (0)
+
+	ODP_CAP_SET_MAX(dev, ud_odp_caps.srq_receive);
+	ODP_CAP_SET_MAX(dev, rc_odp_caps.srq_receive);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.srq_receive);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.send);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.receive);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.write);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.read);
+	ODP_CAP_SET_MAX(dev, xrc_odp_caps.atomic);
 
 	err = set_caps(dev, set_ctx, set_sz, MLX5_SET_HCA_CAP_OP_MOD_ODP);
 
-- 
2.19.1

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

* Re: [PATCH mlx5-next] net/mlx5: Separate ODP capabilities
  2019-02-19 13:06 [PATCH mlx5-next] net/mlx5: Separate ODP capabilities Leon Romanovsky
@ 2019-02-21 12:10 ` Leon Romanovsky
  2019-02-21 12:21   ` Leon Romanovsky
  0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2019-02-21 12:10 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Moni Shoua, RDMA mailing list, Saeed Mahameed, linux-netdev

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

On Tue, Feb 19, 2019 at 03:06:37PM +0200, Leon Romanovsky wrote:
> From: Moni Shoua <monis@mellanox.com>
>
> ODP support for XRC transport is not enabled by default in FW,
> so we need separate ODP checks to enable/disable it.
>
> While that, rewrite the set of ODP SRQ support capabilities in way
> that tests each field separately for clearness, which is not needed
> for current FW, but better to have it separated.
>
> Signed-off-by: Moni Shoua <monis@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  .../net/ethernet/mellanox/mlx5/core/main.c    | 29 ++++++++++---------
>  1 file changed, 15 insertions(+), 14 deletions(-)
>

Thanks, applied to mlx5-next
f1463b9f1a97 net/mlx5: Separate ODP capabilities

Doug, Jason,

Can you please merge this branch into rdma-next as a preparation
to pull request?

Thanks

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

* Re: [PATCH mlx5-next] net/mlx5: Separate ODP capabilities
  2019-02-21 12:10 ` Leon Romanovsky
@ 2019-02-21 12:21   ` Leon Romanovsky
  0 siblings, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2019-02-21 12:21 UTC (permalink / raw)
  To: Doug Ledford, Jason Gunthorpe
  Cc: Moni Shoua, RDMA mailing list, Saeed Mahameed, linux-netdev

[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]

On Thu, Feb 21, 2019 at 12:10:06PM +0000, Leon Romanovsky wrote:
> On Tue, Feb 19, 2019 at 03:06:37PM +0200, Leon Romanovsky wrote:
> > From: Moni Shoua <monis@mellanox.com>
> >
> > ODP support for XRC transport is not enabled by default in FW,
> > so we need separate ODP checks to enable/disable it.
> >
> > While that, rewrite the set of ODP SRQ support capabilities in way
> > that tests each field separately for clearness, which is not needed
> > for current FW, but better to have it separated.
> >
> > Signed-off-by: Moni Shoua <monis@mellanox.com>
> > Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> > ---
> >  .../net/ethernet/mellanox/mlx5/core/main.c    | 29 ++++++++++---------
> >  1 file changed, 15 insertions(+), 14 deletions(-)
> >
>
> Thanks, applied to mlx5-next
> f1463b9f1a97 net/mlx5: Separate ODP capabilities
>
> Doug, Jason,
>
> Can you please merge this branch into rdma-next as a preparation
> to pull request?

Sorry, it was a mistake, I dropped it.

>
> Thanks



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

end of thread, other threads:[~2019-02-21 12:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19 13:06 [PATCH mlx5-next] net/mlx5: Separate ODP capabilities Leon Romanovsky
2019-02-21 12:10 ` Leon Romanovsky
2019-02-21 12:21   ` Leon Romanovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.