linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] IB/iser: remove unused macros
@ 2023-03-30 13:13 Max Gurtovoy
  2023-03-30 13:13 ` [PATCH 2/3] IB/iser: centralize setting desc type and done callback Max Gurtovoy
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Max Gurtovoy @ 2023-03-30 13:13 UTC (permalink / raw)
  To: sagi, leonro, linux-rdma, jgg; +Cc: israelr, oren, sergeygo, Max Gurtovoy

The removed macros are old leftovers.

Reviewed-by: Sergey Gorenko <sergeygo@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/infiniband/ulp/iser/iser_verbs.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
index 1b8eda0dae4e..95b8eebf7e04 100644
--- a/drivers/infiniband/ulp/iser/iser_verbs.c
+++ b/drivers/infiniband/ulp/iser/iser_verbs.c
@@ -37,12 +37,6 @@
 
 #include "iscsi_iser.h"
 
-#define ISCSI_ISER_MAX_CONN	8
-#define ISER_MAX_RX_LEN		(ISER_QP_MAX_RECV_DTOS * ISCSI_ISER_MAX_CONN)
-#define ISER_MAX_TX_LEN		(ISER_QP_MAX_REQ_DTOS  * ISCSI_ISER_MAX_CONN)
-#define ISER_MAX_CQ_LEN		(ISER_MAX_RX_LEN + ISER_MAX_TX_LEN + \
-				 ISCSI_ISER_MAX_CONN)
-
 static void iser_qp_event_callback(struct ib_event *cause, void *context)
 {
 	iser_err("qp event %s (%d)\n",
-- 
2.18.1


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

* [PATCH 2/3] IB/iser: centralize setting desc type and done callback
  2023-03-30 13:13 [PATCH 1/3] IB/iser: remove unused macros Max Gurtovoy
@ 2023-03-30 13:13 ` Max Gurtovoy
  2023-03-30 13:51   ` Sagi Grimberg
  2023-03-30 13:13 ` [PATCH 3/3] IB/iser: remove redundant new line Max Gurtovoy
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Max Gurtovoy @ 2023-03-30 13:13 UTC (permalink / raw)
  To: sagi, leonro, linux-rdma, jgg; +Cc: israelr, oren, sergeygo, Max Gurtovoy

Move this common logic into iser_create_send_desc instead of duplicating
the code.

Reviewed-by: Sergey Gorenko <sergeygo@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/infiniband/ulp/iser/iser_initiator.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index 7b83f48f60c5..354928408399 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -141,10 +141,14 @@ static int iser_prepare_write_cmd(struct iscsi_task *task, unsigned int imm_sz,
 
 /* creates a new tx descriptor and adds header regd buffer */
 static void iser_create_send_desc(struct iser_conn *iser_conn,
-				  struct iser_tx_desc *tx_desc)
+		struct iser_tx_desc *tx_desc, enum iser_desc_type type,
+		void (*done)(struct ib_cq *cq, struct ib_wc *wc))
 {
 	struct iser_device *device = iser_conn->ib_conn.device;
 
+	tx_desc->type = type;
+	tx_desc->cqe.done = done;
+
 	ib_dma_sync_single_for_cpu(device->ib_device,
 		tx_desc->dma_addr, ISER_HEADERS_LEN, DMA_TO_DEVICE);
 
@@ -349,9 +353,8 @@ int iser_send_command(struct iscsi_conn *conn, struct iscsi_task *task)
 	edtl = ntohl(hdr->data_length);
 
 	/* build the tx desc regd header and add it to the tx desc dto */
-	tx_desc->type = ISCSI_TX_SCSI_COMMAND;
-	tx_desc->cqe.done = iser_cmd_comp;
-	iser_create_send_desc(iser_conn, tx_desc);
+	iser_create_send_desc(iser_conn, tx_desc, ISCSI_TX_SCSI_COMMAND,
+			      iser_cmd_comp);
 
 	if (hdr->flags & ISCSI_FLAG_CMD_READ) {
 		data_buf = &iser_task->data[ISER_DIR_IN];
@@ -478,9 +481,8 @@ int iser_send_control(struct iscsi_conn *conn, struct iscsi_task *task)
 	struct iser_device *device;
 
 	/* build the tx desc regd header and add it to the tx desc dto */
-	mdesc->type = ISCSI_TX_CONTROL;
-	mdesc->cqe.done = iser_ctrl_comp;
-	iser_create_send_desc(iser_conn, mdesc);
+	iser_create_send_desc(iser_conn, mdesc, ISCSI_TX_CONTROL,
+			      iser_ctrl_comp);
 
 	device = iser_conn->ib_conn.device;
 
-- 
2.18.1


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

* [PATCH 3/3] IB/iser: remove redundant new line
  2023-03-30 13:13 [PATCH 1/3] IB/iser: remove unused macros Max Gurtovoy
  2023-03-30 13:13 ` [PATCH 2/3] IB/iser: centralize setting desc type and done callback Max Gurtovoy
@ 2023-03-30 13:13 ` Max Gurtovoy
  2023-03-30 13:52   ` Sagi Grimberg
  2023-03-30 13:51 ` [PATCH 1/3] IB/iser: remove unused macros Sagi Grimberg
  2023-04-03 12:40 ` Leon Romanovsky
  3 siblings, 1 reply; 7+ messages in thread
From: Max Gurtovoy @ 2023-03-30 13:13 UTC (permalink / raw)
  To: sagi, leonro, linux-rdma, jgg; +Cc: israelr, oren, sergeygo, Max Gurtovoy

This commit doesn't change any logic.

Reviewed-by: Sergey Gorenko <sergeygo@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/infiniband/ulp/iser/iser_initiator.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c
index 354928408399..39ea73f69016 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -460,7 +460,6 @@ int iser_send_data_out(struct iscsi_conn *conn, struct iscsi_task *task,
 	iser_dbg("data-out itt: %d, offset: %ld, sz: %ld\n",
 		 itt, buf_offset, data_seg_len);
 
-
 	err = iser_post_send(&iser_conn->ib_conn, tx_desc);
 	if (!err)
 		return 0;
-- 
2.18.1


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

* Re: [PATCH 1/3] IB/iser: remove unused macros
  2023-03-30 13:13 [PATCH 1/3] IB/iser: remove unused macros Max Gurtovoy
  2023-03-30 13:13 ` [PATCH 2/3] IB/iser: centralize setting desc type and done callback Max Gurtovoy
  2023-03-30 13:13 ` [PATCH 3/3] IB/iser: remove redundant new line Max Gurtovoy
@ 2023-03-30 13:51 ` Sagi Grimberg
  2023-04-03 12:40 ` Leon Romanovsky
  3 siblings, 0 replies; 7+ messages in thread
From: Sagi Grimberg @ 2023-03-30 13:51 UTC (permalink / raw)
  To: Max Gurtovoy, leonro, linux-rdma, jgg; +Cc: israelr, oren, sergeygo

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

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

* Re: [PATCH 2/3] IB/iser: centralize setting desc type and done callback
  2023-03-30 13:13 ` [PATCH 2/3] IB/iser: centralize setting desc type and done callback Max Gurtovoy
@ 2023-03-30 13:51   ` Sagi Grimberg
  0 siblings, 0 replies; 7+ messages in thread
From: Sagi Grimberg @ 2023-03-30 13:51 UTC (permalink / raw)
  To: Max Gurtovoy, leonro, linux-rdma, jgg; +Cc: israelr, oren, sergeygo

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

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

* Re: [PATCH 3/3] IB/iser: remove redundant new line
  2023-03-30 13:13 ` [PATCH 3/3] IB/iser: remove redundant new line Max Gurtovoy
@ 2023-03-30 13:52   ` Sagi Grimberg
  0 siblings, 0 replies; 7+ messages in thread
From: Sagi Grimberg @ 2023-03-30 13:52 UTC (permalink / raw)
  To: Max Gurtovoy, leonro, linux-rdma, jgg; +Cc: israelr, oren, sergeygo

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

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

* Re: [PATCH 1/3] IB/iser: remove unused macros
  2023-03-30 13:13 [PATCH 1/3] IB/iser: remove unused macros Max Gurtovoy
                   ` (2 preceding siblings ...)
  2023-03-30 13:51 ` [PATCH 1/3] IB/iser: remove unused macros Sagi Grimberg
@ 2023-04-03 12:40 ` Leon Romanovsky
  3 siblings, 0 replies; 7+ messages in thread
From: Leon Romanovsky @ 2023-04-03 12:40 UTC (permalink / raw)
  To: sagi, linux-rdma, Leon Romanovsky, Jason Gunthorpe, Max Gurtovoy
  Cc: israelr, oren, sergeygo


On Thu, 30 Mar 2023 16:13:31 +0300, Max Gurtovoy wrote:
> The removed macros are old leftovers.
> 
> 

Applied, thanks!

[1/3] IB/iser: remove unused macros
      https://git.kernel.org/rdma/rdma/c/b7727e231dad51
[2/3] IB/iser: centralize setting desc type and done callback
      https://git.kernel.org/rdma/rdma/c/92363895b6c31b
[3/3] IB/iser: remove redundant new line
      https://git.kernel.org/rdma/rdma/c/070fc1c0e272a0

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>

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

end of thread, other threads:[~2023-04-03 12:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-30 13:13 [PATCH 1/3] IB/iser: remove unused macros Max Gurtovoy
2023-03-30 13:13 ` [PATCH 2/3] IB/iser: centralize setting desc type and done callback Max Gurtovoy
2023-03-30 13:51   ` Sagi Grimberg
2023-03-30 13:13 ` [PATCH 3/3] IB/iser: remove redundant new line Max Gurtovoy
2023-03-30 13:52   ` Sagi Grimberg
2023-03-30 13:51 ` [PATCH 1/3] IB/iser: remove unused macros Sagi Grimberg
2023-04-03 12:40 ` Leon Romanovsky

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