linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Margolin <mrgolin@amazon.com>
To: <jgg@nvidia.com>, <leon@kernel.org>, <linux-rdma@vger.kernel.org>
Cc: <sleybo@amazon.com>, <matua@amazon.com>, <gal.pressman@linux.dev>,
	"Firas Jahjah" <firasj@amazon.com>,
	Yonatan Nachum <ynachum@amazon.com>
Subject: [PATCH for-next 4/5] RDMA/efa: Move type conversion helpers to efa.h
Date: Mon, 24 Jun 2024 16:09:17 +0000	[thread overview]
Message-ID: <20240624160918.27060-5-mrgolin@amazon.com> (raw)
In-Reply-To: <20240624160918.27060-1-mrgolin@amazon.com>

Move ib_ to efa_ types conversion functions to have them near the types
definitions and to reduce code in efa_verbs.c.

Reviewed-by: Firas Jahjah <firasj@amazon.com>
Reviewed-by: Yonatan Nachum <ynachum@amazon.com>
Signed-off-by: Michael Margolin <mrgolin@amazon.com>
---
 drivers/infiniband/hw/efa/efa.h       | 35 +++++++++++++++++++++++++++
 drivers/infiniband/hw/efa/efa_verbs.c | 35 ---------------------------
 2 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/drivers/infiniband/hw/efa/efa.h b/drivers/infiniband/hw/efa/efa.h
index 926f9ff1f60f..f1020bf85b78 100644
--- a/drivers/infiniband/hw/efa/efa.h
+++ b/drivers/infiniband/hw/efa/efa.h
@@ -142,6 +142,41 @@ struct efa_eq {
 	struct efa_irq irq;
 };
 
+static inline struct efa_dev *to_edev(struct ib_device *ibdev)
+{
+	return container_of(ibdev, struct efa_dev, ibdev);
+}
+
+static inline struct efa_ucontext *to_eucontext(struct ib_ucontext *ibucontext)
+{
+	return container_of(ibucontext, struct efa_ucontext, ibucontext);
+}
+
+static inline struct efa_pd *to_epd(struct ib_pd *ibpd)
+{
+	return container_of(ibpd, struct efa_pd, ibpd);
+}
+
+static inline struct efa_mr *to_emr(struct ib_mr *ibmr)
+{
+	return container_of(ibmr, struct efa_mr, ibmr);
+}
+
+static inline struct efa_qp *to_eqp(struct ib_qp *ibqp)
+{
+	return container_of(ibqp, struct efa_qp, ibqp);
+}
+
+static inline struct efa_cq *to_ecq(struct ib_cq *ibcq)
+{
+	return container_of(ibcq, struct efa_cq, ibcq);
+}
+
+static inline struct efa_ah *to_eah(struct ib_ah *ibah)
+{
+	return container_of(ibah, struct efa_ah, ibah);
+}
+
 int efa_query_device(struct ib_device *ibdev,
 		     struct ib_device_attr *props,
 		     struct ib_udata *udata);
diff --git a/drivers/infiniband/hw/efa/efa_verbs.c b/drivers/infiniband/hw/efa/efa_verbs.c
index 9c3e476e3f9c..34a9f86af9bd 100644
--- a/drivers/infiniband/hw/efa/efa_verbs.c
+++ b/drivers/infiniband/hw/efa/efa_verbs.c
@@ -127,41 +127,6 @@ struct pbl_context {
 	u8 physically_continuous;
 };
 
-static inline struct efa_dev *to_edev(struct ib_device *ibdev)
-{
-	return container_of(ibdev, struct efa_dev, ibdev);
-}
-
-static inline struct efa_ucontext *to_eucontext(struct ib_ucontext *ibucontext)
-{
-	return container_of(ibucontext, struct efa_ucontext, ibucontext);
-}
-
-static inline struct efa_pd *to_epd(struct ib_pd *ibpd)
-{
-	return container_of(ibpd, struct efa_pd, ibpd);
-}
-
-static inline struct efa_mr *to_emr(struct ib_mr *ibmr)
-{
-	return container_of(ibmr, struct efa_mr, ibmr);
-}
-
-static inline struct efa_qp *to_eqp(struct ib_qp *ibqp)
-{
-	return container_of(ibqp, struct efa_qp, ibqp);
-}
-
-static inline struct efa_cq *to_ecq(struct ib_cq *ibcq)
-{
-	return container_of(ibcq, struct efa_cq, ibcq);
-}
-
-static inline struct efa_ah *to_eah(struct ib_ah *ibah)
-{
-	return container_of(ibah, struct efa_ah, ibah);
-}
-
 static inline struct efa_user_mmap_entry *
 to_emmap(struct rdma_user_mmap_entry *rdma_entry)
 {
-- 
2.40.1


  parent reply	other threads:[~2024-06-24 16:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-24 16:09 [PATCH for-next 0/5] RDMA/efa: Cleanups and minor improvements Michael Margolin
2024-06-24 16:09 ` [PATCH for-next 1/5] RDMA/efa: Use offset_in_page() function Michael Margolin
2024-06-25  6:32   ` Gal Pressman
2024-06-24 16:09 ` [PATCH for-next 2/5] RDMA/efa: Remove duplicate aenq enable macro Michael Margolin
2024-06-25  6:32   ` Gal Pressman
2024-06-24 16:09 ` [PATCH for-next 3/5] RDMA/efa: Validate EQ array out of bounds reach Michael Margolin
2024-06-25  6:33   ` Gal Pressman
2024-06-25 11:28     ` Margolin, Michael
2024-06-25 14:16       ` Leon Romanovsky
2024-06-24 16:09 ` Michael Margolin [this message]
2024-06-25  6:33   ` [PATCH for-next 4/5] RDMA/efa: Move type conversion helpers to efa.h Gal Pressman
2024-06-25 11:21     ` Margolin, Michael
2024-06-25 14:19       ` Leon Romanovsky
2024-06-24 16:09 ` [PATCH for-next 5/5] RDMA/efa: Align private func names to a single convention Michael Margolin
2024-06-26 15:38   ` Jason Gunthorpe
2024-06-27 16:57     ` Margolin, Michael
2024-06-27 18:43       ` Leon Romanovsky
2024-06-28 14:27         ` Jason Gunthorpe
2024-06-26 17:55 ` [PATCH for-next 0/5] RDMA/efa: Cleanups and minor improvements Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240624160918.27060-5-mrgolin@amazon.com \
    --to=mrgolin@amazon.com \
    --cc=firasj@amazon.com \
    --cc=gal.pressman@linux.dev \
    --cc=jgg@nvidia.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=matua@amazon.com \
    --cc=sleybo@amazon.com \
    --cc=ynachum@amazon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).