All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
To: Logan Gunthorpe <logang@deltatee.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Max Gurtovoy <maxg@mellanox.com>,
	Stephen Bates <sbates@raithlin.com>
Subject: Re: [PATCH 7/7] nvmet: Open code nvmet_req_execute()
Date: Wed, 23 Oct 2019 20:34:34 +0000	[thread overview]
Message-ID: <BYAPR04MB57490B2F11504A26F2166862866B0@BYAPR04MB5749.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20191023163545.4193-8-logang@deltatee.com

It doesn't hurt to keep that function, makes code easier to
read and search since it has been used in different places.

Anyways, looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

On 10/23/2019 09:36 AM, Logan Gunthorpe wrote:
> Now that nvmet_req_execute does nothing, open code it.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> [logang@deltatee.com: separated out of a larger draft patch from hch]
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> ---
>   drivers/nvme/target/core.c  | 6 ------
>   drivers/nvme/target/fc.c    | 4 ++--
>   drivers/nvme/target/loop.c  | 2 +-
>   drivers/nvme/target/nvmet.h | 1 -
>   drivers/nvme/target/rdma.c  | 4 ++--
>   drivers/nvme/target/tcp.c   | 6 +++---
>   6 files changed, 8 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
> index 87fe82ccfa89..f7da0e50beeb 100644
> --- a/drivers/nvme/target/core.c
> +++ b/drivers/nvme/target/core.c
> @@ -942,12 +942,6 @@ bool nvmet_check_data_len(struct nvmet_req *req, size_t data_len)
>   }
>   EXPORT_SYMBOL_GPL(nvmet_check_data_len);
>
> -void nvmet_req_execute(struct nvmet_req *req)
> -{
> -	req->execute(req);
> -}
> -EXPORT_SYMBOL_GPL(nvmet_req_execute);
> -
>   int nvmet_req_alloc_sgl(struct nvmet_req *req)
>   {
>   	struct pci_dev *p2p_dev = NULL;
> diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
> index ce8d819f86cc..7f9c11138b93 100644
> --- a/drivers/nvme/target/fc.c
> +++ b/drivers/nvme/target/fc.c
> @@ -2015,7 +2015,7 @@ nvmet_fc_fod_op_done(struct nvmet_fc_fcp_iod *fod)
>   		}
>
>   		/* data transfer complete, resume with nvmet layer */
> -		nvmet_req_execute(&fod->req);
> +		fod->req.execute(&fod->req);
>   		break;
>
>   	case NVMET_FCOP_READDATA:
> @@ -2231,7 +2231,7 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
>   	 * can invoke the nvmet_layer now. If read data, cmd completion will
>   	 * push the data
>   	 */
> -	nvmet_req_execute(&fod->req);
> +	fod->req.execute(&fod->req);
>   	return;
>
>   transport_error:
> diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
> index 11f5aea97d1b..f4b878b113f7 100644
> --- a/drivers/nvme/target/loop.c
> +++ b/drivers/nvme/target/loop.c
> @@ -126,7 +126,7 @@ static void nvme_loop_execute_work(struct work_struct *work)
>   	struct nvme_loop_iod *iod =
>   		container_of(work, struct nvme_loop_iod, work);
>
> -	nvmet_req_execute(&iod->req);
> +	iod->req.execute(&iod->req);
>   }
>
>   static blk_status_t nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx,
> diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
> index ff55f1005b35..46df45e837c9 100644
> --- a/drivers/nvme/target/nvmet.h
> +++ b/drivers/nvme/target/nvmet.h
> @@ -374,7 +374,6 @@ bool nvmet_req_init(struct nvmet_req *req, struct nvmet_cq *cq,
>   		struct nvmet_sq *sq, const struct nvmet_fabrics_ops *ops);
>   void nvmet_req_uninit(struct nvmet_req *req);
>   bool nvmet_check_data_len(struct nvmet_req *req, size_t data_len);
> -void nvmet_req_execute(struct nvmet_req *req);
>   void nvmet_req_complete(struct nvmet_req *req, u16 status);
>   int nvmet_req_alloc_sgl(struct nvmet_req *req);
>   void nvmet_req_free_sgl(struct nvmet_req *req);
> diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
> index 36d906a7f70d..248e68da2e13 100644
> --- a/drivers/nvme/target/rdma.c
> +++ b/drivers/nvme/target/rdma.c
> @@ -603,7 +603,7 @@ static void nvmet_rdma_read_data_done(struct ib_cq *cq, struct ib_wc *wc)
>   		return;
>   	}
>
> -	nvmet_req_execute(&rsp->req);
> +	rsp->req.execute(&rsp->req);
>   }
>
>   static void nvmet_rdma_use_inline_sg(struct nvmet_rdma_rsp *rsp, u32 len,
> @@ -746,7 +746,7 @@ static bool nvmet_rdma_execute_command(struct nvmet_rdma_rsp *rsp)
>   				queue->cm_id->port_num, &rsp->read_cqe, NULL))
>   			nvmet_req_complete(&rsp->req, NVME_SC_DATA_XFER_ERROR);
>   	} else {
> -		nvmet_req_execute(&rsp->req);
> +		rsp->req.execute(&rsp->req);
>   	}
>
>   	return true;
> diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
> index 3378480c49f6..af674fc0bb1e 100644
> --- a/drivers/nvme/target/tcp.c
> +++ b/drivers/nvme/target/tcp.c
> @@ -930,7 +930,7 @@ static int nvmet_tcp_done_recv_pdu(struct nvmet_tcp_queue *queue)
>   		goto out;
>   	}
>
> -	nvmet_req_execute(&queue->cmd->req);
> +	queue->cmd->req.execute(&queue->cmd->req);
>   out:
>   	nvmet_prepare_receive_pdu(queue);
>   	return ret;
> @@ -1050,7 +1050,7 @@ static int nvmet_tcp_try_recv_data(struct nvmet_tcp_queue *queue)
>   			nvmet_tcp_prep_recv_ddgst(cmd);
>   			return 0;
>   		}
> -		nvmet_req_execute(&cmd->req);
> +		cmd->req.execute(&cmd->req);
>   	}
>
>   	nvmet_prepare_receive_pdu(queue);
> @@ -1090,7 +1090,7 @@ static int nvmet_tcp_try_recv_ddgst(struct nvmet_tcp_queue *queue)
>
>   	if (!(cmd->flags & NVMET_TCP_F_INIT_FAILED) &&
>   	    cmd->rbytes_done == cmd->req.transfer_len)
> -		nvmet_req_execute(&cmd->req);
> +		cmd->req.execute(&cmd->req);
>   	ret = 0;
>   out:
>   	nvmet_prepare_receive_pdu(queue);
>


WARNING: multiple messages have this Message-ID (diff)
From: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
To: Logan Gunthorpe <logang@deltatee.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: Max Gurtovoy <maxg@mellanox.com>,
	Stephen Bates <sbates@raithlin.com>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>
Subject: Re: [PATCH 7/7] nvmet: Open code nvmet_req_execute()
Date: Wed, 23 Oct 2019 20:34:34 +0000	[thread overview]
Message-ID: <BYAPR04MB57490B2F11504A26F2166862866B0@BYAPR04MB5749.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20191023163545.4193-8-logang@deltatee.com

It doesn't hurt to keep that function, makes code easier to
read and search since it has been used in different places.

Anyways, looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

On 10/23/2019 09:36 AM, Logan Gunthorpe wrote:
> Now that nvmet_req_execute does nothing, open code it.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> [logang@deltatee.com: separated out of a larger draft patch from hch]
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> ---
>   drivers/nvme/target/core.c  | 6 ------
>   drivers/nvme/target/fc.c    | 4 ++--
>   drivers/nvme/target/loop.c  | 2 +-
>   drivers/nvme/target/nvmet.h | 1 -
>   drivers/nvme/target/rdma.c  | 4 ++--
>   drivers/nvme/target/tcp.c   | 6 +++---
>   6 files changed, 8 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
> index 87fe82ccfa89..f7da0e50beeb 100644
> --- a/drivers/nvme/target/core.c
> +++ b/drivers/nvme/target/core.c
> @@ -942,12 +942,6 @@ bool nvmet_check_data_len(struct nvmet_req *req, size_t data_len)
>   }
>   EXPORT_SYMBOL_GPL(nvmet_check_data_len);
>
> -void nvmet_req_execute(struct nvmet_req *req)
> -{
> -	req->execute(req);
> -}
> -EXPORT_SYMBOL_GPL(nvmet_req_execute);
> -
>   int nvmet_req_alloc_sgl(struct nvmet_req *req)
>   {
>   	struct pci_dev *p2p_dev = NULL;
> diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
> index ce8d819f86cc..7f9c11138b93 100644
> --- a/drivers/nvme/target/fc.c
> +++ b/drivers/nvme/target/fc.c
> @@ -2015,7 +2015,7 @@ nvmet_fc_fod_op_done(struct nvmet_fc_fcp_iod *fod)
>   		}
>
>   		/* data transfer complete, resume with nvmet layer */
> -		nvmet_req_execute(&fod->req);
> +		fod->req.execute(&fod->req);
>   		break;
>
>   	case NVMET_FCOP_READDATA:
> @@ -2231,7 +2231,7 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
>   	 * can invoke the nvmet_layer now. If read data, cmd completion will
>   	 * push the data
>   	 */
> -	nvmet_req_execute(&fod->req);
> +	fod->req.execute(&fod->req);
>   	return;
>
>   transport_error:
> diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
> index 11f5aea97d1b..f4b878b113f7 100644
> --- a/drivers/nvme/target/loop.c
> +++ b/drivers/nvme/target/loop.c
> @@ -126,7 +126,7 @@ static void nvme_loop_execute_work(struct work_struct *work)
>   	struct nvme_loop_iod *iod =
>   		container_of(work, struct nvme_loop_iod, work);
>
> -	nvmet_req_execute(&iod->req);
> +	iod->req.execute(&iod->req);
>   }
>
>   static blk_status_t nvme_loop_queue_rq(struct blk_mq_hw_ctx *hctx,
> diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
> index ff55f1005b35..46df45e837c9 100644
> --- a/drivers/nvme/target/nvmet.h
> +++ b/drivers/nvme/target/nvmet.h
> @@ -374,7 +374,6 @@ bool nvmet_req_init(struct nvmet_req *req, struct nvmet_cq *cq,
>   		struct nvmet_sq *sq, const struct nvmet_fabrics_ops *ops);
>   void nvmet_req_uninit(struct nvmet_req *req);
>   bool nvmet_check_data_len(struct nvmet_req *req, size_t data_len);
> -void nvmet_req_execute(struct nvmet_req *req);
>   void nvmet_req_complete(struct nvmet_req *req, u16 status);
>   int nvmet_req_alloc_sgl(struct nvmet_req *req);
>   void nvmet_req_free_sgl(struct nvmet_req *req);
> diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
> index 36d906a7f70d..248e68da2e13 100644
> --- a/drivers/nvme/target/rdma.c
> +++ b/drivers/nvme/target/rdma.c
> @@ -603,7 +603,7 @@ static void nvmet_rdma_read_data_done(struct ib_cq *cq, struct ib_wc *wc)
>   		return;
>   	}
>
> -	nvmet_req_execute(&rsp->req);
> +	rsp->req.execute(&rsp->req);
>   }
>
>   static void nvmet_rdma_use_inline_sg(struct nvmet_rdma_rsp *rsp, u32 len,
> @@ -746,7 +746,7 @@ static bool nvmet_rdma_execute_command(struct nvmet_rdma_rsp *rsp)
>   				queue->cm_id->port_num, &rsp->read_cqe, NULL))
>   			nvmet_req_complete(&rsp->req, NVME_SC_DATA_XFER_ERROR);
>   	} else {
> -		nvmet_req_execute(&rsp->req);
> +		rsp->req.execute(&rsp->req);
>   	}
>
>   	return true;
> diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
> index 3378480c49f6..af674fc0bb1e 100644
> --- a/drivers/nvme/target/tcp.c
> +++ b/drivers/nvme/target/tcp.c
> @@ -930,7 +930,7 @@ static int nvmet_tcp_done_recv_pdu(struct nvmet_tcp_queue *queue)
>   		goto out;
>   	}
>
> -	nvmet_req_execute(&queue->cmd->req);
> +	queue->cmd->req.execute(&queue->cmd->req);
>   out:
>   	nvmet_prepare_receive_pdu(queue);
>   	return ret;
> @@ -1050,7 +1050,7 @@ static int nvmet_tcp_try_recv_data(struct nvmet_tcp_queue *queue)
>   			nvmet_tcp_prep_recv_ddgst(cmd);
>   			return 0;
>   		}
> -		nvmet_req_execute(&cmd->req);
> +		cmd->req.execute(&cmd->req);
>   	}
>
>   	nvmet_prepare_receive_pdu(queue);
> @@ -1090,7 +1090,7 @@ static int nvmet_tcp_try_recv_ddgst(struct nvmet_tcp_queue *queue)
>
>   	if (!(cmd->flags & NVMET_TCP_F_INIT_FAILED) &&
>   	    cmd->rbytes_done == cmd->req.transfer_len)
> -		nvmet_req_execute(&cmd->req);
> +		cmd->req.execute(&cmd->req);
>   	ret = 0;
>   out:
>   	nvmet_prepare_receive_pdu(queue);
>


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2019-10-23 20:34 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 16:35 [PATCH 0/7] Remove data_len field from the nvmet_req struct Logan Gunthorpe
2019-10-23 16:35 ` Logan Gunthorpe
2019-10-23 16:35 ` [PATCH 1/7] nvmet-tcp: Don't check data_len in nvmet_tcp_map_data() Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-24  1:15   ` Christoph Hellwig
2019-10-24  1:15     ` Christoph Hellwig
2019-10-23 16:35 ` [PATCH 2/7] nvmet-tcp: Don't set the request's data_len Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-24  1:15   ` Christoph Hellwig
2019-10-24  1:15     ` Christoph Hellwig
2019-10-23 16:35 ` [PATCH 3/7] nvmet: Introduce common execute function for get_log_page and identify Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-23 20:31   ` Chaitanya Kulkarni
2019-10-23 20:31     ` Chaitanya Kulkarni
2019-10-24  1:17   ` Christoph Hellwig
2019-10-24  1:17     ` Christoph Hellwig
2019-10-24 17:18     ` Logan Gunthorpe
2019-10-24 17:18       ` Logan Gunthorpe
2019-10-24 22:01       ` Keith Busch
2019-10-24 22:01         ` Keith Busch
2019-10-24 22:40         ` Logan Gunthorpe
2019-10-24 22:40           ` Logan Gunthorpe
2019-10-23 16:35 ` [PATCH 4/7] nvmet: Cleanup discovery execute handlers Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-23 16:35 ` [PATCH 5/7] nvmet: Introduce nvmet_dsm_len() helper Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-23 20:31   ` Chaitanya Kulkarni
2019-10-23 20:31     ` Chaitanya Kulkarni
2019-10-23 16:35 ` [PATCH 6/7] nvmet: Remove the data_len field from the nvmet_req struct Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-23 16:35 ` [PATCH 7/7] nvmet: Open code nvmet_req_execute() Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-23 20:34   ` Chaitanya Kulkarni [this message]
2019-10-23 20:34     ` Chaitanya Kulkarni
2019-10-25  0:20 ` [PATCH 0/7] Remove data_len field from the nvmet_req struct Keith Busch
2019-10-25  0:20   ` Keith Busch

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=BYAPR04MB57490B2F11504A26F2166862866B0@BYAPR04MB5749.namprd04.prod.outlook.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=logang@deltatee.com \
    --cc=maxg@mellanox.com \
    --cc=sagi@grimberg.me \
    --cc=sbates@raithlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.