/openbmc/linux/drivers/thunderbolt/ |
H A D | tunnel.c | 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() 154 tunnel->npaths = npaths; in tb_tunnel_alloc() 155 tunnel->type = type; in tb_tunnel_alloc() [all …]
|
H A D | tunnel.h | 55 int (*init)(struct tb_tunnel *tunnel); 56 void (*deinit)(struct tb_tunnel *tunnel); 57 int (*activate)(struct tb_tunnel *tunnel, bool activate); 58 int (*maximum_bandwidth)(struct tb_tunnel *tunnel, int *max_up, 60 int (*allocated_bandwidth)(struct tb_tunnel *tunnel, int *allocated_up, 62 int (*alloc_bandwidth)(struct tb_tunnel *tunnel, int *alloc_up, 64 int (*consumed_bandwidth)(struct tb_tunnel *tunnel, int *consumed_up, 66 int (*release_unused_bandwidth)(struct tb_tunnel *tunnel); 67 void (*reclaim_available_bandwidth)(struct tb_tunnel *tunnel, 94 bool tb_tunnel_match_dma(const struct tb_tunnel *tunnel, int transmit_path, [all …]
|
H A D | tb.c | 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() 262 tb_discover_dp_resource(tb, tunnel->dst_port); in tb_discover_dp_resources() [all …]
|
H A D | test.c | 1393 struct tb_tunnel *tunnel; in tb_test_tunnel_dp() local 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() 1415 KUNIT_ASSERT_EQ(test, tunnel->paths[0]->path_length, 2); in tb_test_tunnel_dp() 1416 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[0].in_port, in); in tb_test_tunnel_dp() 1417 KUNIT_EXPECT_PTR_EQ(test, tunnel->paths[0]->hops[1].out_port, out); in tb_test_tunnel_dp() [all …]
|
/openbmc/linux/net/l2tp/ |
H A 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() 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() 176 if (WARN_ON(tunnel->magic != L2TP_TUNNEL_MAGIC)) in l2tp_sk_to_tunnel() [all …]
|
H A D | l2tp_debugfs.c | 39 struct l2tp_tunnel *tunnel; member 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() 88 if (!pd->tunnel && !pd->session) in l2tp_dfs_seq_start() 115 if (pd->tunnel) { in l2tp_dfs_seq_stop() 116 l2tp_tunnel_dec_refcount(pd->tunnel); in l2tp_dfs_seq_stop() 117 pd->tunnel = NULL; in l2tp_dfs_seq_stop() [all …]
|
H A D | l2tp_ppp.c | 272 struct l2tp_tunnel *tunnel; in pppol2tp_sendmsg() local 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 360 tunnel = session->tunnel; in pppol2tp_xmit() 362 uhlen = (tunnel->encap == L2TP_ENCAPTYPE_UDP) ? sizeof(struct udphdr) : 0; in pppol2tp_xmit() 642 static int pppol2tp_tunnel_mtu(const struct l2tp_tunnel *tunnel) in pppol2tp_tunnel_mtu() argument 646 mtu = l2tp_tunnel_dst_mtu(tunnel); in pppol2tp_tunnel_mtu() 657 struct l2tp_tunnel *tunnel; in pppol2tp_tunnel_get() local 662 tunnel = l2tp_tunnel_get(net, info->tunnel_id); in pppol2tp_tunnel_get() [all …]
|
H A 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 237 peer_tunnel_id, &cfg, &tunnel); in l2tp_nl_cmd_tunnel_create() [all …]
|
H A 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 …]
|
H A D | l2tp_core.h | 74 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 …]
|
H A D | l2tp_eth.c | 207 static void l2tp_eth_adjust_mtu(struct l2tp_tunnel *tunnel, in l2tp_eth_adjust_mtu() argument 216 if (tunnel->encap == L2TP_ENCAPTYPE_UDP) { in l2tp_eth_adjust_mtu() 221 lock_sock(tunnel->sock); in l2tp_eth_adjust_mtu() 222 l3_overhead = kernel_sock_ip_overhead(tunnel->sock); in l2tp_eth_adjust_mtu() 223 release_sock(tunnel->sock); in l2tp_eth_adjust_mtu() 238 mtu = l2tp_tunnel_dst_mtu(tunnel) - overhead; in l2tp_eth_adjust_mtu() 247 static int l2tp_eth_create(struct net *net, struct l2tp_tunnel *tunnel, in l2tp_eth_create() argument 267 session = l2tp_session_create(sizeof(*spriv), tunnel, session_id, in l2tp_eth_create() 284 l2tp_eth_adjust_mtu(tunnel, session, dev); in l2tp_eth_create() 304 rc = l2tp_session_register(session, tunnel); in l2tp_eth_create()
|
/openbmc/linux/drivers/net/ |
H A 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 …]
|
/openbmc/linux/net/ipv4/ |
H A D | ip_tunnel.c | 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() 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 iph->tos & INET_DSCP_MASK, tunnel->net, in ip_tunnel_bind_dev() 298 tunnel->parms.link, tunnel->fwmark, 0, 0); in ip_tunnel_bind_dev() [all …]
|
H A D | ip_gre.c | 269 struct ip_tunnel *tunnel; in erspan_rcv() local 279 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, in erspan_rcv() 290 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, in erspan_rcv() 295 if (tunnel) { in erspan_rcv() 310 if (tunnel->collect_md) { in erspan_rcv() 346 ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in erspan_rcv() 361 struct ip_tunnel *tunnel; in __ipgre_rcv() local 364 tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi->flags, in __ipgre_rcv() 367 if (tunnel) { in __ipgre_rcv() 377 if (tunnel->dev->header_ops == &ipgre_header_ops) in __ipgre_rcv() [all …]
|
H A D | ipip.c | 217 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() 248 return ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in ipip_tunnel_rcv() 277 struct ip_tunnel *tunnel = netdev_priv(dev); in ipip_tunnel_xmit() local 278 const struct iphdr *tiph = &tunnel->parms.iph; in ipip_tunnel_xmit() 305 if (tunnel->collect_md) in ipip_tunnel_xmit() [all …]
|
H A D | ip_vti.c | 50 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 …]
|
/openbmc/linux/net/ipv6/ |
H A D | sit.c | 71 static bool check_6rd(struct ip_tunnel *tunnel, const struct in6_addr *v6dst, 512 struct ip_tunnel *tunnel = netdev_priv(dev); in ipip6_tunnel_uninit() local 513 struct sit_net *sitn = net_generic(tunnel->net, sit_net_id); in ipip6_tunnel_uninit() 518 ipip6_tunnel_unlink(sitn, tunnel); in ipip6_tunnel_uninit() 519 ipip6_tunnel_del_prl(tunnel, NULL); in ipip6_tunnel_uninit() 521 dst_cache_reset(&tunnel->dst_cache); in ipip6_tunnel_uninit() 522 netdev_put(dev, &tunnel->dev_tracker); in ipip6_tunnel_uninit() 603 static inline bool is_spoofed_6rd(struct ip_tunnel *tunnel, const __be32 v4addr, in is_spoofed_6rd() argument 607 if (check_6rd(tunnel, v6addr, &v4embed) && v4addr != v4embed) in is_spoofed_6rd() 624 static bool only_dnatted(const struct ip_tunnel *tunnel, in only_dnatted() argument [all …]
|
H A D | ip6_gre.c | 491 struct ip6_tnl *tunnel; in ip6gre_rcv() local 494 tunnel = ip6gre_tunnel_lookup(skb->dev, in ip6gre_rcv() 497 if (tunnel) { in ip6gre_rcv() 498 if (tunnel->parms.collect_md) { in ip6gre_rcv() 510 ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error); in ip6gre_rcv() 512 ip6_tnl_rcv(tunnel, skb, tpi, NULL, log_ecn_error); in ip6gre_rcv() 528 struct ip6_tnl *tunnel; in ip6erspan_rcv() local 538 tunnel = ip6gre_tunnel_lookup(skb->dev, in ip6erspan_rcv() 541 if (tunnel) { in ip6erspan_rcv() 552 if (tunnel->parms.collect_md) { in ip6erspan_rcv() [all …]
|
/openbmc/linux/Documentation/networking/ |
H A 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. 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 …]
|
H A D | bareudp.rst | 11 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
|
H A D | gtp.rst | 12 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 …]
|
/openbmc/linux/tools/testing/selftests/bpf/ |
H A D | with_tunnels.sh | 15 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
|
/openbmc/linux/tools/testing/selftests/net/ |
H A D | vrf-xfrm-tests.sh | 223 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 …]
|
/openbmc/linux/drivers/net/ethernet/mellanox/mlx5/core/en/ |
H A D | tc_tun.c | 126 struct mlx5e_tc_tunnel *tunnel = mlx5e_get_tc_tun(dev); in mlx5e_route_lookup_ipv4_get() local 128 if (tunnel && tunnel->get_remote_ifindex) in mlx5e_route_lookup_ipv4_get() 129 attr->fl.fl4.flowi4_oif = tunnel->get_remote_ifindex(dev); in mlx5e_route_lookup_ipv4_get() 191 if (!e->tunnel) { in mlx5e_gen_ip_tunnel_header() 196 return e->tunnel->generate_ip_tun_hdr(buf, ip_proto, e); in mlx5e_gen_ip_tunnel_header() 251 e->tunnel->calc_hlen(e); in mlx5e_tc_tun_create_header_ipv4() 366 e->tunnel->calc_hlen(e); in mlx5e_tc_tun_update_header_ipv4() 447 struct mlx5e_tc_tunnel *tunnel = mlx5e_get_tc_tun(dev); in mlx5e_route_lookup_ipv6_get() local 454 if (tunnel && tunnel->get_remote_ifindex) in mlx5e_route_lookup_ipv6_get() 455 attr->fl.fl6.flowi6_oif = tunnel->get_remote_ifindex(dev); in mlx5e_route_lookup_ipv6_get() [all …]
|
/openbmc/linux/drivers/net/ethernet/mellanox/mlx5/core/lag/ |
H A D | port_sel.c | 198 enum mlx5_traffic_types tt, bool tunnel, in mlx5_lag_set_definer() argument 204 if (tunnel) in mlx5_lag_set_definer() 296 enum mlx5_traffic_types tt, bool tunnel, u8 *ports) in mlx5_lag_create_definer() argument 315 format_id = mlx5_lag_set_definer(match_definer_mask, tt, tunnel, hash); in mlx5_lag_create_definer() 393 if (!port_sel->tunnel) in mlx5_lag_create_definers() 416 port_sel->tunnel = false; in set_tt_map() 420 port_sel->tunnel = true; in set_tt_map() 432 port_sel->tunnel = true; in set_tt_map() 494 ttc_params->inner_ttc = port_sel->tunnel; in mlx5_lag_set_outer_ttc_params() 495 if (!port_sel->tunnel) in mlx5_lag_set_outer_ttc_params() [all …]
|