Lines Matching refs:vni
86 static inline __u32 geneve_net_vni_hash(u8 vni[3]) in geneve_net_vni_hash()
90 vnid = (vni[0] << 16) | (vni[1] << 8) | vni[2]; in geneve_net_vni_hash()
94 static __be64 vni_to_tunnel_id(const __u8 *vni) in vni_to_tunnel_id() argument
97 return (vni[0] << 16) | (vni[1] << 8) | vni[2]; in vni_to_tunnel_id()
99 return (__force __be64)(((__force u64)vni[0] << 40) | in vni_to_tunnel_id()
100 ((__force u64)vni[1] << 48) | in vni_to_tunnel_id()
101 ((__force u64)vni[2] << 56)); in vni_to_tunnel_id()
106 static void tunnel_id_to_vni(__be64 tun_id, __u8 *vni) in tunnel_id_to_vni() argument
109 vni[0] = (__force __u8)(tun_id >> 16); in tunnel_id_to_vni()
110 vni[1] = (__force __u8)(tun_id >> 8); in tunnel_id_to_vni()
111 vni[2] = (__force __u8)tun_id; in tunnel_id_to_vni()
113 vni[0] = (__force __u8)((__force u64)tun_id >> 40); in tunnel_id_to_vni()
114 vni[1] = (__force __u8)((__force u64)tun_id >> 48); in tunnel_id_to_vni()
115 vni[2] = (__force __u8)((__force u64)tun_id >> 56); in tunnel_id_to_vni()
119 static bool eq_tun_id_and_vni(u8 *tun_id, u8 *vni) in eq_tun_id_and_vni() argument
121 return !memcmp(vni, &tun_id[5], 3); in eq_tun_id_and_vni()
130 __be32 addr, u8 vni[]) in geneve_lookup() argument
137 hash = geneve_net_vni_hash(vni); in geneve_lookup()
140 if (eq_tun_id_and_vni((u8 *)&node->geneve->cfg.info.key.tun_id, vni) && in geneve_lookup()
149 struct in6_addr addr6, u8 vni[]) in geneve6_lookup() argument
156 hash = geneve_net_vni_hash(vni); in geneve6_lookup()
159 if (eq_tun_id_and_vni((u8 *)&node->geneve->cfg.info.key.tun_id, vni) && in geneve6_lookup()
176 u8 *vni; in geneve_lookup_skb() local
185 vni = zero_vni; in geneve_lookup_skb()
188 vni = geneve_hdr(skb)->vni; in geneve_lookup_skb()
192 return geneve_lookup(gs, addr, vni); in geneve_lookup_skb()
202 vni = zero_vni; in geneve_lookup_skb()
205 vni = geneve_hdr(skb)->vni; in geneve_lookup_skb()
209 return geneve6_lookup(gs, addr6, vni); in geneve_lookup_skb()
232 vni_to_tunnel_id(gnvh->vni), in geneve_rx()
392 u8 *vni = zero_vni; in geneve_udp_encap_err_lookup() local
413 vni = geneve_hdr(skb)->vni; in geneve_udp_encap_err_lookup()
417 return geneve_lookup(gs, addr4, vni) ? 0 : -ENOENT; in geneve_udp_encap_err_lookup()
428 vni = geneve_hdr(skb)->vni; in geneve_udp_encap_err_lookup()
432 return geneve6_lookup(gs, addr6, vni) ? 0 : -ENOENT; in geneve_udp_encap_err_lookup()
654 __u8 vni[3]; in geneve_sock_add() local
682 tunnel_id_to_vni(geneve->cfg.info.key.tun_id, vni); in geneve_sock_add()
683 hash = geneve_net_vni_hash(vni); in geneve_sock_add()
732 tunnel_id_to_vni(info->key.tun_id, geneveh->vni); in geneve_build_header()
1288 __u32 vni = nla_get_u32(data[IFLA_GENEVE_ID]); in geneve_validate() local
1290 if (vni >= GENEVE_N_VID) { in geneve_validate()
1474 __u32 vni; in geneve_nl2info() local
1478 vni = nla_get_u32(data[IFLA_GENEVE_ID]); in geneve_nl2info()
1479 tvni[0] = (vni & 0x00ff0000) >> 16; in geneve_nl2info()
1480 tvni[1] = (vni & 0x0000ff00) >> 8; in geneve_nl2info()
1481 tvni[2] = vni & 0x000000ff; in geneve_nl2info()
1761 __u32 vni; in geneve_fill_info() local
1764 vni = (tmp_vni[0] << 16) | (tmp_vni[1] << 8) | tmp_vni[2]; in geneve_fill_info()
1765 if (nla_put_u32(skb, IFLA_GENEVE_ID, vni)) in geneve_fill_info()