]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net/smc: move wake up of close waiter
authorKarsten Graul <kgraul@linux.ibm.com>
Tue, 12 Feb 2019 15:29:51 +0000 (16:29 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Feb 2019 16:59:44 +0000 (11:59 -0500)
Move the call to smc_close_wake_tx_prepared() (which wakes up a possibly
waiting close processing that might wait for 'all data sent') to
smc_tx_sndbuf_nonempty() (which is the main function to send data).

Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_cdc.c
net/smc/smc_tx.c

index 99d9d6e85dfb074b9d9d825c483c72e14fea1261..780b36c6929267006de7ca3403c6f48047b30435 100644 (file)
@@ -290,8 +290,6 @@ static void smc_cdc_msg_recv_action(struct smc_sock *smc,
        /* trigger sndbuf consumer: RDMA write into peer RMBE and CDC */
        if (diff_cons && smc_tx_prepared_sends(conn)) {
                smc_tx_sndbuf_nonempty(conn);
-               /* trigger socket release if connection closed */
-               smc_close_wake_tx_prepared(smc);
        }
        if (diff_cons && conn->urg_tx_pend &&
            atomic_read(&conn->peer_rmbe_space) == conn->peer_rmbe_size) {
index ce9586bce3645a2a0f8520caf9bd833fe4093c8c..dd10a913b38e73aa24e6555512335e91db7cf633 100644 (file)
@@ -24,6 +24,7 @@
 #include "smc.h"
 #include "smc_wr.h"
 #include "smc_cdc.h"
+#include "smc_close.h"
 #include "smc_ism.h"
 #include "smc_tx.h"
 
@@ -554,6 +555,12 @@ int smc_tx_sndbuf_nonempty(struct smc_connection *conn)
        else
                rc = smcr_tx_sndbuf_nonempty(conn);
 
+       if (!rc) {
+               /* trigger socket release if connection is closing */
+               struct smc_sock *smc = container_of(conn, struct smc_sock,
+                                                   conn);
+               smc_close_wake_tx_prepared(smc);
+       }
        return rc;
 }