* [PATCH for-next 1/2] RDMA/efa: Remove umem check on dereg MR flow
2019-08-26 11:53 [PATCH for-next 0/2] EFA cleanups 2019-08-26 Gal Pressman
@ 2019-08-26 11:53 ` Gal Pressman
2019-08-26 11:53 ` [PATCH for-next 2/2] RDMA/efa: Use existing FIELD_SIZEOF macro Gal Pressman
2019-08-27 16:07 ` [PATCH for-next 0/2] EFA cleanups 2019-08-26 Jason Gunthorpe
2 siblings, 0 replies; 4+ messages in thread
From: Gal Pressman @ 2019-08-26 11:53 UTC (permalink / raw)
To: Jason Gunthorpe, Doug Ledford
Cc: linux-rdma, Gal Pressman, Firas JahJah, Yossi Leybovich
EFA driver is not a kverbs provider, the check for MR umem is redundant.
Reviewed-by: Firas JahJah <firasj@amazon.com>
Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
---
drivers/infiniband/hw/efa/efa_verbs.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
index 70851bd7f801..1e23c621a419 100644
--- a/drivers/infiniband/hw/efa/efa_verbs.c
+++ b/drivers/infiniband/hw/efa/efa_verbs.c
@@ -1500,14 +1500,12 @@ int efa_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
ibdev_dbg(&dev->ibdev, "Deregister mr[%d]\n", ibmr->lkey);
- if (mr->umem) {
- params.l_key = mr->ibmr.lkey;
- err = efa_com_dereg_mr(&dev->edev, ¶ms);
- if (err)
- return err;
- }
- ib_umem_release(mr->umem);
+ params.l_key = mr->ibmr.lkey;
+ err = efa_com_dereg_mr(&dev->edev, ¶ms);
+ if (err)
+ return err;
+ ib_umem_release(mr->umem);
kfree(mr);
return 0;
--
2.22.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH for-next 2/2] RDMA/efa: Use existing FIELD_SIZEOF macro
2019-08-26 11:53 [PATCH for-next 0/2] EFA cleanups 2019-08-26 Gal Pressman
2019-08-26 11:53 ` [PATCH for-next 1/2] RDMA/efa: Remove umem check on dereg MR flow Gal Pressman
@ 2019-08-26 11:53 ` Gal Pressman
2019-08-27 16:07 ` [PATCH for-next 0/2] EFA cleanups 2019-08-26 Jason Gunthorpe
2 siblings, 0 replies; 4+ messages in thread
From: Gal Pressman @ 2019-08-26 11:53 UTC (permalink / raw)
To: Jason Gunthorpe, Doug Ledford
Cc: linux-rdma, Gal Pressman, Daniel Kranzdorf, Firas JahJah
Use FIELD_SIZEOF macro instead of hard coding it in field_avail macro.
Reviewed-by: Daniel Kranzdorf <dkkranzd@amazon.com>
Reviewed-by: Firas JahJah <firasj@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
---
drivers/infiniband/hw/efa/efa_verbs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
index 1e23c621a419..4edae89e8e3c 100644
--- a/drivers/infiniband/hw/efa/efa_verbs.c
+++ b/drivers/infiniband/hw/efa/efa_verbs.c
@@ -148,7 +148,7 @@ static inline struct efa_ah *to_eah(struct ib_ah *ibah)
}
#define field_avail(x, fld, sz) (offsetof(typeof(x), fld) + \
- sizeof(((typeof(x) *)0)->fld) <= (sz))
+ FIELD_SIZEOF(typeof(x), fld) <= (sz))
#define is_reserved_cleared(reserved) \
!memchr_inv(reserved, 0, sizeof(reserved))
--
2.22.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH for-next 0/2] EFA cleanups 2019-08-26
2019-08-26 11:53 [PATCH for-next 0/2] EFA cleanups 2019-08-26 Gal Pressman
2019-08-26 11:53 ` [PATCH for-next 1/2] RDMA/efa: Remove umem check on dereg MR flow Gal Pressman
2019-08-26 11:53 ` [PATCH for-next 2/2] RDMA/efa: Use existing FIELD_SIZEOF macro Gal Pressman
@ 2019-08-27 16:07 ` Jason Gunthorpe
2 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2019-08-27 16:07 UTC (permalink / raw)
To: Gal Pressman; +Cc: Doug Ledford, linux-rdma
On Mon, Aug 26, 2019 at 02:53:48PM +0300, Gal Pressman wrote:
> Hello,
>
> This series introduces two minor cleanups for EFA that were hanging
> around in my local git waiting to be submitted.
> The patches are very straight forward, nothing intersting to say about
> them :)..
>
> Gal Pressman (2):
> RDMA/efa: Remove umem check on dereg MR flow
> RDMA/efa: Use existing FIELD_SIZEOF macro
Applied to for-next, thanks
Jason
^ permalink raw reply [flat|nested] 4+ messages in thread