tpi
char *ipi, *tpi;
tpi = req->rdma_req.target_port_id;
tpi = req->ib_req.target_port_id;
memcpy(tpi, &target->ioc_guid, 8);
memcpy(tpi + 8, &target->id_ext, 8);
memcpy(tpi, &target->id_ext, 8);
memcpy(tpi + 8, &target->ioc_guid, 8);
int tpi(struct tpi_info *addr);
int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,
const struct tnl_ptk_info *tpi, struct metadata_dst *tun_dst,
const struct tnl_ptk_info *tpi, struct metadata_dst *tun_dst,
tpi->key = 0;
tpi->seq = *options;
tpi->seq = 0;
if (greh->flags == 0 && tpi->proto == htons(ETH_P_WCCP)) {
tpi->proto = proto;
tpi->hdr_len = hdr_len;
tpi->key = cpu_to_be32(get_session_id(ershdr));
int gre_parse_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,
gre_flags_to_tnl_flags(tpi->flags, greh->flags);
hdr_len = gre_calc_hlen(tpi->flags);
tpi->proto = greh->protocol;
tpi->key = *options;
const struct tnl_ptk_info *tpi)
if (tpi->proto == htons(ETH_P_TEB))
else if (tpi->proto == htons(ETH_P_ERSPAN) ||
tpi->proto == htons(ETH_P_ERSPAN2))
t = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi->flags,
iph->daddr, iph->saddr, tpi->key);
if (tpi->proto == htons(ETH_P_IPV6)) {
if (!ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4 + tpi->hdr_len,
struct tnl_ptk_info tpi;
if (gre_parse_header(skb, &tpi, NULL, htons(ETH_P_IP),
ipgre_err(skb, info, &tpi);
static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
ip_tunnel_flags_copy(flags, tpi->flags);
iph->saddr, iph->daddr, tpi->key);
__set_bit(IP_TUNNEL_KEY_BIT, tpi->flags);
ip_tunnel_flags_copy(flags, tpi->flags);
tun_id = key32_to_tunnel_id(tpi->key);
ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error);
static int __ipgre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, tpi->flags,
iph->saddr, iph->daddr, tpi->key);
if (__iptunnel_pull_header(skb, hdr_len, tpi->proto,
ip_tunnel_flags_and(flags, tpi->flags, flags);
tun_id = key32_to_tunnel_id(tpi->key);
ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error);
static int ipgre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
if (tpi->proto == htons(ETH_P_TEB))
res = __ipgre_rcv(skb, tpi, itn, hdr_len, false);
if (res == PACKET_NEXT && tpi->proto == htons(ETH_P_TEB)) {
res = __ipgre_rcv(skb, tpi, itn, hdr_len, true);
struct tnl_ptk_info tpi;
hdr_len = gre_parse_header(skb, &tpi, &csum_err, htons(ETH_P_IP), 0);
if (unlikely(tpi.proto == htons(ETH_P_ERSPAN) ||
tpi.proto == htons(ETH_P_ERSPAN2))) {
if (erspan_rcv(skb, &tpi, hdr_len) == PACKET_RCVD)
if (ipgre_rcv(skb, &tpi, hdr_len) == PACKET_RCVD)
const struct tnl_ptk_info *tpi, struct metadata_dst *tun_dst,
test_bit(IP_TUNNEL_CSUM_BIT, tpi->flags)) {
if (!test_bit(IP_TUNNEL_SEQ_BIT, tpi->flags) ||
(tunnel->i_seqno && (s32)(ntohl(tpi->seq) - tunnel->i_seqno) < 0)) {
tunnel->i_seqno = ntohl(tpi->seq) + 1;
const struct tnl_ptk_info *tpi;
tpi = &mplsip_tpi;
tpi = &ipip_tpi;
if (iptunnel_pull_header(skb, 0, tpi->proto, false))
return ip_tunnel_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error);
struct tnl_ptk_info tpi;
if (gre_parse_header(skb, &tpi, NULL, htons(ETH_P_IPV6),
tpi.key, tpi.proto);
static int ip6gre_rcv(struct sk_buff *skb, const struct tnl_ptk_info *tpi)
&ipv6h->saddr, &ipv6h->daddr, tpi->key,
tpi->proto);
ip_tunnel_flags_copy(flags, tpi->flags);
tun_id = key32_to_tunnel_id(tpi->key);
ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error);
ip6_tnl_rcv(tunnel, skb, tpi, NULL, log_ecn_error);
struct tnl_ptk_info *tpi,
&ipv6h->saddr, &ipv6h->daddr, tpi->key,
tpi->proto);
__set_bit(IP_TUNNEL_KEY_BIT, tpi->flags);
ip_tunnel_flags_copy(flags, tpi->flags);
tun_id = key32_to_tunnel_id(tpi->key);
ip6_tnl_rcv(tunnel, skb, tpi, tun_dst, log_ecn_error);
ip6_tnl_rcv(tunnel, skb, tpi, NULL, log_ecn_error);
struct tnl_ptk_info tpi;
hdr_len = gre_parse_header(skb, &tpi, &csum_err, htons(ETH_P_IPV6), 0);
if (iptunnel_pull_header(skb, hdr_len, tpi.proto, false))
if (unlikely(tpi.proto == htons(ETH_P_ERSPAN) ||
tpi.proto == htons(ETH_P_ERSPAN2))) {
if (ip6erspan_rcv(skb, &tpi, hdr_len) == PACKET_RCVD)
if (ip6gre_rcv(skb, &tpi) == PACKET_RCVD)
const struct tnl_ptk_info *tpi,
test_bit(IP_TUNNEL_CSUM_BIT, tpi->flags)) {
if (!test_bit(IP_TUNNEL_SEQ_BIT, tpi->flags) ||
(s32)(ntohl(tpi->seq) - tunnel->i_seqno) < 0)) {
tunnel->i_seqno = ntohl(tpi->seq) + 1;
skb->protocol = tpi->proto;
const struct tnl_ptk_info *tpi,
if (tpi->proto == htons(ETH_P_IP))
return __ip6_tnl_rcv(t, skb, tpi, tun_dst, dscp_ecn_decapsulate,
const struct tnl_ptk_info *tpi,
if (iptunnel_pull_header(skb, 0, tpi->proto, false))
ret = __ip6_tnl_rcv(t, skb, tpi, tun_dst, dscp_ecn_decapsulate,
const struct tnl_ptk_info *tpi;
tpi = &mplsip_tpi;
tpi = &ipip_tpi;
if (iptunnel_pull_header(skb, 0, tpi->proto, false))
return ip_tunnel_rcv(tunnel, skb, tpi, NULL, log_ecn_error);