Commit b24aa141 authored by Wen Gu's avatar Wen Gu Committed by Paolo Abeni
Browse files

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: b4ba4652 ("net/smc: extend LLC layer for SMC-Rv2")
Signed-off-by: default avatarWen Gu <guwen@linux.alibaba.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 020c69c1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);
	}