* [PATCH] rocker: fix link status detection in rocker_carrier_init()
@ 2024-11-14 15:19 Dmitry Antipov
2024-11-19 2:42 ` Jakub Kicinski
2024-11-19 2:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Dmitry Antipov @ 2024-11-14 15:19 UTC (permalink / raw)
To: Jiri Pirko
Cc: Andrew Lunn, David S . Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev, lvc-project, Dmitry Antipov
Since '1 << rocker_port->pport' may be undefined for port >= 32,
cast the left operand to 'unsigned long long' like it's done in
'rocker_port_set_enable()' above. Compile tested only.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
drivers/net/ethernet/rocker/rocker_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c
index 84fa911c78db..fe0bf1d3217a 100644
--- a/drivers/net/ethernet/rocker/rocker_main.c
+++ b/drivers/net/ethernet/rocker/rocker_main.c
@@ -2502,7 +2502,7 @@ static void rocker_carrier_init(const struct rocker_port *rocker_port)
u64 link_status = rocker_read64(rocker, PORT_PHYS_LINK_STATUS);
bool link_up;
- link_up = link_status & (1 << rocker_port->pport);
+ link_up = link_status & (1ULL << rocker_port->pport);
if (link_up)
netif_carrier_on(rocker_port->dev);
else
--
2.47.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rocker: fix link status detection in rocker_carrier_init()
2024-11-14 15:19 [PATCH] rocker: fix link status detection in rocker_carrier_init() Dmitry Antipov
@ 2024-11-19 2:42 ` Jakub Kicinski
2024-11-19 9:28 ` Jiri Pirko
2024-11-19 2:50 ` patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2024-11-19 2:42 UTC (permalink / raw)
To: Jiri Pirko
Cc: Ido Schimmel, Andrew Lunn, David S . Miller, Eric Dumazet,
Paolo Abeni, netdev
On Thu, 14 Nov 2024 18:19:46 +0300 Dmitry Antipov wrote:
> Since '1 << rocker_port->pport' may be undefined for port >= 32,
> cast the left operand to 'unsigned long long' like it's done in
> 'rocker_port_set_enable()' above. Compile tested only.
Jiri, random thought - any sense if anyone still uses rocker?
IIUC the goal was similar to netdevsim - SW testing / modeling
but we don't really have any upstream tests against it..
Unrelated to the patch, so dropping the author from CC.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rocker: fix link status detection in rocker_carrier_init()
2024-11-14 15:19 [PATCH] rocker: fix link status detection in rocker_carrier_init() Dmitry Antipov
2024-11-19 2:42 ` Jakub Kicinski
@ 2024-11-19 2:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-19 2:50 UTC (permalink / raw)
To: Dmitry Antipov
Cc: jiri, andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
lvc-project
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 14 Nov 2024 18:19:46 +0300 you wrote:
> Since '1 << rocker_port->pport' may be undefined for port >= 32,
> cast the left operand to 'unsigned long long' like it's done in
> 'rocker_port_set_enable()' above. Compile tested only.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
>
> [...]
Here is the summary with links:
- rocker: fix link status detection in rocker_carrier_init()
https://git.kernel.org/netdev/net-next/c/e64285ff41bb
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] 4+ messages in thread
* Re: [PATCH] rocker: fix link status detection in rocker_carrier_init()
2024-11-19 2:42 ` Jakub Kicinski
@ 2024-11-19 9:28 ` Jiri Pirko
0 siblings, 0 replies; 4+ messages in thread
From: Jiri Pirko @ 2024-11-19 9:28 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Ido Schimmel, Andrew Lunn, David S . Miller, Eric Dumazet,
Paolo Abeni, netdev
Tue, Nov 19, 2024 at 03:42:01AM CET, kuba@kernel.org wrote:
>On Thu, 14 Nov 2024 18:19:46 +0300 Dmitry Antipov wrote:
>> Since '1 << rocker_port->pport' may be undefined for port >= 32,
>> cast the left operand to 'unsigned long long' like it's done in
>> 'rocker_port_set_enable()' above. Compile tested only.
>
>Jiri, random thought - any sense if anyone still uses rocker?
>IIUC the goal was similar to netdevsim - SW testing / modeling
>but we don't really have any upstream tests against it..
Afaik some people are still using it for testing. I got couple emails in
the past. Not sure now. The thing is, rocker has real datapath,
comparing to netdevsim.
>
>Unrelated to the patch, so dropping the author from CC.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-19 9:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14 15:19 [PATCH] rocker: fix link status detection in rocker_carrier_init() Dmitry Antipov
2024-11-19 2:42 ` Jakub Kicinski
2024-11-19 9:28 ` Jiri Pirko
2024-11-19 2: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).