diff mbox series

[net,1/2] net/smc: Scan from current RMB list when no position specified

Message ID 1685101741-74826-2-git-send-email-guwen@linux.alibaba.com (mailing list archive)
State Accepted
Commit b24aa141c2ff26c919237aee61ea1818fc6780d9
Delegated to: Netdev Maintainers
Headers show
Series Two fixes for SMCRv2 | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Wen Gu May 26, 2023, 11:49 a.m. UTC
When finding the first RMB of link group, it should start from the
current RMB list whose index is 0. So fix it.

Fixes: b4ba4652b3f8 ("net/smc: extend LLC layer for SMC-Rv2")
Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
---
 net/smc/smc_llc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Wenjia Zhang May 30, 2023, 8:08 p.m. UTC | #1
On 26.05.23 13:49, Wen Gu wrote:
> When finding the first RMB of link group, it should start from the
> current RMB list whose index is 0. So fix it.
> 
> Fixes: b4ba4652b3f8 ("net/smc: extend LLC layer for SMC-Rv2")
> Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
> ---
>   net/smc/smc_llc.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
> index a0840b8..8423e8e 100644
> --- a/net/smc/smc_llc.c
> +++ b/net/smc/smc_llc.c
> @@ -578,7 +578,10 @@ static struct smc_buf_desc *smc_llc_get_next_rmb(struct smc_link_group *lgr,
>   {
>   	struct smc_buf_desc *buf_next;
>   
> -	if (!buf_pos || list_is_last(&buf_pos->list, &lgr->rmbs[*buf_lst])) {
> +	if (!buf_pos)
> +		return _smc_llc_get_next_rmb(lgr, buf_lst);
> +
> +	if (list_is_last(&buf_pos->list, &lgr->rmbs[*buf_lst])) {
>   		(*buf_lst)++;
>   		return _smc_llc_get_next_rmb(lgr, buf_lst);
>   	}
It seems too late, but still, why not? :

-	if (!buf_pos || list_is_last(&buf_pos->list, &lgr->rmbs[*buf_lst])) {
-  		(*buf_lst)++;
+	if (list_is_last(&buf_pos->list, &lgr->rmbs[(*buf_lst])++)) {


Thanks,
Wenjia
diff mbox series

Patch

diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
index a0840b8..8423e8e 100644
--- a/net/smc/smc_llc.c
+++ b/net/smc/smc_llc.c
@@ -578,7 +578,10 @@  static struct smc_buf_desc *smc_llc_get_next_rmb(struct smc_link_group *lgr,
 {
 	struct smc_buf_desc *buf_next;
 
-	if (!buf_pos || list_is_last(&buf_pos->list, &lgr->rmbs[*buf_lst])) {
+	if (!buf_pos)
+		return _smc_llc_get_next_rmb(lgr, buf_lst);
+
+	if (list_is_last(&buf_pos->list, &lgr->rmbs[*buf_lst])) {
 		(*buf_lst)++;
 		return _smc_llc_get_next_rmb(lgr, buf_lst);
 	}