| /kernel/linux/linux-5.10/drivers/thunderbolt/ |
| D | tunnel.c | 13 #include "tunnel.h" 42 #define __TB_TUNNEL_PRINT(level, tunnel, fmt, arg...) \ argument 44 struct tb_tunnel *__tunnel = (tunnel); \ 54 #define tb_tunnel_WARN(tunnel, fmt, arg...) \ argument 55 __TB_TUNNEL_PRINT(tb_WARN, tunnel, fmt, ##arg) 56 #define tb_tunnel_warn(tunnel, fmt, arg...) \ argument 57 __TB_TUNNEL_PRINT(tb_warn, tunnel, fmt, ##arg) 58 #define tb_tunnel_info(tunnel, fmt, arg...) \ argument 59 __TB_TUNNEL_PRINT(tb_info, tunnel, fmt, ##arg) 60 #define tb_tunnel_dbg(tunnel, fmt, arg...) \ argument [all …]
|
| D | tunnel.h | 22 * struct tb_tunnel - Tunnel between two ports 24 * @src_port: Source port of the tunnel 25 * @dst_port: Destination port of the tunnel. For discovered incomplete 27 * @paths: All paths required by the tunnel 29 * @init: Optional tunnel specific initialization 30 * @activate: Optional tunnel specific activation/deactivation 31 * @consumed_bandwidth: Return how much bandwidth the tunnel consumes 35 * @type: Type of the tunnel 36 * @max_up: Maximum upstream bandwidth (Mb/s) available for the tunnel. 38 * @max_down: Maximum downstream bandwidth (Mb/s) available for the tunnel. [all …]
|
| D | tb.c | 16 #include "tunnel.h" 112 struct tb_tunnel *tunnel = NULL; in tb_discover_tunnels() local 116 tunnel = tb_tunnel_discover_dp(tb, port); in tb_discover_tunnels() 120 tunnel = tb_tunnel_discover_pci(tb, port); in tb_discover_tunnels() 124 tunnel = tb_tunnel_discover_usb3(tb, port); in tb_discover_tunnels() 131 if (!tunnel) in tb_discover_tunnels() 134 if (tb_tunnel_is_pci(tunnel)) { in tb_discover_tunnels() 135 struct tb_switch *parent = tunnel->dst_port->sw; in tb_discover_tunnels() 137 while (parent != tunnel->src_port->sw) { in tb_discover_tunnels() 141 } else if (tb_tunnel_is_dp(tunnel)) { in tb_discover_tunnels() [all …]
|
| /kernel/linux/linux-6.6/drivers/thunderbolt/ |
| D | tunnel.c | 15 #include "tunnel.h" 108 /* Add some credits for potential second DMA tunnel */ in tb_available_credits() 140 struct tb_tunnel *tunnel; in tb_tunnel_alloc() local 142 tunnel = kzalloc(sizeof(*tunnel), GFP_KERNEL); in tb_tunnel_alloc() 143 if (!tunnel) in tb_tunnel_alloc() 146 tunnel->paths = kcalloc(npaths, sizeof(tunnel->paths[0]), GFP_KERNEL); in tb_tunnel_alloc() 147 if (!tunnel->paths) { in tb_tunnel_alloc() 148 tb_tunnel_free(tunnel); in tb_tunnel_alloc() 152 INIT_LIST_HEAD(&tunnel->list); in tb_tunnel_alloc() 153 tunnel->tb = tb; in tb_tunnel_alloc() [all …]
|
| D | tunnel.h | 22 * struct tb_tunnel - Tunnel between two ports 24 * @src_port: Source port of the tunnel 25 * @dst_port: Destination port of the tunnel. For discovered incomplete 27 * @paths: All paths required by the tunnel 29 * @init: Optional tunnel specific initialization 30 * @deinit: Optional tunnel specific de-initialization 31 * @activate: Optional tunnel specific activation/deactivation 32 * @maximum_bandwidth: Returns maximum possible bandwidth for this tunnel 33 * @allocated_bandwidth: Return how much bandwidth is allocated for the tunnel 34 * @alloc_bandwidth: Change tunnel bandwidth allocation [all …]
|
| D | tb.c | 17 #include "tunnel.h" 122 struct tb_tunnel *tunnel; in tb_attach_bandwidth_group() local 130 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_attach_bandwidth_group() 131 if (!tb_tunnel_is_dp(tunnel)) in tb_attach_bandwidth_group() 134 if (tunnel->src_port->sw == in->sw && in tb_attach_bandwidth_group() 135 tunnel->dst_port->sw == out->sw) { in tb_attach_bandwidth_group() 136 group = tunnel->src_port->group; in tb_attach_bandwidth_group() 258 struct tb_tunnel *tunnel; in tb_discover_dp_resources() local 260 list_for_each_entry(tunnel, &tcm->tunnel_list, list) { in tb_discover_dp_resources() 261 if (tb_tunnel_is_dp(tunnel)) in tb_discover_dp_resources() [all …]
|
| D | test.c | 13 #include "tunnel.h" 1341 * Create PCIe tunnel between host and two devices. in tb_test_tunnel_pcie() 1393 struct tb_tunnel *tunnel; in tb_test_tunnel_dp() local 1396 * Create DP tunnel between Host and Device in tb_test_tunnel_dp() 1409 tunnel = tb_tunnel_alloc_dp(NULL, in, out, 1, 0, 0); in tb_test_tunnel_dp() 1410 KUNIT_ASSERT_NOT_NULL(test, tunnel); in tb_test_tunnel_dp() 1411 KUNIT_EXPECT_EQ(test, tunnel->type, TB_TUNNEL_DP); in tb_test_tunnel_dp() 1412 KUNIT_EXPECT_PTR_EQ(test, tunnel->src_port, in); in tb_test_tunnel_dp() 1413 KUNIT_EXPECT_PTR_EQ(test, tunnel->dst_port, out); in tb_test_tunnel_dp() 1414 KUNIT_ASSERT_EQ(test, tunnel->npaths, 3); in tb_test_tunnel_dp() [all …]
|
| /kernel/linux/linux-5.10/net/l2tp/ |
| D | l2tp_core.c | 146 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() 155 /* the tunnel is freed in the socket destructor */ 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() [all …]
|
| D | l2tp_ppp.c | 27 * zero, the socket is treated as a special tunnel management socket. 151 /* Helpers to obtain tunnel/session contexts from sockets. 273 struct l2tp_tunnel *tunnel; in pppol2tp_sendmsg() local 280 /* Get session and tunnel contexts */ in pppol2tp_sendmsg() 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 356 /* Get session and tunnel contexts from the socket */ in pppol2tp_xmit() 361 tunnel = session->tunnel; in pppol2tp_xmit() 363 uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; in pppol2tp_xmit() [all …]
|
| D | l2tp_netlink.c | 38 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 220 /* Managed tunnels take the tunnel socket from userspace. in l2tp_nl_cmd_tunnel_create() [all …]
|
| D | l2tp_debugfs.c | 36 int tunnel_idx; /* current tunnel */ 37 int session_idx; /* index of session within current tunnel */ 38 struct l2tp_tunnel *tunnel; member 39 struct l2tp_session *session; /* NULL means get next tunnel */ 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() 86 /* NULL tunnel and session indicates end of list */ in l2tp_dfs_seq_start() [all …]
|
| D | l2tp_core.h | 18 /* Random numbers used for internal consistency checks of tunnel and session structures */ 22 /* Per tunnel session hash table size */ 66 * Is linked into a per-tunnel session hashlist; and in the case of an L2TPv3 session into 74 struct l2tp_tunnel *tunnel; /* back pointer to tunnel context */ member 86 u32 nr_max; /* max NR. Depends on tunnel */ 132 /* L2TP tunnel configuration */ 150 /* Represents a tunnel instance. 152 * Holds the tunnel socket (either passed from userspace or directly created by the kernel). 153 * Maintains a hashlist of sessions belonging to the tunnel instance. 164 bool acpt_newsess; /* indicates whether this tunnel accepts [all …]
|
| /kernel/linux/linux-6.6/net/l2tp/ |
| D | l2tp_core.c | 151 l2tp_session_id_hash(struct l2tp_tunnel *tunnel, u32 session_id) in l2tp_session_id_hash() argument 153 return &tunnel->session_hlist[hash_32(session_id, L2TP_HASH_BITS)]; in l2tp_session_id_hash() 156 static void l2tp_tunnel_free(struct l2tp_tunnel *tunnel) in l2tp_tunnel_free() argument 158 trace_free_tunnel(tunnel); in l2tp_tunnel_free() 159 sock_put(tunnel->sock); in l2tp_tunnel_free() 160 /* the tunnel is freed in the socket destructor */ in l2tp_tunnel_free() 166 if (session->tunnel) in l2tp_session_free() 167 l2tp_tunnel_dec_refcount(session->tunnel); in l2tp_session_free() 173 struct l2tp_tunnel *tunnel = sk->sk_user_data; in l2tp_sk_to_tunnel() local 175 if (tunnel) in l2tp_sk_to_tunnel() [all …]
|
| D | l2tp_ppp.c | 27 * zero, the socket is treated as a special tunnel management socket. 151 /* Helpers to obtain tunnel/session contexts from sockets. 272 struct l2tp_tunnel *tunnel; in pppol2tp_sendmsg() local 279 /* Get session and tunnel contexts */ in pppol2tp_sendmsg() 285 tunnel = session->tunnel; in pppol2tp_sendmsg() 287 uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; in pppol2tp_sendmsg() 349 struct l2tp_tunnel *tunnel; in pppol2tp_xmit() local 355 /* Get session and tunnel contexts from the socket */ in pppol2tp_xmit() 360 tunnel = session->tunnel; in pppol2tp_xmit() 362 uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; in pppol2tp_xmit() [all …]
|
| D | l2tp_netlink.c | 38 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 220 /* Managed tunnels take the tunnel socket from userspace. in l2tp_nl_cmd_tunnel_create() [all …]
|
| D | l2tp_debugfs.c | 37 int tunnel_idx; /* current tunnel */ 38 int session_idx; /* index of session within current tunnel */ 39 struct l2tp_tunnel *tunnel; member 40 struct l2tp_session *session; /* NULL means get next tunnel */ 46 if (pd->tunnel) in l2tp_dfs_next_tunnel() 47 l2tp_tunnel_dec_refcount(pd->tunnel); in l2tp_dfs_next_tunnel() 49 pd->tunnel = l2tp_tunnel_get_nth(pd->net, pd->tunnel_idx); in l2tp_dfs_next_tunnel() 59 pd->session = l2tp_session_get_nth(pd->tunnel, pd->session_idx); in l2tp_dfs_next_session() 82 if (!pd->tunnel) in l2tp_dfs_seq_start() 87 /* NULL tunnel and session indicates end of list */ in l2tp_dfs_seq_start() [all …]
|
| D | l2tp_core.h | 18 /* Random numbers used for internal consistency checks of tunnel and session structures */ 22 /* Per tunnel session hash table size */ 66 * Is linked into a per-tunnel session hashlist; and in the case of an L2TPv3 session into 74 struct l2tp_tunnel *tunnel; /* back pointer to tunnel context */ member 86 u32 nr_max; /* max NR. Depends on tunnel */ 132 /* L2TP tunnel configuration */ 150 /* Represents a tunnel instance. 152 * Holds the tunnel socket (either passed from userspace or directly created by the kernel). 153 * Maintains a hashlist of sessions belonging to the tunnel instance. 164 bool acpt_newsess; /* indicates whether this tunnel accepts [all …]
|
| D | trace.h | 28 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 …]
|
| /kernel/linux/linux-5.10/Documentation/networking/ |
| D | l2tp.rst | 27 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. 57 Tunnel Sockets 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:: [all …]
|
| /kernel/linux/linux-6.6/Documentation/networking/ |
| D | l2tp.rst | 27 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. 57 Tunnel Sockets 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:: [all …]
|
| /kernel/linux/linux-5.10/include/uapi/linux/ |
| D | ip6_tunnel.h | 28 char name[IFNAMSIZ]; /* name of tunnel device */ 30 __u8 proto; /* tunnel protocol */ 31 __u8 encap_limit; /* encapsulation limit for tunnel */ 32 __u8 hop_limit; /* hop limit for tunnel */ 33 __be32 flowinfo; /* traffic class and flowlabel for tunnel */ 34 __u32 flags; /* tunnel flags */ 35 struct in6_addr laddr; /* local tunnel end-point address */ 36 struct in6_addr raddr; /* remote tunnel end-point address */ 40 char name[IFNAMSIZ]; /* name of tunnel device */ 42 __u8 proto; /* tunnel protocol */ [all …]
|
| /kernel/linux/linux-6.6/include/uapi/linux/ |
| D | ip6_tunnel.h | 28 char name[IFNAMSIZ]; /* name of tunnel device */ 30 __u8 proto; /* tunnel protocol */ 31 __u8 encap_limit; /* encapsulation limit for tunnel */ 32 __u8 hop_limit; /* hop limit for tunnel */ 33 __be32 flowinfo; /* traffic class and flowlabel for tunnel */ 34 __u32 flags; /* tunnel flags */ 35 struct in6_addr laddr; /* local tunnel end-point address */ 36 struct in6_addr raddr; /* remote tunnel end-point address */ 40 char name[IFNAMSIZ]; /* name of tunnel device */ 42 __u8 proto; /* tunnel protocol */ [all …]
|
| /kernel/linux/linux-5.10/net/ipv4/ |
| D | ip_tunnel.c | 72 /* Fallback tunnel: no source, no destination, no key, no options 74 Tunnel hash table: 76 it will match only tunnel with the same key; if it is not present, 77 it will match only keyless tunnel. 80 will match fallback tunnel. 81 Given src, dst and key, find appropriate for input tunnel. 237 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() [all …]
|
| /kernel/linux/linux-6.6/net/ipv4/ |
| D | ip_tunnel.c | 73 /* Fallback tunnel: no source, no destination, no key, no options 75 Tunnel hash table: 77 it will match only tunnel with the same key; if it is not present, 78 it will match only keyless tunnel. 81 will match fallback tunnel. 82 Given src, dst and key, find appropriate for input tunnel. 237 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() [all …]
|
| /kernel/linux/linux-6.6/drivers/net/ |
| D | amt.c | 121 static u32 amt_source_hash(struct amt_tunnel_list *tunnel, union amt_addr *src) in amt_source_hash() argument 123 u32 hash = jhash(src, sizeof(*src), tunnel->amt->hash_seed); in amt_source_hash() 125 return reciprocal_scale(hash, tunnel->amt->hash_buckets); in amt_source_hash() 182 static struct amt_source_node *amt_lookup_src(struct amt_tunnel_list *tunnel, in amt_lookup_src() argument 187 u32 hash = amt_source_hash(tunnel, src); in amt_lookup_src() 198 static u32 amt_group_hash(struct amt_tunnel_list *tunnel, union amt_addr *group) in amt_group_hash() argument 200 u32 hash = jhash(group, sizeof(*group), tunnel->amt->hash_seed); in amt_group_hash() 202 return reciprocal_scale(hash, tunnel->amt->hash_buckets); in amt_group_hash() 205 static struct amt_group_node *amt_lookup_group(struct amt_tunnel_list *tunnel, in amt_lookup_group() argument 210 u32 hash = amt_group_hash(tunnel, group); in amt_lookup_group() [all …]
|