linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Potnuri Bharat Teja <bharat@chelsio.com>,
	linux-rdma@vger.kernel.org, Bob Pearson <rpearsonhpe@gmail.com>
Subject: Re: [PATCH 01/11] RDMA/cxgb4: Remove MW support
Date: Mon, 5 Oct 2020 08:56:52 +0300	[thread overview]
Message-ID: <20201005055652.GE9764@unreal> (raw)
In-Reply-To: <1-v1-caa70ba3d1ab+1436e-ucmd_mask_jgg@nvidia.com>

On Sat, Oct 03, 2020 at 08:20:01PM -0300, Jason Gunthorpe wrote:
> This driver never enabled IB_USER_VERBS_CMD_ALLOC_MW so memory windows
> were not usable from userspace. The kernel side was removed long ago. Drop
> this dead code.
>
> Fixes: feb7c1e38bcc ("IB: remove in-kernel support for memory windows")
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
>  drivers/infiniband/hw/cxgb4/iw_cxgb4.h |  2 -
>  drivers/infiniband/hw/cxgb4/mem.c      | 84 --------------------------
>  drivers/infiniband/hw/cxgb4/provider.c |  2 -
>  3 files changed, 88 deletions(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
> index a27899402f59a5..f85477f3b037d2 100644
> --- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
> +++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
> @@ -983,9 +983,7 @@ struct ib_mr *c4iw_alloc_mr(struct ib_pd *pd, enum ib_mr_type mr_type,
>  			    u32 max_num_sg);
>  int c4iw_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg, int sg_nents,
>  		   unsigned int *sg_offset);
> -int c4iw_dealloc_mw(struct ib_mw *mw);
>  void c4iw_dealloc(struct uld_ctx *ctx);
> -int c4iw_alloc_mw(struct ib_mw *mw, struct ib_udata *udata);
>  struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start,
>  					   u64 length, u64 virt, int acc,
>  					   struct ib_udata *udata);
> diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
> index 42234df896fb2c..a2c71a1d93d5a8 100644
> --- a/drivers/infiniband/hw/cxgb4/mem.c
> +++ b/drivers/infiniband/hw/cxgb4/mem.c
> @@ -365,22 +365,6 @@ static int dereg_mem(struct c4iw_rdev *rdev, u32 stag, u32 pbl_size,
>  			       pbl_size, pbl_addr, skb, wr_waitp);
>  }
>
> -static int allocate_window(struct c4iw_rdev *rdev, u32 *stag, u32 pdid,
> -			   struct c4iw_wr_wait *wr_waitp)
> -{
> -	*stag = T4_STAG_UNSET;
> -	return write_tpt_entry(rdev, 0, stag, 0, pdid, FW_RI_STAG_MW, 0, 0, 0,
> -			       0UL, 0, 0, 0, 0, NULL, wr_waitp);
> -}
> -
> -static int deallocate_window(struct c4iw_rdev *rdev, u32 stag,
> -			     struct sk_buff *skb,
> -			     struct c4iw_wr_wait *wr_waitp)
> -{
> -	return write_tpt_entry(rdev, 1, &stag, 0, 0, 0, 0, 0, 0, 0UL, 0, 0, 0,
> -			       0, skb, wr_waitp);
> -}
> -
>  static int allocate_stag(struct c4iw_rdev *rdev, u32 *stag, u32 pdid,
>  			 u32 pbl_size, u32 pbl_addr,
>  			 struct c4iw_wr_wait *wr_waitp)
> @@ -611,74 +595,6 @@ struct ib_mr *c4iw_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
>  	return ERR_PTR(err);
>  }
>
> -int c4iw_alloc_mw(struct ib_mw *ibmw, struct ib_udata *udata)
> -{
> -	struct c4iw_mw *mhp = to_c4iw_mw(ibmw);
> -	struct c4iw_dev *rhp;
> -	struct c4iw_pd *php;
> -	u32 mmid;
> -	u32 stag = 0;
> -	int ret;
> -
> -	if (ibmw->type != IB_MW_TYPE_1)
> -		return -EINVAL;
> -
> -	php = to_c4iw_pd(ibmw->pd);
> -	rhp = php->rhp;
> -	mhp->wr_waitp = c4iw_alloc_wr_wait(GFP_KERNEL);
> -	if (!mhp->wr_waitp)
> -		return -ENOMEM;
> -
> -	mhp->dereg_skb = alloc_skb(SGE_MAX_WR_LEN, GFP_KERNEL);
> -	if (!mhp->dereg_skb) {
> -		ret = -ENOMEM;
> -		goto free_wr_wait;
> -	}
> -
> -	ret = allocate_window(&rhp->rdev, &stag, php->pdid, mhp->wr_waitp);
> -	if (ret)
> -		goto free_skb;
> -
> -	mhp->rhp = rhp;
> -	mhp->attr.pdid = php->pdid;
> -	mhp->attr.type = FW_RI_STAG_MW;

75% of "enum fw_ri_stag_type" can be removed too.

Thanks

  reply	other threads:[~2020-10-05  5:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03 23:20 [PATCH 00/11] Reduce uverbs_cmd_mask and remove uverbs_ex_cmd_mask Jason Gunthorpe
2020-10-03 23:20 ` [PATCH 01/11] RDMA/cxgb4: Remove MW support Jason Gunthorpe
2020-10-05  5:56   ` Leon Romanovsky [this message]
2020-10-05 16:17     ` Jason Gunthorpe
2020-10-09 16:40       ` Potnuri Bharat Teja
2020-10-14 23:27         ` Jason Gunthorpe
2020-10-03 23:20 ` [PATCH 02/11] RDMA: Remove uverbs_ex_cmd_mask values that are linked to functions Jason Gunthorpe
2020-10-04 11:04   ` Gal Pressman
2020-10-05 16:20     ` Jason Gunthorpe
2020-10-03 23:20 ` [PATCH 03/11] RDMA: Remove elements in uverbs_cmd_mask that all drivers set Jason Gunthorpe
2020-10-03 23:20 ` [PATCH 04/11] RDMA: Move more uverbs_cmd_mask settings to the core Jason Gunthorpe
2020-10-03 23:20 ` [PATCH 05/11] RDMA: Check srq_type during create_srq Jason Gunthorpe
2020-10-03 23:20 ` [PATCH 06/11] RDMA: Check attr_mask during modify_qp Jason Gunthorpe
2020-10-04 11:02   ` Gal Pressman
2020-10-05 16:19     ` Jason Gunthorpe
2020-10-03 23:20 ` [PATCH 07/11] RDMA: Check flags during create_cq Jason Gunthorpe
2020-10-06 18:04   ` Saleem, Shiraz
2020-10-06 18:13     ` Jason Gunthorpe
2020-10-06 18:23       ` Saleem, Shiraz
2020-10-03 23:20 ` [PATCH 08/11] RDMA: Check create_flags during create_qp Jason Gunthorpe
2020-10-03 23:20 ` [PATCH 09/11] RDMA/core Remove uverbs_ex_cmd_mask Jason Gunthorpe
2020-10-03 23:20 ` [PATCH 10/11] RDMA: Remove uverbs cmds from drivers that don't use them Jason Gunthorpe
2020-10-03 23:20 ` [PATCH 11/11] RDMA: Remove AH from uverbs_cmd_mask Jason Gunthorpe
2020-10-06 18:32 ` [PATCH 00/11] Reduce uverbs_cmd_mask and remove uverbs_ex_cmd_mask Saleem, Shiraz
2020-10-26 22:39 ` 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=20201005055652.GE9764@unreal \
    --to=leon@kernel.org \
    --cc=bharat@chelsio.com \
    --cc=jgg@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=rpearsonhpe@gmail.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).