Thread (7 messages) flat view 7 messages, 3 authors, 2018-05-17

Re: [PATCH net-next] net/smc: init conn.tx_work & conn.send_lock sooner

From: Ursula Braun <hidden>
Date: 2018-05-17 16:31:20
Also in: linux-s390


On 05/17/2018 05:28 PM, Eric Dumazet wrote:
On Thu, May 17, 2018 at 6:58 AM Ursula Braun [off-list ref] wrote:


quoted
On 05/17/2018 02:20 PM, Eric Dumazet wrote:
quoted
On Thu, May 17, 2018 at 5:13 AM Ursula Braun [off-list ref]
wrote:
quoted
quoted
quoted
This problem should no longer show up with yesterday's net-next commit
569bc6436568 ("net/smc: no tx work trigger for fallback sockets").
It definitely triggers on latest net-next, which includes 569bc6436568

Thanks.
quoted
Sorry, my fault.
quoted
Your proposed patch solves the problem. On the other hand the purpose of
smc_tx_init() has been to cover tx-related socket initializations needed
for
quoted
connection sockets only. tx_work is something that should be scheduled
only
quoted
for active connection sockets in non-fallback mode.
Thus I prefer this alternate patch to solve the problem:
quoted
---
  net/smc/af_smc.c |    8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
quoted
--- a/net/smc/af_smc.c
+++ b/net/smc/af_smc.c
@@ -1362,14 +1362,18 @@ static int smc_setsockopt(struct socket
                 }
                 break;
         case TCP_NODELAY:
-               if (sk->sk_state != SMC_INIT && sk->sk_state !=
SMC_LISTEN) {
quoted
+               if (sk->sk_state != SMC_INIT &&
+                   sk->sk_state != SMC_LISTEN &&
+                   sk->sk_state != SMC_CLOSED) {
                         if (val && !smc->use_fallback)
                                 mod_delayed_work(system_wq,
&smc->conn.tx_work,
quoted
                                                  0);
                 }
                 break;
         case TCP_CORK:
-               if (sk->sk_state != SMC_INIT && sk->sk_state !=
SMC_LISTEN) {
quoted
+               if (sk->sk_state != SMC_INIT &&
+                   sk->sk_state != SMC_LISTEN &&
+                   sk->sk_state != SMC_CLOSED) {
                         if (!val && !smc->use_fallback)
                                 mod_delayed_work(system_wq,
&smc->conn.tx_work,
quoted
                                                  0);
quoted
What do you think?
I think my patch is cleaner.

Deferring spinlock and workqueues setup is a recipe for disaster.
If your solution is preferred, I agree. In this case my today's net/smc patch
   net/smc: initialize tx_work before llc initial handshake
for the net-tree is obsolete.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help