[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200428233349.GB13640@mellanox.com>
Date: Tue, 28 Apr 2020 20:33:49 -0300
From: Jason Gunthorpe <jgg@...lanox.com>
To: Maor Gottlieb <maorg@...lanox.com>
Cc: davem@...emloft.net, dledford@...hat.com, j.vosburgh@...il.com,
vfalico@...il.com, andy@...yhouse.net, kuba@...nel.org,
jiri@...lanox.com, dsahern@...nel.org, leonro@...lanox.com,
saeedm@...lanox.com, linux-rdma@...r.kernel.org,
netdev@...r.kernel.org, alexr@...lanox.com
Subject: Re: [PATCH V6 mlx5-next 12/16] RDMA/core: Get xmit slave for LAG
On Sun, Apr 26, 2020 at 10:17:13AM +0300, Maor Gottlieb wrote:
> Add a call to rdma_lag_get_ah_roce_slave when
> Address handle is created.
> Lower driver can use it to select the QP's affinity port.
>
> Signed-off-by: Maor Gottlieb <maorg@...lanox.com>
> Reviewed-by: Leon Romanovsky <leonro@...lanox.com>
> drivers/infiniband/core/verbs.c | 53 +++++++++++++++++++++++----------
> include/rdma/ib_verbs.h | 2 ++
> 2 files changed, 39 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c
> index 86be8a54a2d6..36fb3d032330 100644
> +++ b/drivers/infiniband/core/verbs.c
> @@ -50,6 +50,7 @@
> #include <rdma/ib_cache.h>
> #include <rdma/ib_addr.h>
> #include <rdma/rw.h>
> +#include <rdma/lag.h>
>
> #include "core_priv.h"
> #include <trace/events/rdma_core.h>
> @@ -500,7 +501,8 @@ rdma_update_sgid_attr(struct rdma_ah_attr *ah_attr,
> static struct ib_ah *_rdma_create_ah(struct ib_pd *pd,
> struct rdma_ah_attr *ah_attr,
> u32 flags,
> - struct ib_udata *udata)
> + struct ib_udata *udata,
> + struct net_device *xmit_slave)
>
> {
> struct rdma_ah_init_attr init_attr = {};
> struct ib_device *device = pd->device;
> @@ -524,6 +526,7 @@ static struct ib_ah *_rdma_create_ah(struct ib_pd *pd,
> ah->sgid_attr = rdma_update_sgid_attr(ah_attr, NULL);
> init_attr.ah_attr = ah_attr;
> init_attr.flags = flags;
> + init_attr.xmit_slave = xmit_slave;
>
> ret = device->ops.create_ah(ah, &init_attr, udata);
> if (ret) {
> @@ -550,6 +553,7 @@ struct ib_ah *rdma_create_ah(struct ib_pd *pd, struct rdma_ah_attr *ah_attr,
> u32 flags)
> {
> const struct ib_gid_attr *old_sgid_attr;
> + struct net_device *slave;
> struct ib_ah *ah;
> int ret;
>
> @@ -557,8 +561,14 @@ struct ib_ah *rdma_create_ah(struct ib_pd *pd, struct rdma_ah_attr *ah_attr,
> if (ret)
> return ERR_PTR(ret);
>
> - ah = _rdma_create_ah(pd, ah_attr, flags, NULL);
> + ret = rdma_lag_get_ah_roce_slave(pd->device, ah_attr, &slave);
> + if (ret) {
> + rdma_unfill_sgid_attr(ah_attr, old_sgid_attr);
> + return ERR_PTR(ret);
> + }
>
> + ah = _rdma_create_ah(pd, ah_attr, flags, NULL, slave);
> + rdma_lag_put_ah_roce_slave(slave);
> rdma_unfill_sgid_attr(ah_attr, old_sgid_attr);
> return ah;
> }
> @@ -597,7 +607,8 @@ struct ib_ah *rdma_create_user_ah(struct ib_pd *pd,
> }
> }
>
> - ah = _rdma_create_ah(pd, ah_attr, RDMA_CREATE_AH_SLEEPABLE, udata);
> + ah = _rdma_create_ah(pd, ah_attr, RDMA_CREATE_AH_SLEEPABLE,
> + udata, NULL);
Why doesn't the user space do the check too?
Jason
Powered by blists - more mailing lists