Skip to content

Commit

Permalink
Adding flag both in katran and shiv to allow us to migrate FWM vips t…
Browse files Browse the repository at this point in the history
…o also use dst port during hash

Summary:
Added a new flag for the balancer which will allow the fwm vips to use the port for hashing.

In shiv I'm setting this flag by adding a new scheduler which will be updated currently on runtime if the conditions of been fwm vip, using currently ch as scheduler and the startup flag is enabled.

Reviewed By: avasylev

Differential Revision: D51836527

fbshipit-source-id: 68224a3d18dcd28f1dc6f4d0c822f797e609cb84
  • Loading branch information
Ivan Morett authored and facebook-github-bot committed Dec 11, 2023
1 parent e5b8f2a commit 7fa84f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion katran/lib/bpf/balancer.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,8 @@ process_packet(struct xdp_md* xdp, __u64 off, bool is_ipv6) {
return XDP_PASS;
}

if (!(vip_info->flags & F_HASH_DPORT_ONLY)) {
if (!(vip_info->flags & F_HASH_DPORT_ONLY) &&
!(vip_info->flags & F_HASH_SRC_DST_PORT)) {
// VIP, which doesnt care about dst port (all packets to this VIP w/ diff
// dst port but from the same src port/ip must go to the same real
pckt.flow.port16[1] = 0;
Expand Down
3 changes: 3 additions & 0 deletions katran/lib/bpf/balancer_consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@
#define F_LOCAL_VIP (1 << 5)
// do a global lru lookup if we were unable to find the flow in the main lru map
#define F_GLOBAL_LRU (1 << 6)
// use both src and dst port for the hash calculation for vips which normally
// wouldn't
#define F_HASH_SRC_DST_PORT (1 << 7)
// packet_description flags:
// the description has been created from icmp msg
#define F_ICMP (1 << 0)
Expand Down

0 comments on commit 7fa84f8

Please sign in to comment.