net/smc: Make sure the link_id is unique
Wen Gu
reviewerPATCH 1/1 net/smc: Make sure the link_id is unique
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 <[email protected]>
Reviewed-by Tony Lu <[email protected]>
--- net/smc/smc_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/smc/smc_core.c +2 -1
@@ -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 ; }
Signature · 1 line
1.8.3.1
Quoted 7 lines · Wen Gu
The
link_idis supposed to be unique, butsmcr_next_link_id()doesn't skip the usedlink_idas expected. So the patch fixes this.Fixes 026c381fb477 ("net/smc: introduce link_idx for link group array")Signed-off-by Wen Gu <[email protected]>Reviewed-by Tony Lu <[email protected]>---
Thank you.
Acked-by Karsten Graul <[email protected]>
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 8 lines · On Mon, 15 Nov 2021 17:45:07 +0800 you wrote:
The
link_idis supposed to be unique, butsmcr_next_link_id()doesn't skip the usedlink_idas expected. So the patch fixes this.Fixes 026c381fb477 ("net/smc: introduce link_idx for link group array")Signed-off-by Wen Gu <[email protected]>Reviewed-by Tony Lu <[email protected]>[...]
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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html