From: Karsten Graul <kgraul@linux.ibm.com>
To: Wen Gu <guwen@linux.alibaba.com>,
dust.li@linux.alibaba.com, davem@davemloft.net, kuba@kernel.org
Cc: linux-s390@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3] net/smc: Reset conn->lgr when link group registration fails
Date: Wed, 5 Jan 2022 14:25:43 +0100 [thread overview]
Message-ID: <6e2ae46c-5407-ca6a-3353-69e76f10d913@linux.ibm.com> (raw)
In-Reply-To: <23b607fe-95da-ea8a-8dda-900a51572b90@linux.alibaba.com>
On 05/01/2022 09:55, Wen Gu wrote:
> 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.
It might look cleaner with the following changes:
- adopt smc_lgr_cleanup_early() to take only an lgr as parameter and remove the call to smc_conn_free()
- change smc_conn_abort() (which is the only caller of smc_lgr_cleanup_early() right now), always
call smc_conn_free() and if (local_first) additionally call smc_lgr_cleanup_early()
(hold a local copy of the lgr for this call)
- finally call smc_lgr_cleanup_early(lgr) from smc_conn_create()
This should be the same processing, but the smc_conn_free() is moved to smc_conn_abort() where
it looks to be a better place for this call. And smc_lgr_cleanup_early() takes only care of an lgr.
What do you think? Did I miss something?
next prev parent reply other threads:[~2022-01-05 13:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 6:28 [PATCH net v3] net/smc: Reset conn->lgr when link group registration fails Wen Gu
2022-01-05 7:54 ` dust.li
2022-01-05 8:55 ` Wen Gu
2022-01-05 13:25 ` Karsten Graul [this message]
2022-01-06 2:09 ` Wen Gu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6e2ae46c-5407-ca6a-3353-69e76f10d913@linux.ibm.com \
--to=kgraul@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=dust.li@linux.alibaba.com \
--cc=guwen@linux.alibaba.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox