Skip to content

doc:LRP skipRedirectFromBackend with per packet LB#2

Open
MitchLewis930 wants to merge 1 commit into
pr_042_beforefrom
pr_042_after
Open

doc:LRP skipRedirectFromBackend with per packet LB#2
MitchLewis930 wants to merge 1 commit into
pr_042_beforefrom
pr_042_after

Conversation

@MitchLewis930
Copy link
Copy Markdown

PR_042

Update the added support for
LRP skipRedirectFromBackend with
per packet based LB.

Signed-off-by: Praveen Krishna <pkrishn@google.com>
@MitchLewis930
Copy link
Copy Markdown
Author

@greptileai

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

Updated documentation to reflect that the skipRedirectFromBackend configuration for Local Redirect Policy now supports per-packet based load-balancing in addition to socket-based load-balancing.

  • Changed line 534 from "only supported with socket-based load-balancing" to "supported with socket-based load-balancing and per packet based load-balancing"
  • This documentation change aligns with the BPF code implementation in commit 3c85f0e which added LRP loopback fix for non-socket LB mode
  • The implementation uses the cilium_skip_lb4/6 maps with netns cookies to skip service translation when packets originate from local redirect backend pods
  • Tests were added in bpf/tests/skip_lb_xlate_lrp_per_packet_lb.c to verify the per-packet LB behavior

Confidence Score: 5/5

  • This PR is safe to merge with no risk - it only updates documentation to match existing code functionality
  • The documentation change accurately reflects the BPF implementation added in commit 3c85f0e, which extended skipRedirectFromBackend support to per-packet load-balancing. The change is minor, well-supported by code and tests, and involves no functional code changes
  • No files require special attention

Important Files Changed

Filename Overview
Documentation/network/kubernetes/local-redirect-policy.rst Updated documentation to reflect that skipRedirectFromBackend now supports both socket-based and per-packet load-balancing modes

Sequence Diagram

sequenceDiagram
    participant Backend as Backend Pod
    participant BPF as BPF Datapath (lb4_local/lb6_local)
    participant SkipLBMap as Skip LB Map (cilium_skip_lb4/6)
    participant Service as Service Frontend
    participant OtherBackend as Other Backend Pod
    
    Note over Backend,OtherBackend: skipRedirectFromBackend enabled for LRP
    
    Backend->>BPF: Packet to Service IP:Port
    BPF->>BPF: Check if service has SVC_FLAG_LOCALREDIRECT
    BPF->>SkipLBMap: Lookup (netns_cookie, service IP, source port)
    SkipLBMap-->>BPF: Match found
    BPF->>Service: Forward to original frontend (skip translation)
    Note over BPF,Service: Packet NOT redirected back to Backend
    
    Note over Backend,OtherBackend: Alternative: Without skipRedirectFromBackend
    
    Backend->>BPF: Packet to Service IP:Port
    BPF->>BPF: Apply LRP backend selection
    BPF->>Backend: Redirect back to Backend (loopback)
    Note over Backend: Creates loopback issue
Loading

Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants