]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb: client: pass struct smbdirect_socket to smbd_qp_async_error_upcall()
authorStefan Metzmacher <metze@samba.org>
Fri, 22 Aug 2025 09:08:13 +0000 (11:08 +0200)
committerSteve French <stfrench@microsoft.com>
Sun, 28 Sep 2025 23:29:50 +0000 (18:29 -0500)
This will make it easier to move function to the common code
in future.

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>
fs/smb/client/smbdirect.c

index 90bfb998684898e972e2ec8d7e88b13afaa799b4..dd1722443365eb56ce911478bccbe5581b803be4 100644 (file)
@@ -386,11 +386,10 @@ static int smbd_conn_upcall(
 static void
 smbd_qp_async_error_upcall(struct ib_event *event, void *context)
 {
-       struct smbd_connection *info = context;
-       struct smbdirect_socket *sc = &info->socket;
+       struct smbdirect_socket *sc = context;
 
-       log_rdma_event(ERR, "%s on device %s info %p\n",
-               ib_event_msg(event->event), event->device->name, info);
+       log_rdma_event(ERR, "%s on device %s socket %p\n",
+               ib_event_msg(event->event), event->device->name, sc);
 
        switch (event->event) {
        case IB_EVENT_CQ_ERR:
@@ -1779,7 +1778,7 @@ static struct smbd_connection *_smbd_get_connection(
        }
 
        sc->ib.send_cq =
-               ib_alloc_cq_any(sc->ib.dev, info,
+               ib_alloc_cq_any(sc->ib.dev, sc,
                                sp->send_credit_target, IB_POLL_SOFTIRQ);
        if (IS_ERR(sc->ib.send_cq)) {
                sc->ib.send_cq = NULL;
@@ -1787,7 +1786,7 @@ static struct smbd_connection *_smbd_get_connection(
        }
 
        sc->ib.recv_cq =
-               ib_alloc_cq_any(sc->ib.dev, info,
+               ib_alloc_cq_any(sc->ib.dev, sc,
                                sp->recv_credit_max, IB_POLL_SOFTIRQ);
        if (IS_ERR(sc->ib.recv_cq)) {
                sc->ib.recv_cq = NULL;
@@ -1796,7 +1795,7 @@ static struct smbd_connection *_smbd_get_connection(
 
        memset(&qp_attr, 0, sizeof(qp_attr));
        qp_attr.event_handler = smbd_qp_async_error_upcall;
-       qp_attr.qp_context = info;
+       qp_attr.qp_context = sc;
        qp_attr.cap.max_send_wr = sp->send_credit_target;
        qp_attr.cap.max_recv_wr = sp->recv_credit_max;
        qp_attr.cap.max_send_sge = SMBDIRECT_SEND_IO_MAX_SGE;