Lines Matching +full:eth +full:- +full:mac
31 __be64 mac; member
38 __be64 mac; member
76 void *data_end = (void *)(long)ctx->data_end; in xdp_router_ipv4_prog()
77 void *data = (void *)(long)ctx->data; in xdp_router_ipv4_prog()
78 struct ethhdr *eth = data; in xdp_router_ipv4_prog() local
79 u64 nh_off = sizeof(*eth); in xdp_router_ipv4_prog()
86 NO_TEAR_INC(rec->processed); in xdp_router_ipv4_prog()
91 h_proto = eth->h_proto; in xdp_router_ipv4_prog()
101 h_proto = vhdr->h_vlan_encapsulated_proto; in xdp_router_ipv4_prog()
107 NO_TEAR_INC(rec->xdp_pass); in xdp_router_ipv4_prog()
118 direct_entry = bpf_map_lookup_elem(&exact_match, &iph->daddr); in xdp_router_ipv4_prog()
121 if (direct_entry && direct_entry->mac && in xdp_router_ipv4_prog()
122 direct_entry->arp.mac) { in xdp_router_ipv4_prog()
123 src_mac = &direct_entry->mac; in xdp_router_ipv4_prog()
124 dest_mac = &direct_entry->arp.mac; in xdp_router_ipv4_prog()
125 forward_to = direct_entry->ifindex; in xdp_router_ipv4_prog()
132 key4.b8[4] = iph->daddr & 0xff; in xdp_router_ipv4_prog()
133 key4.b8[5] = (iph->daddr >> 8) & 0xff; in xdp_router_ipv4_prog()
134 key4.b8[6] = (iph->daddr >> 16) & 0xff; in xdp_router_ipv4_prog()
135 key4.b8[7] = (iph->daddr >> 24) & 0xff; in xdp_router_ipv4_prog()
141 forward_to = prefix_value->ifindex; in xdp_router_ipv4_prog()
142 src_mac = &prefix_value->value; in xdp_router_ipv4_prog()
146 dest_mac = bpf_map_lookup_elem(&arp_table, &iph->daddr); in xdp_router_ipv4_prog()
148 if (!prefix_value->gw) in xdp_router_ipv4_prog()
152 &prefix_value->gw); in xdp_router_ipv4_prog()
159 NO_TEAR_INC(rec->xdp_pass); in xdp_router_ipv4_prog()
168 __builtin_memcpy(eth->h_dest, dest_mac, ETH_ALEN); in xdp_router_ipv4_prog()
169 __builtin_memcpy(eth->h_source, src_mac, ETH_ALEN); in xdp_router_ipv4_prog()
174 NO_TEAR_INC(rec->xdp_redirect); in xdp_router_ipv4_prog()
184 NO_TEAR_INC(rec->xdp_drop); in xdp_router_ipv4_prog()