Re: [PATCH v3 06/17] rdma_rxe: Added stubs for alloc_mw and dealloc_mw verbs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 20, 2020 at 05:46:27PM -0500, Bob Pearson wrote:
> Added a new file focused on memory windows, rxe_mw.c and adds stubbed
> out kernel verbs API for alloc_mw and dealloc_mw. These functions are added
> to the context ops struct and bits added to the supported APIs mask.
> 
> Signed-off-by: Bob Pearson <rpearson@xxxxxxx>
>  drivers/infiniband/sw/rxe/Makefile    |  1 +
>  drivers/infiniband/sw/rxe/rxe_loc.h   |  5 +++++
>  drivers/infiniband/sw/rxe/rxe_mw.c    | 22 ++++++++++++++++++++++
>  drivers/infiniband/sw/rxe/rxe_verbs.c |  4 ++++
>  4 files changed, 32 insertions(+)
>  create mode 100644 drivers/infiniband/sw/rxe/rxe_mw.c
> 
> diff --git a/drivers/infiniband/sw/rxe/Makefile b/drivers/infiniband/sw/rxe/Makefile
> index 66af72dca759..1e24673e9318 100644
> +++ b/drivers/infiniband/sw/rxe/Makefile
> @@ -15,6 +15,7 @@ rdma_rxe-y := \
>  	rxe_qp.o \
>  	rxe_cq.o \
>  	rxe_mr.o \
> +	rxe_mw.o \
>  	rxe_opcode.o \
>  	rxe_mmap.o \
>  	rxe_icrc.o \
> diff --git a/drivers/infiniband/sw/rxe/rxe_loc.h b/drivers/infiniband/sw/rxe/rxe_loc.h
> index 47d1730f43dd..9ab5f2c34def 100644
> +++ b/drivers/infiniband/sw/rxe/rxe_loc.h
> @@ -111,6 +111,11 @@ void rxe_mem_cleanup(struct rxe_pool_entry *arg);
>  
>  int advance_dma_data(struct rxe_dma_info *dma, unsigned int length);
>  
> +/* rxe_mw.c */
> +struct ib_mw *rxe_alloc_mw(struct ib_pd *ibpd, enum ib_mw_type type,
> +			   struct ib_udata *udata);
> +int rxe_dealloc_mw(struct ib_mw *ibmw);
> +
>  /* rxe_net.c */
>  void rxe_loopback(struct sk_buff *skb);
>  int rxe_send(struct rxe_pkt_info *pkt, struct sk_buff *skb);
> diff --git a/drivers/infiniband/sw/rxe/rxe_mw.c b/drivers/infiniband/sw/rxe/rxe_mw.c
> new file mode 100644
> index 000000000000..f5df5e0b714f
> +++ b/drivers/infiniband/sw/rxe/rxe_mw.c
> @@ -0,0 +1,22 @@
> +// SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB
> +/*
> + * linux/drivers/infiniband/sw/rxe/rxe_mw.c
> + *
> + * Copyright (c) 2020 Hewlett Packard Enterprise, Inc. All rights reserved.
> + */
> +
> +#include "rxe.h"
> +#include "rxe_loc.h"
> +
> +struct ib_mw *rxe_alloc_mw(struct ib_pd *ibpd, enum ib_mw_type type,
> +			   struct ib_udata *udata)
> +{
> +	pr_err_once("%s: not implemented\n", __func__);
> +	return ERR_PTR(-EINVAL);
> +}
> +
> +int rxe_dealloc_mw(struct ib_mw *ibmw)
> +{
> +	pr_err_once("%s: not implemented\n", __func__);
> +	return -EINVAL;
> +}

The patches should be ordered to avoid things like this, just add the
final implemetnation as the last patch

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux