Re: [PATCH net v3] net/smc: Reset conn->lgr when link group registration fails

From: Wen Gu
Date: Wed Jan 05 2022 - 03:55:58 EST


Thanks for your suggestion.

On 2022/1/5 3:54 pm, dust.li wrote:

- if (rc)
+ if (rc) {
+ spin_lock_bh(lgr_lock);
+ if (!list_empty(&lgr->list))
+ list_del_init(&lgr->list);
+ spin_unlock_bh(lgr_lock);
+ __smc_lgr_terminate(lgr, true);

What about adding a smc_lgr_terminate() wrapper and put list_del_init()
and __smc_lgr_terminate() into it ?

Adding a new wrapper is a good idea. But I think the logic here is relatively simple.
So instead of wrapping them, I coded them like what smc_lgr_cleanup_early() does.

Thanks,
Wen Gu


goto out;
+ }
}
conn->local_tx_ctrl.common.type = SMC_CDC_MSG_TYPE;
conn->local_tx_ctrl.len = SMC_WR_TX_SIZE;
--
1.8.3.1