Skip to contentSkip to conversation

IB/iser: remove unused macros

PATCH Applied Max Gurtovoy 3 participants 7 messages Mar 30, 2023 – Apr 3, 2023

Subsystems (2)
lore
Share & tools
lore

Max Gurtovoy

author maintainer
#0 lore raw

PATCH 1/3 IB/iser: remove unused macros

The removed macros are old leftovers.

---
 drivers/infiniband/ulp/iser/iser_verbs.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/infiniband/ulp/iser/iser_verbs.c +0 -6
index 1b8eda0dae4e..95b8eebf7e04 100644
@@ -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",
Signature · 1 line
2.18.1
author maintainer
#1 lore raw

PATCH 2/3 IB/iser: centralize setting desc type and done callback

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

---
 drivers/infiniband/ulp/iser/iser_initiator.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/infiniband/ulp/iser/iser_initiator.c +9 -7
index 7b83f48f60c5..354928408399 100644
@@ -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;
 
Signature · 1 line
2.18.1
author maintainer
#3 lore raw

PATCH 3/3 IB/iser: remove redundant new line

In reply to Max Gurtovoy

This commit doesn't change any logic.

---
 drivers/infiniband/ulp/iser/iser_initiator.c | 1 -
 1 file changed, 1 deletion(-)
drivers/infiniband/ulp/iser/iser_initiator.c +0 -1
index 354928408399..39ea73f69016 100644
@@ -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;
Signature · 1 line
2.18.1
#6 lore raw
In reply to Max Gurtovoy
Quoted 3 lines · Max Gurtovoy

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,

Signature · 1 line
Leon Romanovsky <[email protected]>