diff options
Diffstat (limited to 'net/smc/smc_core.c')
-rw-r--r-- | net/smc/smc_core.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c index 1a16d51e2330..20b66e79c5d6 100644 --- a/net/smc/smc_core.c +++ b/net/smc/smc_core.c | |||
@@ -25,8 +25,9 @@ | |||
25 | #include "smc_cdc.h" | 25 | #include "smc_cdc.h" |
26 | #include "smc_close.h" | 26 | #include "smc_close.h" |
27 | 27 | ||
28 | #define SMC_LGR_NUM_INCR 256 | 28 | #define SMC_LGR_NUM_INCR 256 |
29 | #define SMC_LGR_FREE_DELAY (600 * HZ) | 29 | #define SMC_LGR_FREE_DELAY_SERV (600 * HZ) |
30 | #define SMC_LGR_FREE_DELAY_CLNT (SMC_LGR_FREE_DELAY_SERV + 10) | ||
30 | 31 | ||
31 | static u32 smc_lgr_num; /* unique link group number */ | 32 | static u32 smc_lgr_num; /* unique link group number */ |
32 | 33 | ||
@@ -107,8 +108,15 @@ static void smc_lgr_unregister_conn(struct smc_connection *conn) | |||
107 | __smc_lgr_unregister_conn(conn); | 108 | __smc_lgr_unregister_conn(conn); |
108 | } | 109 | } |
109 | write_unlock_bh(&lgr->conns_lock); | 110 | write_unlock_bh(&lgr->conns_lock); |
110 | if (reduced && !lgr->conns_num) | 111 | if (!reduced || lgr->conns_num) |
111 | schedule_delayed_work(&lgr->free_work, SMC_LGR_FREE_DELAY); | 112 | return; |
113 | /* client link group creation always follows the server link group | ||
114 | * creation. For client use a somewhat higher removal delay time, | ||
115 | * otherwise there is a risk of out-of-sync link groups. | ||
116 | */ | ||
117 | mod_delayed_work(system_wq, &lgr->free_work, | ||
118 | lgr->role == SMC_CLNT ? SMC_LGR_FREE_DELAY_CLNT : | ||
119 | SMC_LGR_FREE_DELAY_SERV); | ||
112 | } | 120 | } |
113 | 121 | ||
114 | static void smc_lgr_free_work(struct work_struct *work) | 122 | static void smc_lgr_free_work(struct work_struct *work) |