Skip to contentSkip to conversation

net: bridge: declare br_vlan_tunnel_lookup argument tunnel_id as __be64

PATCH Applied Vladimir Oltean 3 participants 3 messages Mar 22, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: bridge: declare br_vlan_tunnel_lookup argument tunnel_id as __be64

From: Vladimir Oltean <[email protected]>

The only caller of br_vlan_tunnel_lookup, br_handle_ingress_vlan_tunnel, extracts the tunnel_id from struct ip_tunnel_info::struct ip_tunnel_key::
tun_id which is a __be64 value.

The exact endianness does not seem to matter, because the tunnel id is just used as a lookup key for the VLAN group's tunnel hash table, and the value is not interpreted directly per se. Moreover, rhashtable_lookup_fast treats the key argument as a const void *.

Therefore, there is no functional change associated with this patch, just one to silence "make W=1" builds.

---
 net/bridge/br_vlan_tunnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_vlan_tunnel.c +1 -1
index 169e005fbda2..0d3a8c01552e 100644
@@ -35,7 +35,7 @@ static const struct rhashtable_params br_vlan_tunnel_rht_params = {
 };
 
 static struct net_bridge_vlan *br_vlan_tunnel_lookup(struct rhashtable *tbl,
-						     u64 tunnel_id)
+						     __be64 tunnel_id)
 {
 	return rhashtable_lookup_fast(tbl, &tunnel_id,
 				      br_vlan_tunnel_rht_params);
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 25 lines · Vladimir Oltean

From: Vladimir Oltean <[email protected]>

The only caller of br_vlan_tunnel_lookup, br_handle_ingress_vlan_tunnel, extracts the tunnel_id from struct ip_tunnel_info::struct ip_tunnel_key::
tun_id which is a __be64 value.

The exact endianness does not seem to matter, because the tunnel id is just used as a lookup key for the VLAN group's tunnel hash table, and the value is not interpreted directly per se. Moreover, rhashtable_lookup_fast treats the key argument as a const void *.

Therefore, there is no functional change associated with this patch, just one to silence "make W=1" builds.

---
 net/bridge/br_vlan_tunnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_vlan_tunnel.c +0 -0
index 169e005fbda2..0d3a8c01552e 100644

net/bridge/br_vlan_tunnel.c static const struct rhashtable_params br_vlan_tunnel_rht_params = { · line 41

Quoted 8 lines
net/bridge/br_vlan_tunnel.c +1 -1
@@ -35,7 +35,7 @@ static const struct rhashtable_params br_vlan_tunnel_rht_params = {
 };
 
 static struct net_bridge_vlan *br_vlan_tunnel_lookup(struct rhashtable *tbl,
-						     u64 tunnel_id)
+						     __be64 tunnel_id)
 {
 	return rhashtable_lookup_fast(tbl, &tunnel_id,
 				      br_vlan_tunnel_rht_params);
#2 lore raw
In reply to Vladimir Oltean
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

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

Quoted 6 lines · On Mon, 22 Mar 2021 12:38:19 +0200 you wrote:

From: Vladimir Oltean <[email protected]>

The only caller of br_vlan_tunnel_lookup, br_handle_ingress_vlan_tunnel, extracts the tunnel_id from struct ip_tunnel_info::struct ip_tunnel_key::
tun_id which is a __be64 value.

Quoted 6 lines

The exact endianness does not seem to matter, because the tunnel id is just used as a lookup key for the VLAN group's tunnel hash table, and the value is not interpreted directly per se. Moreover, rhashtable_lookup_fast treats the key argument as a const void *.

[...]

Here is the summary with links:
- [net-next] net: bridge: declare br_vlan_tunnel_lookup argument tunnel_id as __be64

    https://git.kernel.org/netdev/net-next/c/f5fcca89f59c

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html