All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] dsa: tag_dsa: Fix mask for trunked packets
@ 2021-10-03 15:50 Andrew Lunn
  2021-10-03 21:07 ` Vladimir Oltean
  2021-10-04 12:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Andrew Lunn @ 2021-10-03 15:50 UTC (permalink / raw)
  To: netdev; +Cc: Tobias Waldekranz, Vladimir Oltean, Florian Fainelli, Andrew Lunn

A packet received on a trunk will have bit 2 set in Forward DSA tagged
frame. Bit 1 can be either 0 or 1 and is otherwise undefined and bit 0
indicates the frame CFI. Masking with 7 thus results in frames as
being identified as being from a trunk when in fact they are not. Fix
the mask to just look at bit 2.

Fixes: 5b60dadb71db ("net: dsa: tag_dsa: Support reception of packets from LAG devices")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 net/dsa/tag_dsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dsa/tag_dsa.c b/net/dsa/tag_dsa.c
index 77d0ce89ab77..e5127b7d1c6a 100644
--- a/net/dsa/tag_dsa.c
+++ b/net/dsa/tag_dsa.c
@@ -210,7 +210,7 @@ static struct sk_buff *dsa_rcv_ll(struct sk_buff *skb, struct net_device *dev,
 	cmd = dsa_header[0] >> 6;
 	switch (cmd) {
 	case DSA_CMD_FORWARD:
-		trunk = !!(dsa_header[1] & 7);
+		trunk = !!(dsa_header[1] & 4);
 		break;
 
 	case DSA_CMD_TO_CPU:
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] dsa: tag_dsa: Fix mask for trunked packets
  2021-10-03 15:50 [PATCH net] dsa: tag_dsa: Fix mask for trunked packets Andrew Lunn
@ 2021-10-03 21:07 ` Vladimir Oltean
  2021-10-04 12:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Oltean @ 2021-10-03 21:07 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, Tobias Waldekranz, Florian Fainelli

On Sun, Oct 03, 2021 at 05:50:53PM +0200, Andrew Lunn wrote:
> A packet received on a trunk will have bit 2 set in Forward DSA tagged
> frame. Bit 1 can be either 0 or 1 and is otherwise undefined and bit 0
> indicates the frame CFI. Masking with 7 thus results in frames as
> being identified as being from a trunk when in fact they are not. Fix
> the mask to just look at bit 2.
> 
> Fixes: 5b60dadb71db ("net: dsa: tag_dsa: Support reception of packets from LAG devices")
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> ---

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>

At least this appears correct on 88E6096/97, but I would expect it to be
true for the entire family.

Would like to hear Tobias' feedback too, though.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] dsa: tag_dsa: Fix mask for trunked packets
  2021-10-03 15:50 [PATCH net] dsa: tag_dsa: Fix mask for trunked packets Andrew Lunn
  2021-10-03 21:07 ` Vladimir Oltean
@ 2021-10-04 12:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-04 12:50 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, tobias, vladimir.oltean, f.fainelli

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Sun,  3 Oct 2021 17:50:53 +0200 you wrote:
> A packet received on a trunk will have bit 2 set in Forward DSA tagged
> frame. Bit 1 can be either 0 or 1 and is otherwise undefined and bit 0
> indicates the frame CFI. Masking with 7 thus results in frames as
> being identified as being from a trunk when in fact they are not. Fix
> the mask to just look at bit 2.
> 
> Fixes: 5b60dadb71db ("net: dsa: tag_dsa: Support reception of packets from LAG devices")
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> 
> [...]

Here is the summary with links:
  - [net] dsa: tag_dsa: Fix mask for trunked packets
    https://git.kernel.org/netdev/net/c/b44d52a50bc6

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-10-04 12:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-03 15:50 [PATCH net] dsa: tag_dsa: Fix mask for trunked packets Andrew Lunn
2021-10-03 21:07 ` Vladimir Oltean
2021-10-04 12:50 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.