Skip to content

Commit f8e9bd3

Browse files
committed
Merge branch 'smc-fix'
D. Wythe says: ==================== fix unexpected SMC_CLC_DECL_ERR_REGRMB error We can easily trigger the SMC_CLC_DECL_ERR_REGRMB exception within following script: server: smc_run nginx client: smc_run ./wrk -c 2000 -t 8 -d 20 http://smc-server And we can clearly see that this error is also divided into two types: 1. 0x09990003 2. 0x05000000/0x09990003 Which has the same root causes, but the immediate causes vary. The root cause of this issues is that remove connections from link group is not synchronous with add/delete rtoken entry, which means that even the number of connections is less that SMC_RMBS_PER_LGR_MAX, it does not mean that the connection can register rtoken successfully later. In other words, the rtoken entry may released, This will cause an unexpected SMC_CLC_DECL_ERR_REGRMB to be reported, and then this SMC connections have to fallback to TCP. This patch set handles two types of SMC_CLC_DECL_ERR_REGRMB exceptions from different perspectives. Patch 1: fix the 0x05000000/0x09990003 error. Patch 2: fix the 0x09990003 error. After those patches, there is no SMC_CLC_DECL_ERR_REGRMB exceptions in my test case any more. v1 -> v2: - add bugfix patch for SMC_CLC_DECL_ERR_REGRMB cause by server side v2 -> v3: - fix incorrect mail thread ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents bd6f1fd + 4940a1f commit f8e9bd3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

net/smc/smc_core.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,8 +1161,8 @@ void smc_conn_free(struct smc_connection *conn)
11611161
cancel_work_sync(&conn->abort_work);
11621162
}
11631163
if (!list_empty(&lgr->list)) {
1164-
smc_lgr_unregister_conn(conn);
11651164
smc_buf_unuse(conn, lgr); /* allow buffer reuse */
1165+
smc_lgr_unregister_conn(conn);
11661166
}
11671167

11681168
if (!lgr->conns_num)
@@ -1864,7 +1864,8 @@ int smc_conn_create(struct smc_sock *smc, struct smc_init_info *ini)
18641864
(ini->smcd_version == SMC_V2 ||
18651865
lgr->vlan_id == ini->vlan_id) &&
18661866
(role == SMC_CLNT || ini->is_smcd ||
1867-
lgr->conns_num < SMC_RMBS_PER_LGR_MAX)) {
1867+
(lgr->conns_num < SMC_RMBS_PER_LGR_MAX &&
1868+
!bitmap_full(lgr->rtokens_used_mask, SMC_RMBS_PER_LGR_MAX)))) {
18681869
/* link group found */
18691870
ini->first_contact_local = 0;
18701871
conn->lgr = lgr;

0 commit comments

Comments
 (0)