Skip to content

Commit a8e9703

Browse files
metze-sambasmfrench
authored andcommitted
smb: client: make use of ib_wc_status_msg() and skip IB_WC_WR_FLUSH_ERR logging
There's no need to get log message for every IB_WC_WR_FLUSH_ERR completion, but any other error should be logged at level ERR. Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: Long Li <longli@microsoft.com> Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 02548c4 commit a8e9703

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

fs/smb/client/smbdirect.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -415,8 +415,8 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc)
415415
struct smbd_connection *info =
416416
container_of(sc, struct smbd_connection, socket);
417417

418-
log_rdma_send(INFO, "smbdirect_send_io 0x%p completed wc->status=%d\n",
419-
request, wc->status);
418+
log_rdma_send(INFO, "smbdirect_send_io 0x%p completed wc->status=%s\n",
419+
request, ib_wc_status_msg(wc->status));
420420

421421
for (i = 0; i < request->num_sge; i++)
422422
ib_dma_unmap_single(sc->ib.dev,
@@ -425,8 +425,9 @@ static void send_done(struct ib_cq *cq, struct ib_wc *wc)
425425
DMA_TO_DEVICE);
426426

427427
if (wc->status != IB_WC_SUCCESS || wc->opcode != IB_WC_SEND) {
428-
log_rdma_send(ERR, "wc->status=%d wc->opcode=%d\n",
429-
wc->status, wc->opcode);
428+
if (wc->status != IB_WC_WR_FLUSH_ERR)
429+
log_rdma_send(ERR, "wc->status=%s wc->opcode=%d\n",
430+
ib_wc_status_msg(wc->status), wc->opcode);
430431
mempool_free(request, sc->send_io.mem.pool);
431432
smbd_disconnect_rdma_connection(info);
432433
return;
@@ -596,13 +597,16 @@ static void recv_done(struct ib_cq *cq, struct ib_wc *wc)
596597
u32 remaining_data_length = 0;
597598
bool negotiate_done = false;
598599

599-
log_rdma_recv(INFO, "response=0x%p type=%d wc status=%d wc opcode %d byte_len=%d pkey_index=%u\n",
600-
response, sc->recv_io.expected, wc->status, wc->opcode,
600+
log_rdma_recv(INFO,
601+
"response=0x%p type=%d wc status=%s wc opcode %d byte_len=%d pkey_index=%u\n",
602+
response, sc->recv_io.expected,
603+
ib_wc_status_msg(wc->status), wc->opcode,
601604
wc->byte_len, wc->pkey_index);
602605

603606
if (wc->status != IB_WC_SUCCESS || wc->opcode != IB_WC_RECV) {
604-
log_rdma_recv(INFO, "wc->status=%d opcode=%d\n",
605-
wc->status, wc->opcode);
607+
if (wc->status != IB_WC_WR_FLUSH_ERR)
608+
log_rdma_recv(ERR, "wc->status=%s opcode=%d\n",
609+
ib_wc_status_msg(wc->status), wc->opcode);
606610
goto error;
607611
}
608612

0 commit comments

Comments
 (0)