Lines Matching full:vs
74 static inline bool vxlan_collect_metadata(struct vxlan_sock *vs)
76 return vs->flags & VXLAN_F_COLLECT_METADATA ||
87 struct vxlan_sock *vs;
91 hlist_for_each_entry_rcu(vs, vs_head(net, port), hlist) {
92 if (inet_sk(vs->sock->sk)->inet_sport == port &&
93 vxlan_get_sk_family(vs) == family &&
94 vs->flags == flags &&
95 vs->sock->sk->sk_bound_dev_if == ifindex)
96 return vs;
101 static struct vxlan_dev *vxlan_vs_find_vni(struct vxlan_sock *vs,
109 if (vs->flags & VXLAN_F_COLLECT_METADATA &&
110 !(vs->flags & VXLAN_F_VNIFILTER))
113 hlist_for_each_entry_rcu(node, vni_head(vs, vni), hlist) {
146 struct vxlan_sock *vs;
148 vs = vxlan_find_sock(net, family, port, flags, ifindex);
149 if (!vs)
152 return vxlan_vs_find_vni(vs, ifindex, vni, NULL);
664 struct vxlan_sock *vs = rcu_dereference_sk_user_data(sk);
679 if ((flags & VXLAN_HF_RCO) && (vs->flags & VXLAN_F_REMCSUM_RX)) {
682 !!(vs->flags &
1487 static bool __vxlan_sock_release_prep(struct vxlan_sock *vs)
1491 if (!vs)
1493 if (!refcount_dec_and_test(&vs->refcnt))
1496 hlist_del_rcu(&vs->hlist);
1497 udp_tunnel_notify_del_rx_port(vs->sock,
1498 (vs->flags & VXLAN_F_GPE) ?
1588 struct vxlan_sock *vs,
1603 if (vxlan_get_sk_family(vs) == AF_INET) {
1620 static bool vxlan_ecn_decapsulate(struct vxlan_sock *vs, void *oiph,
1625 if (vxlan_get_sk_family(vs) == AF_INET)
1633 if (vxlan_get_sk_family(vs) == AF_INET)
1649 struct vxlan_sock *vs;
1674 vs = rcu_dereference_sk_user_data(sk);
1675 if (!vs)
1680 vxlan = vxlan_vs_find_vni(vs, skb->dev->ifindex, vni, &vninode);
1722 if (vxlan_collect_metadata(vs)) {
1727 tun_dst = udp_tun_rx_dst(skb, vxlan_get_sk_family(vs), flags,
1749 reason = vxlan_set_mac(vxlan, vs, skb, vni);
1778 if (!vxlan_ecn_decapsulate(vs, oiph, skb)) {
1816 struct vxlan_sock *vs;
1828 vs = rcu_dereference_sk_user_data(sk);
1829 if (!vs)
1833 vxlan = vxlan_vs_find_vni(vs, skb->dev->ifindex, vni, NULL);
2884 static void vxlan_vs_add_dev(struct vxlan_sock *vs, struct vxlan_dev *vxlan,
2892 hlist_add_head_rcu(&node->hlist, vni_head(vs, vni));
3312 struct vxlan_sock *vs;
3320 hlist_for_each_entry(vs, &vn->sock_list[i], hlist) {
3323 if (vs->flags & VXLAN_F_GPE)
3329 udp_tunnel_push_rx_port(dev, vs->sock, type);
3331 udp_tunnel_drop_rx_port(dev, vs->sock, type);
3564 struct vxlan_sock *vs;
3571 vs = kzalloc(sizeof(*vs), GFP_KERNEL);
3572 if (!vs)
3576 INIT_HLIST_HEAD(&vs->vni_list[h]);
3580 kfree(vs);
3584 vs->sock = sock;
3585 refcount_set(&vs->refcnt, 1);
3586 vs->flags = (flags & VXLAN_F_RCV_FLAGS);
3588 hlist_add_head_rcu(&vs->hlist, vs_head(net, port));
3590 (vs->flags & VXLAN_F_GPE) ?
3596 tunnel_cfg.sk_user_data = vs;
3601 if (vs->flags & VXLAN_F_GPE) {
3611 return vs;
3617 struct vxlan_sock *vs = NULL;
3629 vs = vxlan_find_sock(vxlan->net, ipv6 ? AF_INET6 : AF_INET,
3632 if (vs && !refcount_inc_not_zero(&vs->refcnt)) {
3638 if (!vs)
3639 vs = vxlan_socket_create(vxlan->net, ipv6,
3642 if (IS_ERR(vs))
3643 return PTR_ERR(vs);
3646 rcu_assign_pointer(vxlan->vn6_sock, vs);
3651 rcu_assign_pointer(vxlan->vn4_sock, vs);
3656 vxlan_vs_add_vnigrp(vxlan, vs, ipv6);
3658 vxlan_vs_add_dev(vs, vxlan, node);