All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Gu <guwen@linux.alibaba.com>
To: dust.li@linux.alibaba.com, kgraul@linux.ibm.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 16:55:51 +0800	[thread overview]
Message-ID: <23b607fe-95da-ea8a-8dda-900a51572b90@linux.alibaba.com> (raw)
In-Reply-To: <20220105075408.GC31579@linux.alibaba.com>

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

  reply	other threads:[~2022-01-05  8:55 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 [this message]
2022-01-05 13:25     ` Karsten Graul
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=23b607fe-95da-ea8a-8dda-900a51572b90@linux.alibaba.com \
    --to=guwen@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=kgraul@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.