* [PATCH net] net/smc: Make sure the link_id is unique
@ 2021-11-15 9:45 Wen Gu
2021-11-15 13:33 ` Karsten Graul
2021-11-15 14:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Wen Gu @ 2021-11-15 9:45 UTC (permalink / raw)
To: kgraul; +Cc: linux-s390, netdev, linux-kernel, xuanzhuo, tonylu, dust.li,
guwen
The link_id is supposed to be unique, but smcr_next_link_id() doesn't
skip the used link_id as expected. So the patch fixes this.
Fixes: 026c381fb477 ("net/smc: introduce link_idx for link group array")
Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
Reviewed-by: Tony Lu <tonylu@linux.alibaba.com>
---
net/smc/smc_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/smc/smc_core.c b/net/smc/smc_core.c
index 49b8ba3..25ebd30 100644
--- a/net/smc/smc_core.c
+++ b/net/smc/smc_core.c
@@ -708,13 +708,14 @@ static u8 smcr_next_link_id(struct smc_link_group *lgr)
int i;
while (1) {
+again:
link_id = ++lgr->next_link_id;
if (!link_id) /* skip zero as link_id */
link_id = ++lgr->next_link_id;
for (i = 0; i < SMC_LINKS_PER_LGR_MAX; i++) {
if (smc_link_usable(&lgr->lnk[i]) &&
lgr->lnk[i].link_id == link_id)
- continue;
+ goto again;
}
break;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net/smc: Make sure the link_id is unique
2021-11-15 9:45 [PATCH net] net/smc: Make sure the link_id is unique Wen Gu
@ 2021-11-15 13:33 ` Karsten Graul
2021-11-15 14:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Karsten Graul @ 2021-11-15 13:33 UTC (permalink / raw)
To: Wen Gu; +Cc: linux-s390, netdev, linux-kernel, xuanzhuo, tonylu, dust.li
On 15/11/2021 10:45, Wen Gu wrote:
> The link_id is supposed to be unique, but smcr_next_link_id() doesn't
> skip the used link_id as expected. So the patch fixes this.
>
> Fixes: 026c381fb477 ("net/smc: introduce link_idx for link group array")
> Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
> Reviewed-by: Tony Lu <tonylu@linux.alibaba.com>
> ---
Thank you.
Acked-by: Karsten Graul <kgraul@linux.ibm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net/smc: Make sure the link_id is unique
2021-11-15 9:45 [PATCH net] net/smc: Make sure the link_id is unique Wen Gu
2021-11-15 13:33 ` Karsten Graul
@ 2021-11-15 14:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-11-15 14:50 UTC (permalink / raw)
To: Wen Gu; +Cc: kgraul, linux-s390, netdev, linux-kernel, xuanzhuo, tonylu,
dust.li
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:
On Mon, 15 Nov 2021 17:45:07 +0800 you wrote:
> The link_id is supposed to be unique, but smcr_next_link_id() doesn't
> skip the used link_id as expected. So the patch fixes this.
>
> Fixes: 026c381fb477 ("net/smc: introduce link_idx for link group array")
> Signed-off-by: Wen Gu <guwen@linux.alibaba.com>
> Reviewed-by: Tony Lu <tonylu@linux.alibaba.com>
>
> [...]
Here is the summary with links:
- [net] net/smc: Make sure the link_id is unique
https://git.kernel.org/netdev/net/c/cf4f5530bb55
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-15 14:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-15 9:45 [PATCH net] net/smc: Make sure the link_id is unique Wen Gu
2021-11-15 13:33 ` Karsten Graul
2021-11-15 14:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).