* [PATCH RESEND net-next] net: dsa: bcm_sf2: Check egress tagging of CFP rule with proper accessor
@ 2021-02-03 19:39 Vladimir Oltean
2021-02-05 4:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Oltean @ 2021-02-03 19:39 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, netdev
Cc: Andrew Lunn, Florian Fainelli, Vivien Didelot
The flow steering struct ethtool_flow_ext::data field is __be32, so when
the CFP code needs to check the VLAN egress tagging attribute in bit 0,
it does this in CPU native endianness. So logically, the endianness
conversion is set up the other way around, although in practice the same
result is produced.
Gets rid of build warning:
warning: cast from restricted __be32
warning: incorrect type in argument 1 (different base types)
expected unsigned int [usertype] val
got restricted __be32
warning: cast from restricted __be32
warning: cast from restricted __be32
warning: cast from restricted __be32
warning: cast from restricted __be32
warning: restricted __be32 degrades to integer
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2_cfp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/bcm_sf2_cfp.c b/drivers/net/dsa/bcm_sf2_cfp.c
index ed45d16250e1..178218cf73a3 100644
--- a/drivers/net/dsa/bcm_sf2_cfp.c
+++ b/drivers/net/dsa/bcm_sf2_cfp.c
@@ -886,7 +886,7 @@ static int bcm_sf2_cfp_rule_insert(struct dsa_switch *ds, int port,
vid = be16_to_cpu(fs->h_ext.vlan_tci) & VLAN_VID_MASK;
vlan.vid = vid;
- if (cpu_to_be32(fs->h_ext.data[1]) & 1)
+ if (be32_to_cpu(fs->h_ext.data[1]) & 1)
vlan.flags = BRIDGE_VLAN_INFO_UNTAGGED;
else
vlan.flags = 0;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND net-next] net: dsa: bcm_sf2: Check egress tagging of CFP rule with proper accessor
2021-02-03 19:39 [PATCH RESEND net-next] net: dsa: bcm_sf2: Check egress tagging of CFP rule with proper accessor Vladimir Oltean
@ 2021-02-05 4:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-02-05 4:30 UTC (permalink / raw)
To: Vladimir Oltean; +Cc: davem, kuba, netdev, andrew, f.fainelli, vivien.didelot
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
On Wed, 3 Feb 2021 21:39:18 +0200 you wrote:
> The flow steering struct ethtool_flow_ext::data field is __be32, so when
> the CFP code needs to check the VLAN egress tagging attribute in bit 0,
> it does this in CPU native endianness. So logically, the endianness
> conversion is set up the other way around, although in practice the same
> result is produced.
>
> Gets rid of build warning:
>
> [...]
Here is the summary with links:
- [RESEND,net-next] net: dsa: bcm_sf2: Check egress tagging of CFP rule with proper accessor
https://git.kernel.org/netdev/net-next/c/b53014f0791c
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] 2+ messages in thread
end of thread, other threads:[~2021-02-05 4:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-03 19:39 [PATCH RESEND net-next] net: dsa: bcm_sf2: Check egress tagging of CFP rule with proper accessor Vladimir Oltean
2021-02-05 4:30 ` 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).