linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-next] RDMA/rxe: Remove unused rxe_mem_map_pages
@ 2020-06-22  9:31 Kamal Heib
  2020-06-22  9:52 ` Zhu Yanjun
  0 siblings, 1 reply; 3+ messages in thread
From: Kamal Heib @ 2020-06-22  9:31 UTC (permalink / raw)
  To: linux-rdma; +Cc: Zhu Yanjun, Jason Gunthorpe, Doug Ledford, Kamal Heib

This function is not in use - delete it.

Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
 drivers/infiniband/sw/rxe/rxe_loc.h |  3 --
 drivers/infiniband/sw/rxe/rxe_mr.c  | 44 -----------------------------
 2 files changed, 47 deletions(-)

diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h
index 775c23becaec..238d6a357aac 100644
--- a/drivers/infiniband/sw/rxe/rxe_loc.h
+++ b/drivers/infiniband/sw/rxe/rxe_loc.h
@@ -132,9 +132,6 @@ struct rxe_mem *lookup_mem(struct rxe_pd *pd, int access, u32 key,
 
 int mem_check_range(struct rxe_mem *mem, u64 iova, size_t length);
 
-int rxe_mem_map_pages(struct rxe_dev *rxe, struct rxe_mem *mem,
-		      u64 *page, int num_pages, u64 iova);
-
 void rxe_mem_cleanup(struct rxe_pool_entry *arg);
 
 int advance_dma_data(struct rxe_dma_info *dma, unsigned int length);
diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
index e83c7b518bfa..a63cb5fac01f 100644
--- a/drivers/infiniband/sw/rxe/rxe_mr.c
+++ b/drivers/infiniband/sw/rxe/rxe_mr.c
@@ -587,47 +587,3 @@ struct rxe_mem *lookup_mem(struct rxe_pd *pd, int access, u32 key,
 
 	return mem;
 }
-
-int rxe_mem_map_pages(struct rxe_dev *rxe, struct rxe_mem *mem,
-		      u64 *page, int num_pages, u64 iova)
-{
-	int i;
-	int num_buf;
-	int err;
-	struct rxe_map **map;
-	struct rxe_phys_buf *buf;
-	int page_size;
-
-	if (num_pages > mem->max_buf) {
-		err = -EINVAL;
-		goto err1;
-	}
-
-	num_buf		= 0;
-	page_size	= 1 << mem->page_shift;
-	map		= mem->map;
-	buf		= map[0]->buf;
-
-	for (i = 0; i < num_pages; i++) {
-		buf->addr = *page++;
-		buf->size = page_size;
-		buf++;
-		num_buf++;
-
-		if (num_buf == RXE_BUF_PER_MAP) {
-			map++;
-			buf = map[0]->buf;
-			num_buf = 0;
-		}
-	}
-
-	mem->iova	= iova;
-	mem->va		= iova;
-	mem->length	= num_pages << mem->page_shift;
-	mem->state	= RXE_MEM_STATE_VALID;
-
-	return 0;
-
-err1:
-	return err;
-}
-- 
2.25.4


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

* Re: [PATCH for-next] RDMA/rxe: Remove unused rxe_mem_map_pages
  2020-06-22  9:31 [PATCH for-next] RDMA/rxe: Remove unused rxe_mem_map_pages Kamal Heib
@ 2020-06-22  9:52 ` Zhu Yanjun
  2020-06-22 10:03   ` Kamal Heib
  0 siblings, 1 reply; 3+ messages in thread
From: Zhu Yanjun @ 2020-06-22  9:52 UTC (permalink / raw)
  To: Kamal Heib; +Cc: linux-rdma, Zhu Yanjun, Jason Gunthorpe, Doug Ledford

On Mon, Jun 22, 2020 at 5:32 PM Kamal Heib <kamalheib1@gmail.com> wrote:
>
> This function is not in use - delete it.
>
Add:

Fixes: 8700e3e7c485 ("Soft RoCE driver")

Is it better?

Zhu Yanjun

> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_loc.h |  3 --
>  drivers/infiniband/sw/rxe/rxe_mr.c  | 44 -----------------------------
>  2 files changed, 47 deletions(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h
> index 775c23becaec..238d6a357aac 100644
> --- a/drivers/infiniband/sw/rxe/rxe_loc.h
> +++ b/drivers/infiniband/sw/rxe/rxe_loc.h
> @@ -132,9 +132,6 @@ struct rxe_mem *lookup_mem(struct rxe_pd *pd, int access, u32 key,
>
>  int mem_check_range(struct rxe_mem *mem, u64 iova, size_t length);
>
> -int rxe_mem_map_pages(struct rxe_dev *rxe, struct rxe_mem *mem,
> -                     u64 *page, int num_pages, u64 iova);
> -
>  void rxe_mem_cleanup(struct rxe_pool_entry *arg);
>
>  int advance_dma_data(struct rxe_dma_info *dma, unsigned int length);
> diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
> index e83c7b518bfa..a63cb5fac01f 100644
> --- a/drivers/infiniband/sw/rxe/rxe_mr.c
> +++ b/drivers/infiniband/sw/rxe/rxe_mr.c
> @@ -587,47 +587,3 @@ struct rxe_mem *lookup_mem(struct rxe_pd *pd, int access, u32 key,
>
>         return mem;
>  }
> -
> -int rxe_mem_map_pages(struct rxe_dev *rxe, struct rxe_mem *mem,
> -                     u64 *page, int num_pages, u64 iova)
> -{
> -       int i;
> -       int num_buf;
> -       int err;
> -       struct rxe_map **map;
> -       struct rxe_phys_buf *buf;
> -       int page_size;
> -
> -       if (num_pages > mem->max_buf) {
> -               err = -EINVAL;
> -               goto err1;
> -       }
> -
> -       num_buf         = 0;
> -       page_size       = 1 << mem->page_shift;
> -       map             = mem->map;
> -       buf             = map[0]->buf;
> -
> -       for (i = 0; i < num_pages; i++) {
> -               buf->addr = *page++;
> -               buf->size = page_size;
> -               buf++;
> -               num_buf++;
> -
> -               if (num_buf == RXE_BUF_PER_MAP) {
> -                       map++;
> -                       buf = map[0]->buf;
> -                       num_buf = 0;
> -               }
> -       }
> -
> -       mem->iova       = iova;
> -       mem->va         = iova;
> -       mem->length     = num_pages << mem->page_shift;
> -       mem->state      = RXE_MEM_STATE_VALID;
> -
> -       return 0;
> -
> -err1:
> -       return err;
> -}
> --
> 2.25.4
>

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

* Re: [PATCH for-next] RDMA/rxe: Remove unused rxe_mem_map_pages
  2020-06-22  9:52 ` Zhu Yanjun
@ 2020-06-22 10:03   ` Kamal Heib
  0 siblings, 0 replies; 3+ messages in thread
From: Kamal Heib @ 2020-06-22 10:03 UTC (permalink / raw)
  To: Zhu Yanjun; +Cc: linux-rdma, Zhu Yanjun, Jason Gunthorpe, Doug Ledford

On Mon, Jun 22, 2020 at 05:52:35PM +0800, Zhu Yanjun wrote:
> On Mon, Jun 22, 2020 at 5:32 PM Kamal Heib <kamalheib1@gmail.com> wrote:
> >
> > This function is not in use - delete it.
> >
> Add:
> 
> Fixes: 8700e3e7c485 ("Soft RoCE driver")
> 
> Is it better?
>

I agree, I'll post a v2.

Thanks,
Kamal


> Zhu Yanjun
> 
> > Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> > ---
> >  drivers/infiniband/sw/rxe/rxe_loc.h |  3 --
> >  drivers/infiniband/sw/rxe/rxe_mr.c  | 44 -----------------------------
> >  2 files changed, 47 deletions(-)
> >
> > diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h
> > index 775c23becaec..238d6a357aac 100644
> > --- a/drivers/infiniband/sw/rxe/rxe_loc.h
> > +++ b/drivers/infiniband/sw/rxe/rxe_loc.h
> > @@ -132,9 +132,6 @@ struct rxe_mem *lookup_mem(struct rxe_pd *pd, int access, u32 key,
> >
> >  int mem_check_range(struct rxe_mem *mem, u64 iova, size_t length);
> >
> > -int rxe_mem_map_pages(struct rxe_dev *rxe, struct rxe_mem *mem,
> > -                     u64 *page, int num_pages, u64 iova);
> > -
> >  void rxe_mem_cleanup(struct rxe_pool_entry *arg);
> >
> >  int advance_dma_data(struct rxe_dma_info *dma, unsigned int length);
> > diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c
> > index e83c7b518bfa..a63cb5fac01f 100644
> > --- a/drivers/infiniband/sw/rxe/rxe_mr.c
> > +++ b/drivers/infiniband/sw/rxe/rxe_mr.c
> > @@ -587,47 +587,3 @@ struct rxe_mem *lookup_mem(struct rxe_pd *pd, int access, u32 key,
> >
> >         return mem;
> >  }
> > -
> > -int rxe_mem_map_pages(struct rxe_dev *rxe, struct rxe_mem *mem,
> > -                     u64 *page, int num_pages, u64 iova)
> > -{
> > -       int i;
> > -       int num_buf;
> > -       int err;
> > -       struct rxe_map **map;
> > -       struct rxe_phys_buf *buf;
> > -       int page_size;
> > -
> > -       if (num_pages > mem->max_buf) {
> > -               err = -EINVAL;
> > -               goto err1;
> > -       }
> > -
> > -       num_buf         = 0;
> > -       page_size       = 1 << mem->page_shift;
> > -       map             = mem->map;
> > -       buf             = map[0]->buf;
> > -
> > -       for (i = 0; i < num_pages; i++) {
> > -               buf->addr = *page++;
> > -               buf->size = page_size;
> > -               buf++;
> > -               num_buf++;
> > -
> > -               if (num_buf == RXE_BUF_PER_MAP) {
> > -                       map++;
> > -                       buf = map[0]->buf;
> > -                       num_buf = 0;
> > -               }
> > -       }
> > -
> > -       mem->iova       = iova;
> > -       mem->va         = iova;
> > -       mem->length     = num_pages << mem->page_shift;
> > -       mem->state      = RXE_MEM_STATE_VALID;
> > -
> > -       return 0;
> > -
> > -err1:
> > -       return err;
> > -}
> > --
> > 2.25.4
> >

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

end of thread, other threads:[~2020-06-22 10:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22  9:31 [PATCH for-next] RDMA/rxe: Remove unused rxe_mem_map_pages Kamal Heib
2020-06-22  9:52 ` Zhu Yanjun
2020-06-22 10:03   ` Kamal Heib

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).