Lines Matching +full:ports +full:- +full:word +full:- +full:length
24 static inline __u32 rol32(__u32 word, unsigned int shift) in rol32() argument
26 return (word << shift) | (word >> ((-shift) & 31)); in rol32()
34 a -= c; a ^= rol32(c, 4); c += b; \
35 b -= a; b ^= rol32(a, 6); a += c; \
36 c -= b; c ^= rol32(b, 8); b += a; \
37 a -= c; a ^= rol32(c, 16); c += b; \
38 b -= a; b ^= rol32(a, 19); a += c; \
39 c -= b; c ^= rol32(b, 4); b += a; \
44 c ^= b; c -= rol32(b, 14); \
45 a ^= c; a -= rol32(c, 11); \
46 b ^= a; b -= rol32(a, 25); \
47 c ^= b; c -= rol32(b, 16); \
48 a ^= c; a -= rol32(c, 4); \
49 b ^= a; b -= rol32(a, 14); \
50 c ^= b; c -= rol32(b, 24); \
57 static inline u32 jhash(const void *key, u32 length, u32 initval) in jhash() argument
62 a = b = c = JHASH_INITVAL + length + initval; in jhash()
64 while (length > 12) { in jhash()
69 length -= 12; in jhash()
72 switch (length) { in jhash()
131 __u32 ports; member
209 return jhash_2words(jhash(pckt->srcv6, 16, MAX_VIPS), in get_packet_hash()
210 pckt->ports, CH_RINGS_SIZE); in get_packet_hash()
212 return jhash_2words(pckt->src, pckt->ports, CH_RINGS_SIZE); in get_packet_hash()
221 __u32 key = RING_SIZE * vip_info->vip_num + hash; in get_packet_dst()
243 if (icmp_hdr->icmp6_type != ICMPV6_PKT_TOOBIG) in parse_icmpv6()
249 pckt->proto = ip6h->nexthdr; in parse_icmpv6()
250 pckt->flags |= F_ICMP; in parse_icmpv6()
251 memcpy(pckt->srcv6, ip6h->daddr.s6_addr32, 16); in parse_icmpv6()
252 memcpy(pckt->dstv6, ip6h->saddr.s6_addr32, 16); in parse_icmpv6()
265 if (icmp_hdr->type != ICMP_DEST_UNREACH || in parse_icmp()
266 icmp_hdr->code != ICMP_FRAG_NEEDED) in parse_icmp()
272 if (iph->ihl != 5) in parse_icmp()
274 pckt->proto = iph->protocol; in parse_icmp()
275 pckt->flags |= F_ICMP; in parse_icmp()
276 pckt->src = iph->daddr; in parse_icmp()
277 pckt->dst = iph->saddr; in parse_icmp()
290 if (!(pckt->flags & F_ICMP)) { in parse_udp()
291 pckt->port16[0] = udp->source; in parse_udp()
292 pckt->port16[1] = udp->dest; in parse_udp()
294 pckt->port16[0] = udp->dest; in parse_udp()
295 pckt->port16[1] = udp->source; in parse_udp()
309 if (tcp->syn) in parse_tcp()
310 pckt->flags |= F_SYN_SET; in parse_tcp()
312 if (!(pckt->flags & F_ICMP)) { in parse_tcp()
313 pckt->port16[0] = tcp->source; in parse_tcp()
314 pckt->port16[1] = tcp->dest; in parse_tcp()
316 pckt->port16[0] = tcp->dest; in parse_tcp()
317 pckt->port16[1] = tcp->source; in parse_tcp()
325 void *pkt_start = (void *)(long)skb->data; in process_packet()
353 protocol = ip6h->nexthdr; in process_packet()
355 pkt_bytes = bpf_ntohs(ip6h->payload_len); in process_packet()
365 memcpy(pckt.srcv6, ip6h->saddr.s6_addr32, 16); in process_packet()
366 memcpy(pckt.dstv6, ip6h->daddr.s6_addr32, 16); in process_packet()
372 if (iph->ihl != 5) in process_packet()
375 protocol = iph->protocol; in process_packet()
377 pkt_bytes = bpf_ntohs(iph->tot_len); in process_packet()
380 if (iph->frag_off & PCKT_FRAGMENTED) in process_packet()
388 pckt.src = iph->saddr; in process_packet()
389 pckt.dst = iph->daddr; in process_packet()
420 if (vip_info->flags & F_HASH_NO_SRC_PORT) in process_packet()
426 if (dst->flags & F_IPV6) { in process_packet()
430 ifindex = cval->ifindex; in process_packet()
431 memcpy(tkey.remote_ipv6, dst->dstv6, 16); in process_packet()
437 ifindex = cval->ifindex; in process_packet()
438 tkey.remote_ipv4 = dst->dst; in process_packet()
440 vip_num = vip_info->vip_num; in process_packet()
444 data_stats->pkts++; in process_packet()
445 data_stats->bytes += pkt_bytes; in process_packet()
447 *(u32 *)eth->eth_dest = tkey.remote_ipv4; in process_packet()
454 void *data_end = (void *)(long)ctx->data_end; in balancer_ingress()
455 void *data = (void *)(long)ctx->data; in balancer_ingress()
463 eth_proto = eth->eth_proto; in balancer_ingress()