summaryrefslogtreecommitdiff
path: root/net/smc
diff options
context:
space:
mode:
authorWen Gu <guwen@linux.alibaba.com>2023-05-26 19:49:00 +0800
committerPaolo Abeni <pabeni@redhat.com>2023-05-30 11:26:32 +0200
commitb24aa141c2ff26c919237aee61ea1818fc6780d9 (patch)
tree4164cf0a51027cf65cbe2614a0da26a2ddf7c0b2 /net/smc
parent020c69c1a793ed29d28793808eddd75210c858dd (diff)
net/smc: Scan from current RMB list when no position specified
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> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/smc')
-rw-r--r--net/smc/smc_llc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/smc/smc_llc.c b/net/smc/smc_llc.c
index a0840b8c935b..8423e8e0063f 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);
}