Home
last modified time | relevance | path

Searched refs:tunnel (Results 1 – 25 of 126) sorted by relevance

123456

/Linux-v5.15/drivers/thunderbolt/
Dtunnel.c49 #define __TB_TUNNEL_PRINT(level, tunnel, fmt, arg...) \ argument
51 struct tb_tunnel *__tunnel = (tunnel); \
61 #define tb_tunnel_WARN(tunnel, fmt, arg...) \ argument
62 __TB_TUNNEL_PRINT(tb_WARN, tunnel, fmt, ##arg)
63 #define tb_tunnel_warn(tunnel, fmt, arg...) \ argument
64 __TB_TUNNEL_PRINT(tb_warn, tunnel, fmt, ##arg)
65 #define tb_tunnel_info(tunnel, fmt, arg...) \ argument
66 __TB_TUNNEL_PRINT(tb_info, tunnel, fmt, ##arg)
67 #define tb_tunnel_dbg(tunnel, fmt, arg...) \ argument
68 __TB_TUNNEL_PRINT(tb_dbg, tunnel, fmt, ##arg)
[all …]
Dtunnel.h50 int (*init)(struct tb_tunnel *tunnel);
51 void (*deinit)(struct tb_tunnel *tunnel);
52 int (*activate)(struct tb_tunnel *tunnel, bool activate);
53 int (*consumed_bandwidth)(struct tb_tunnel *tunnel, int *consumed_up,
55 int (*release_unused_bandwidth)(struct tb_tunnel *tunnel);
56 void (*reclaim_available_bandwidth)(struct tb_tunnel *tunnel,
78 bool tb_tunnel_match_dma(const struct tb_tunnel *tunnel, int transmit_path,
85 void tb_tunnel_free(struct tb_tunnel *tunnel);
86 int tb_tunnel_activate(struct tb_tunnel *tunnel);
87 int tb_tunnel_restart(struct tb_tunnel *tunnel);
[all …]
Dtb.c115 struct tb_tunnel *tunnel = NULL; in tb_discover_tunnels() local
119 tunnel = tb_tunnel_discover_dp(tb, port); in tb_discover_tunnels()
123 tunnel = tb_tunnel_discover_pci(tb, port); in tb_discover_tunnels()
127 tunnel = tb_tunnel_discover_usb3(tb, port); in tb_discover_tunnels()
134 if (!tunnel) in tb_discover_tunnels()
137 if (tb_tunnel_is_pci(tunnel)) { in tb_discover_tunnels()
138 struct tb_switch *parent = tunnel->dst_port->sw; in tb_discover_tunnels()
140 while (parent != tunnel->src_port->sw) { in tb_discover_tunnels()
144 } else if (tb_tunnel_is_dp(tunnel)) { in tb_discover_tunnels()
146 pm_runtime_get_sync(&tunnel->src_port->sw->dev); in tb_discover_tunnels()
[all …]
Dtest.c1335 struct tb_tunnel *tunnel; in tb_test_tunnel_dp() local
1351 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 0, 0); in tb_test_tunnel_dp()
1352 KUNIT_ASSERT_TRUE(test, tunnel != NULL); in tb_test_tunnel_dp()
1353 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); in tb_test_tunnel_dp()
1354 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); in tb_test_tunnel_dp()
1355 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); in tb_test_tunnel_dp()
1356 KUNIT_ASSERT_EQ(test, tunnel->npaths, 3); in tb_test_tunnel_dp()
1357 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 2); in tb_test_tunnel_dp()
1358 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, in); in tb_test_tunnel_dp()
1359 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[1].out_port, out); in tb_test_tunnel_dp()
[all …]
/Linux-v5.15/net/l2tp/
Dl2tp_core.c146 l2tp_session_id_hash(struct l2tp_tunnel *tunnel, u32 session_id) in l2tp_session_id_hash() argument
148 return &tunnel->session_hlist[hash_32(session_id, L2TP_HASH_BITS)]; in l2tp_session_id_hash()
151 static void l2tp_tunnel_free(struct l2tp_tunnel *tunnel) in l2tp_tunnel_free() argument
153 trace_free_tunnel(tunnel); in l2tp_tunnel_free()
154 sock_put(tunnel->sock); in l2tp_tunnel_free()
161 if (session->tunnel) in l2tp_session_free()
162 l2tp_tunnel_dec_refcount(session->tunnel); in l2tp_session_free()
168 struct l2tp_tunnel *tunnel = sk->sk_user_data; in l2tp_sk_to_tunnel() local
170 if (tunnel) in l2tp_sk_to_tunnel()
171 if (WARN_ON(tunnel->magic != L2TP_TUNNEL_MAGIC)) in l2tp_sk_to_tunnel()
[all …]
Dl2tp_debugfs.c38 struct l2tp_tunnel *tunnel; member
45 if (pd->tunnel) in l2tp_dfs_next_tunnel()
46 l2tp_tunnel_dec_refcount(pd->tunnel); in l2tp_dfs_next_tunnel()
48 pd->tunnel = l2tp_tunnel_get_nth(pd->net, pd->tunnel_idx); in l2tp_dfs_next_tunnel()
58 pd->session = l2tp_session_get_nth(pd->tunnel, pd->session_idx); in l2tp_dfs_next_session()
81 if (!pd->tunnel) in l2tp_dfs_seq_start()
87 if (!pd->tunnel && !pd->session) in l2tp_dfs_seq_start()
114 if (pd->tunnel) { in l2tp_dfs_seq_stop()
115 l2tp_tunnel_dec_refcount(pd->tunnel); in l2tp_dfs_seq_stop()
116 pd->tunnel = NULL; in l2tp_dfs_seq_stop()
[all …]
Dl2tp_ppp.c273 struct l2tp_tunnel *tunnel; in pppol2tp_sendmsg() local
286 tunnel = session->tunnel; in pppol2tp_sendmsg()
288 uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; in pppol2tp_sendmsg()
350 struct l2tp_tunnel *tunnel; in pppol2tp_xmit() local
361 tunnel = session->tunnel; in pppol2tp_xmit()
363 uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; in pppol2tp_xmit()
643 static int pppol2tp_tunnel_mtu(const struct l2tp_tunnel *tunnel) in pppol2tp_tunnel_mtu() argument
647 mtu = l2tp_tunnel_dst_mtu(tunnel); in pppol2tp_tunnel_mtu()
663 struct l2tp_tunnel *tunnel; in pppol2tp_connect() local
693 tunnel = l2tp_tunnel_get(sock_net(sk), info.tunnel_id); in pppol2tp_connect()
[all …]
Dl2tp_netlink.c38 int flags, struct l2tp_tunnel *tunnel, u8 cmd);
51 struct l2tp_tunnel *tunnel; in l2tp_nl_session_get() local
62 tunnel = l2tp_tunnel_get(net, tunnel_id); in l2tp_nl_session_get()
63 if (tunnel) { in l2tp_nl_session_get()
64 session = l2tp_tunnel_get_session(tunnel, session_id); in l2tp_nl_session_get()
65 l2tp_tunnel_dec_refcount(tunnel); in l2tp_nl_session_get()
104 struct l2tp_tunnel *tunnel, in l2tp_tunnel_notify() argument
115 NLM_F_ACK, tunnel, cmd); in l2tp_tunnel_notify()
192 struct l2tp_tunnel *tunnel; in l2tp_nl_cmd_tunnel_create() local
237 peer_tunnel_id, &cfg, &tunnel); in l2tp_nl_cmd_tunnel_create()
[all …]
Dtrace.h28 TP_PROTO(struct l2tp_tunnel *tunnel),
29 TP_ARGS(tunnel),
34 memcpy(__entry->name, tunnel->name, L2TP_TUNNEL_NAME_MAX);
52 TP_PROTO(struct l2tp_tunnel *tunnel),
53 TP_ARGS(tunnel),
63 memcpy(__entry->name, tunnel->name, L2TP_TUNNEL_NAME_MAX);
64 __entry->fd = tunnel->fd;
65 __entry->tid = tunnel->tunnel_id;
66 __entry->ptid = tunnel->peer_tunnel_id;
67 __entry->version = tunnel->version;
[all …]
Dl2tp_core.h74 struct l2tp_tunnel *tunnel; /* back pointer to tunnel context */ member
198 int (*session_create)(struct net *net, struct l2tp_tunnel *tunnel,
216 void l2tp_tunnel_inc_refcount(struct l2tp_tunnel *tunnel);
217 void l2tp_tunnel_dec_refcount(struct l2tp_tunnel *tunnel);
227 struct l2tp_session *l2tp_tunnel_get_session(struct l2tp_tunnel *tunnel,
231 struct l2tp_session *l2tp_session_get_nth(struct l2tp_tunnel *tunnel, int nth);
242 int l2tp_tunnel_register(struct l2tp_tunnel *tunnel, struct net *net,
244 void l2tp_tunnel_delete(struct l2tp_tunnel *tunnel);
247 struct l2tp_tunnel *tunnel,
251 struct l2tp_tunnel *tunnel);
[all …]
Dl2tp_eth.c204 static void l2tp_eth_adjust_mtu(struct l2tp_tunnel *tunnel, in l2tp_eth_adjust_mtu() argument
213 if (tunnel->encap == L2TP_ENCAPTYPE_UDP) { in l2tp_eth_adjust_mtu()
218 lock_sock(tunnel->sock); in l2tp_eth_adjust_mtu()
219 l3_overhead = kernel_sock_ip_overhead(tunnel->sock); in l2tp_eth_adjust_mtu()
220 release_sock(tunnel->sock); in l2tp_eth_adjust_mtu()
235 mtu = l2tp_tunnel_dst_mtu(tunnel) - overhead; in l2tp_eth_adjust_mtu()
244 static int l2tp_eth_create(struct net *net, struct l2tp_tunnel *tunnel, in l2tp_eth_create() argument
264 session = l2tp_session_create(sizeof(*spriv), tunnel, session_id, in l2tp_eth_create()
281 l2tp_eth_adjust_mtu(tunnel, session, dev); in l2tp_eth_create()
301 rc = l2tp_session_register(session, tunnel); in l2tp_eth_create()
/Linux-v5.15/net/ipv4/
Dip_tunnel.c237 struct ip_tunnel *tunnel; in __ip_tunnel_create() local
263 tunnel = netdev_priv(dev); in __ip_tunnel_create()
264 tunnel->parms = *parms; in __ip_tunnel_create()
265 tunnel->net = net; in __ip_tunnel_create()
282 struct ip_tunnel *tunnel = netdev_priv(dev); in ip_tunnel_bind_dev() local
286 int t_hlen = tunnel->hlen + sizeof(struct iphdr); in ip_tunnel_bind_dev()
288 iph = &tunnel->parms.iph; in ip_tunnel_bind_dev()
296 iph->saddr, tunnel->parms.o_key, in ip_tunnel_bind_dev()
297 RT_TOS(iph->tos), tunnel->parms.link, in ip_tunnel_bind_dev()
298 tunnel->fwmark, 0); in ip_tunnel_bind_dev()
[all …]
Dip_gre.c269 struct ip_tunnel *tunnel; in erspan_rcv() local
279 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, in erspan_rcv()
285 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, in erspan_rcv()
290 if (tunnel) { in erspan_rcv()
305 if (tunnel->collect_md) { in erspan_rcv()
341 ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in erspan_rcv()
356 struct ip_tunnel *tunnel; in __ipgre_rcv() local
359 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi->flags, in __ipgre_rcv()
362 if (tunnel) { in __ipgre_rcv()
372 if (tunnel->dev->header_ops == &ipgre_header_ops) in __ipgre_rcv()
[all …]
Dipip.c217 struct ip_tunnel *tunnel; in ipip_tunnel_rcv() local
221 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, TUNNEL_NO_KEY, in ipip_tunnel_rcv()
223 if (tunnel) { in ipip_tunnel_rcv()
226 if (tunnel->parms.iph.protocol != ipproto && in ipip_tunnel_rcv()
227 tunnel->parms.iph.protocol != 0) in ipip_tunnel_rcv()
240 if (tunnel->collect_md) { in ipip_tunnel_rcv()
247 return ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in ipip_tunnel_rcv()
276 struct ip_tunnel *tunnel = netdev_priv(dev); in ipip_tunnel_xmit() local
277 const struct iphdr *tiph = &tunnel->parms.iph; in ipip_tunnel_xmit()
304 if (tunnel->collect_md) in ipip_tunnel_xmit()
[all …]
Dip_vti.c50 struct ip_tunnel *tunnel; in vti_input() local
55 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, TUNNEL_NO_KEY, in vti_input()
57 if (tunnel) { in vti_input()
61 XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel; in vti_input()
64 skb->dev = tunnel->dev; in vti_input()
100 struct ip_tunnel *tunnel = XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4; in vti_rcv_cb() local
104 if (!tunnel) in vti_rcv_cb()
107 dev = tunnel->dev; in vti_rcv_cb()
131 skb->mark = be32_to_cpu(tunnel->parms.i_key); in vti_rcv_cb()
138 skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(skb->dev))); in vti_rcv_cb()
[all …]
/Linux-v5.15/net/ipv6/
Dsit.c71 static bool check_6rd(struct ip_tunnel *tunnel, const struct in6_addr *v6dst,
514 struct ip_tunnel *tunnel = netdev_priv(dev); in ipip6_tunnel_uninit() local
515 struct sit_net *sitn = net_generic(tunnel->net, sit_net_id); in ipip6_tunnel_uninit()
520 ipip6_tunnel_unlink(sitn, tunnel); in ipip6_tunnel_uninit()
521 ipip6_tunnel_del_prl(tunnel, NULL); in ipip6_tunnel_uninit()
523 dst_cache_reset(&tunnel->dst_cache); in ipip6_tunnel_uninit()
605 static inline bool is_spoofed_6rd(struct ip_tunnel *tunnel, const __be32 v4addr, in is_spoofed_6rd() argument
609 if (check_6rd(tunnel, v6addr, &v4embed) && v4addr != v4embed) in is_spoofed_6rd()
626 static bool only_dnatted(const struct ip_tunnel *tunnel, in only_dnatted() argument
632 prefix_len = tunnel->ip6rd.prefixlen + 32 in only_dnatted()
[all …]
Dip6_gre.c496 struct ip6_tnl *tunnel; in ip6gre_rcv() local
499 tunnel = ip6gre_tunnel_lookup(skb->dev, in ip6gre_rcv()
502 if (tunnel) { in ip6gre_rcv()
503 if (tunnel->parms.collect_md) { in ip6gre_rcv()
515 ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in ip6gre_rcv()
517 ip6_tnl_rcv(tunnel, skb, tpi, NULL, log_ecn_error); in ip6gre_rcv()
533 struct ip6_tnl *tunnel; in ip6erspan_rcv() local
540 tunnel = ip6gre_tunnel_lookup(skb->dev, in ip6erspan_rcv()
543 if (tunnel) { in ip6erspan_rcv()
554 if (tunnel->parms.collect_md) { in ip6erspan_rcv()
[all …]
Dip6_tunnel.c793 static int __ip6_tnl_rcv(struct ip6_tnl *tunnel, struct sk_buff *skb, in __ip6_tnl_rcv() argument
806 (tunnel->parms.i_flags & TUNNEL_CSUM)) || in __ip6_tnl_rcv()
808 !(tunnel->parms.i_flags & TUNNEL_CSUM))) { in __ip6_tnl_rcv()
809 tunnel->dev->stats.rx_crc_errors++; in __ip6_tnl_rcv()
810 tunnel->dev->stats.rx_errors++; in __ip6_tnl_rcv()
814 if (tunnel->parms.i_flags & TUNNEL_SEQ) { in __ip6_tnl_rcv()
816 (tunnel->i_seqno && in __ip6_tnl_rcv()
817 (s32)(ntohl(tpi->seq) - tunnel->i_seqno) < 0)) { in __ip6_tnl_rcv()
818 tunnel->dev->stats.rx_fifo_errors++; in __ip6_tnl_rcv()
819 tunnel->dev->stats.rx_errors++; in __ip6_tnl_rcv()
[all …]
/Linux-v5.15/Documentation/networking/
Dl2tp.rst27 An L2TP tunnel carries one or more L2TP sessions. Each tunnel is
30 to/from L2TP. Fields in the L2TP header identify the tunnel or session
40 1) Create a tunnel socket. Exchange L2TP control protocol messages
41 with the peer over that socket in order to establish a tunnel.
43 2) Create a tunnel context in the kernel, using information
47 tunnel socket in order to establish a session.
62 To create a tunnel socket for use by L2TP, the standard POSIX
65 For example, for a tunnel using IPv4 addresses and UDP encapsulation::
69 Or for a tunnel using IPv6 addresses and IP encapsulation::
78 `include/uapi/linux/l2tp.h`_. The address includes the L2TP tunnel
[all …]
Dbareudp.rst11 The Bareudp tunnel module provides a generic L3 encapsulation support for
12 tunnelling different L3 protocols like MPLS, IP, NSH etc. inside a UDP tunnel.
30 This creates a bareudp tunnel device which tunnels L3 traffic with ethertype
44 For an IPv4 tunnel the multiproto mode allows the tunnel to also handle
49 For MPLS, the multiproto mode allows the tunnel to handle both unicast
55 The OVS or TC flower layer must set the tunnel information in SKB dst field before
57 bareudp device extracts and stores the tunnel information in SKB dst field before
Dgtp.rst12 of a GTP tunnel endpoint.
24 such a tunnel between that external data network and the phone. The
25 tunnel endpoints thus reside on the phone and in the gateway. All
35 is translated into GTP *without breaking the end-to-end tunnel*. So
39 or P-GW (LTE), which terminates the tunnel, decapsulates the packet
53 The module implements the function of a tunnel endpoint, i.e. it is
70 to handle the tunnel establishment, authentication etc. and only the
159 Local GTP-U entity and tunnel identification
169 A specific tunnel is only defined by the destination entity. Since the
171 a tunnel. The source IP and Port have no meaning for the tunnel.
[all …]
/Linux-v5.15/tools/testing/selftests/bpf/
Dwith_tunnels.sh15 ip tunnel show
24 ip tunnel del "ipip_${SUFFIX}"
25 ip tunnel del "gre_${SUFFIX}"
26 ip tunnel del "sit_${SUFFIX}"
29 ip tunnel show
/Linux-v5.15/tools/testing/selftests/net/
Dvrf-xfrm-tests.sh223 tmpl src ${HOST1_4} dst ${HOST2_4} proto esp mode tunnel
228 tmpl src ${HOST1_4} dst ${HOST2_4} proto esp mode tunnel
233 tmpl src ${HOST2_4} dst ${HOST1_4} proto esp mode tunnel
238 tmpl src ${HOST2_4} dst ${HOST1_4} proto esp mode tunnel
244 tmpl src ${HOST1_6} dst ${HOST2_6} proto esp mode tunnel
249 tmpl src ${HOST1_6} dst ${HOST2_6} proto esp mode tunnel
254 tmpl src ${HOST2_6} dst ${HOST1_6} proto esp mode tunnel
259 tmpl src ${HOST2_6} dst ${HOST1_6} proto esp mode tunnel
265 proto esp spi ${SPI_1} reqid 0 mode tunnel \
272 proto esp spi ${SPI_1} reqid 0 mode tunnel \
[all …]
/Linux-v5.15/drivers/net/ethernet/mellanox/mlx5/core/en/
Dtc_tun.c184 if (!e->tunnel) { in mlx5e_gen_ip_tunnel_header()
189 return e->tunnel->generate_ip_tun_hdr(buf, ip_proto, e); in mlx5e_gen_ip_tunnel_header()
244 e->tunnel->calc_hlen(e); in mlx5e_tc_tun_create_header_ipv4()
359 e->tunnel->calc_hlen(e); in mlx5e_tc_tun_update_header_ipv4()
510 e->tunnel->calc_hlen(e); in mlx5e_tc_tun_create_header_ipv6()
624 e->tunnel->calc_hlen(e); in mlx5e_tc_tun_update_header_ipv6()
754 struct mlx5e_tc_tunnel *tunnel = mlx5e_get_tc_tun(netdev); in mlx5e_tc_tun_device_to_offload() local
756 if (tunnel && tunnel->can_offload(priv)) in mlx5e_tc_tun_device_to_offload()
767 struct mlx5e_tc_tunnel *tunnel = mlx5e_get_tc_tun(tunnel_dev); in mlx5e_tc_tun_init_encap_attr() local
769 if (!tunnel) { in mlx5e_tc_tun_init_encap_attr()
[all …]
/Linux-v5.15/drivers/net/ethernet/mellanox/mlxsw/
Dspectrum_ipip.c203 struct ip_tunnel *tunnel = netdev_priv(ol_dev); in mlxsw_sp_ipip_can_offload_gre4() local
205 bool inherit_ttl = tunnel->parms.iph.ttl == 0; in mlxsw_sp_ipip_can_offload_gre4()
206 bool inherit_tos = tunnel->parms.iph.tos & 0x1; in mlxsw_sp_ipip_can_offload_gre4()
208 return (tunnel->parms.i_flags & ~okflags) == 0 && in mlxsw_sp_ipip_can_offload_gre4()
209 (tunnel->parms.o_flags & ~okflags) == 0 && in mlxsw_sp_ipip_can_offload_gre4()

123456