Skip to content

Commit

Permalink
net/smc: Scan from current RMB list when no position specified
Browse files Browse the repository at this point in the history
When finding the first RMB of link group, it should start from the
current RMB list whose index is 0. So fix it.

Fixes: b4ba465 ("net/smc: extend LLC layer for SMC-Rv2")
Signed-off-by: Wen Gu <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
  • Loading branch information
Wen Gu authored and Paolo Abeni committed May 30, 2023
1 parent 020c69c commit b24aa14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/smc/smc_llc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit b24aa14

Please sign in to comment.