Skip to content

Commit 433dc0e

Browse files
mgurtovoyjgunthorpe
authored andcommitted
IB/iser: Don't suppress send completions
In order to complete a scsi command and guarantee that the HCA will never perform an access violation when retrying a send operation we must complete a scsi request only when both send and receive completions has arrived. This is a preparation commit that remove the send completions suppression. Next step will be taking care of the local invalidation mechanism and adding a reference counter for commands. Currently, we don't do anything upon getting the send completion and just "consume" it. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Max Gurtovoy <[email protected]> Reviewed-by: Israel Rukshin <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent cf9962c commit 433dc0e

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

drivers/infiniband/ulp/iser/iscsi_iser.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@
146146
- ISER_MAX_RX_MISC_PDUS) / \
147147
(1 + ISER_INFLIGHT_DATAOUTS))
148148

149-
#define ISER_SIGNAL_CMD_COUNT 32
150-
151149
/* Constant PDU lengths calculations */
152150
#define ISER_HEADERS_LEN (sizeof(struct iser_ctrl) + sizeof(struct iscsi_hdr))
153151

@@ -364,7 +362,6 @@ struct iser_fr_pool {
364362
* @qp: Connection Queue-pair
365363
* @cq: Connection completion queue
366364
* @cq_size: The number of max outstanding completions
367-
* @sig_count: send work request signal count
368365
* @device: reference to iser device
369366
* @fr_pool: connection fast registration poool
370367
* @pi_support: Indicate device T10-PI support
@@ -375,7 +372,6 @@ struct ib_conn {
375372
struct ib_qp *qp;
376373
struct ib_cq *cq;
377374
u32 cq_size;
378-
u8 sig_count;
379375
struct iser_device *device;
380376
struct iser_fr_pool fr_pool;
381377
bool pi_support;
@@ -532,8 +528,7 @@ int iser_connect(struct iser_conn *iser_conn,
532528
int iser_post_recvl(struct iser_conn *iser_conn);
533529
int iser_post_recvm(struct iser_conn *iser_conn,
534530
struct iser_rx_desc *rx_desc);
535-
int iser_post_send(struct ib_conn *ib_conn, struct iser_tx_desc *tx_desc,
536-
bool signal);
531+
int iser_post_send(struct ib_conn *ib_conn, struct iser_tx_desc *tx_desc);
537532

538533
int iser_dma_map_task_data(struct iscsi_iser_task *iser_task,
539534
struct iser_data_buf *data,

drivers/infiniband/ulp/iser/iser_initiator.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,6 @@ static int iser_post_rx_bufs(struct iscsi_conn *conn, struct iscsi_hdr *req)
350350
return err;
351351
}
352352

353-
static inline bool iser_signal_comp(u8 sig_count)
354-
{
355-
return ((sig_count % ISER_SIGNAL_CMD_COUNT) == 0);
356-
}
357-
358353
/**
359354
* iser_send_command - send command PDU
360355
* @conn: link to matching iscsi connection
@@ -371,7 +366,6 @@ int iser_send_command(struct iscsi_conn *conn,
371366
struct iscsi_scsi_req *hdr = (struct iscsi_scsi_req *)task->hdr;
372367
struct scsi_cmnd *sc = task->sc;
373368
struct iser_tx_desc *tx_desc = &iser_task->desc;
374-
u8 sig_count = ++iser_conn->ib_conn.sig_count;
375369

376370
edtl = ntohl(hdr->data_length);
377371

@@ -418,8 +412,7 @@ int iser_send_command(struct iscsi_conn *conn,
418412

419413
iser_task->status = ISER_TASK_STATUS_STARTED;
420414

421-
err = iser_post_send(&iser_conn->ib_conn, tx_desc,
422-
iser_signal_comp(sig_count));
415+
err = iser_post_send(&iser_conn->ib_conn, tx_desc);
423416
if (!err)
424417
return 0;
425418

@@ -487,7 +480,7 @@ int iser_send_data_out(struct iscsi_conn *conn,
487480
itt, buf_offset, data_seg_len);
488481

489482

490-
err = iser_post_send(&iser_conn->ib_conn, tx_desc, true);
483+
err = iser_post_send(&iser_conn->ib_conn, tx_desc);
491484
if (!err)
492485
return 0;
493486

@@ -550,7 +543,7 @@ int iser_send_control(struct iscsi_conn *conn,
550543
goto send_control_error;
551544
}
552545

553-
err = iser_post_send(&iser_conn->ib_conn, mdesc, true);
546+
err = iser_post_send(&iser_conn->ib_conn, mdesc);
554547
if (!err)
555548
return 0;
556549

drivers/infiniband/ulp/iser/iser_verbs.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -871,12 +871,10 @@ int iser_post_recvm(struct iser_conn *iser_conn, struct iser_rx_desc *rx_desc)
871871
* iser_post_send - Initiate a Send DTO operation
872872
* @ib_conn: connection RDMA resources
873873
* @tx_desc: iSER TX descriptor
874-
* @signal: true to send work request as SIGNALED
875874
*
876875
* Return: 0 on success, -1 on failure
877876
*/
878-
int iser_post_send(struct ib_conn *ib_conn, struct iser_tx_desc *tx_desc,
879-
bool signal)
877+
int iser_post_send(struct ib_conn *ib_conn, struct iser_tx_desc *tx_desc)
880878
{
881879
struct ib_send_wr *wr = &tx_desc->send_wr;
882880
struct ib_send_wr *first_wr;
@@ -891,7 +889,7 @@ int iser_post_send(struct ib_conn *ib_conn, struct iser_tx_desc *tx_desc,
891889
wr->sg_list = tx_desc->tx_sg;
892890
wr->num_sge = tx_desc->num_sge;
893891
wr->opcode = IB_WR_SEND;
894-
wr->send_flags = signal ? IB_SEND_SIGNALED : 0;
892+
wr->send_flags = IB_SEND_SIGNALED;
895893

896894
if (tx_desc->inv_wr.next)
897895
first_wr = &tx_desc->inv_wr;

0 commit comments

Comments
 (0)