Lines Matching refs:vni
88 static inline __u32 geneve_net_vni_hash(u8 vni[3]) in geneve_net_vni_hash()
92 vnid = (vni[0] << 16) | (vni[1] << 8) | vni[2]; in geneve_net_vni_hash()
96 static __be64 vni_to_tunnel_id(const __u8 *vni) in vni_to_tunnel_id() argument
99 return (vni[0] << 16) | (vni[1] << 8) | vni[2]; in vni_to_tunnel_id()
101 return (__force __be64)(((__force u64)vni[0] << 40) | in vni_to_tunnel_id()
102 ((__force u64)vni[1] << 48) | in vni_to_tunnel_id()
103 ((__force u64)vni[2] << 56)); in vni_to_tunnel_id()
108 static void tunnel_id_to_vni(__be64 tun_id, __u8 *vni) in tunnel_id_to_vni() argument
111 vni[0] = (__force __u8)(tun_id >> 16); in tunnel_id_to_vni()
112 vni[1] = (__force __u8)(tun_id >> 8); in tunnel_id_to_vni()
113 vni[2] = (__force __u8)tun_id; in tunnel_id_to_vni()
115 vni[0] = (__force __u8)((__force u64)tun_id >> 40); in tunnel_id_to_vni()
116 vni[1] = (__force __u8)((__force u64)tun_id >> 48); in tunnel_id_to_vni()
117 vni[2] = (__force __u8)((__force u64)tun_id >> 56); in tunnel_id_to_vni()
121 static bool eq_tun_id_and_vni(u8 *tun_id, u8 *vni) in eq_tun_id_and_vni() argument
123 return !memcmp(vni, &tun_id[5], 3); in eq_tun_id_and_vni()
132 __be32 addr, u8 vni[]) in geneve_lookup() argument
139 hash = geneve_net_vni_hash(vni); in geneve_lookup()
142 if (eq_tun_id_and_vni((u8 *)&node->geneve->cfg.info.key.tun_id, vni) && in geneve_lookup()
151 struct in6_addr addr6, u8 vni[]) in geneve6_lookup() argument
158 hash = geneve_net_vni_hash(vni); in geneve6_lookup()
161 if (eq_tun_id_and_vni((u8 *)&node->geneve->cfg.info.key.tun_id, vni) && in geneve6_lookup()
178 u8 *vni; in geneve_lookup_skb() local
187 vni = zero_vni; in geneve_lookup_skb()
190 vni = geneve_hdr(skb)->vni; in geneve_lookup_skb()
194 return geneve_lookup(gs, addr, vni); in geneve_lookup_skb()
204 vni = zero_vni; in geneve_lookup_skb()
207 vni = geneve_hdr(skb)->vni; in geneve_lookup_skb()
211 return geneve6_lookup(gs, addr6, vni); in geneve_lookup_skb()
234 vni_to_tunnel_id(gnvh->vni), in geneve_rx()
411 u8 *vni = zero_vni; in geneve_udp_encap_err_lookup() local
432 vni = geneve_hdr(skb)->vni; in geneve_udp_encap_err_lookup()
436 return geneve_lookup(gs, addr4, vni) ? 0 : -ENOENT; in geneve_udp_encap_err_lookup()
447 vni = geneve_hdr(skb)->vni; in geneve_udp_encap_err_lookup()
451 return geneve6_lookup(gs, addr6, vni) ? 0 : -ENOENT; in geneve_udp_encap_err_lookup()
670 __u8 vni[3]; in geneve_sock_add() local
698 tunnel_id_to_vni(geneve->cfg.info.key.tun_id, vni); in geneve_sock_add()
699 hash = geneve_net_vni_hash(vni); in geneve_sock_add()
749 tunnel_id_to_vni(info->key.tun_id, geneveh->vni); in geneve_build_header()
1313 __u32 vni = nla_get_u32(data[IFLA_GENEVE_ID]); in geneve_validate() local
1315 if (vni >= GENEVE_N_VID) { in geneve_validate()
1507 __u32 vni; in geneve_nl2info() local
1511 vni = nla_get_u32(data[IFLA_GENEVE_ID]); in geneve_nl2info()
1512 tvni[0] = (vni & 0x00ff0000) >> 16; in geneve_nl2info()
1513 tvni[1] = (vni & 0x0000ff00) >> 8; in geneve_nl2info()
1514 tvni[2] = vni & 0x000000ff; in geneve_nl2info()
1803 __u32 vni; in geneve_fill_info() local
1806 vni = (tmp_vni[0] << 16) | (tmp_vni[1] << 8) | tmp_vni[2]; in geneve_fill_info()
1807 if (nla_put_u32(skb, IFLA_GENEVE_ID, vni)) in geneve_fill_info()