Skip to content

Commit e604209

Browse files
bpf: fib: update code comment for fib_do_redirect()
This has drifted quite a bit from the actual behavior. Signed-off-by: Julian Wiedmann <jwi@isovalent.com>
1 parent ab295f8 commit e604209

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

bpf/lib/fib.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,15 @@ static __always_inline bool fib_ok(int ret)
7272
*
7373
* The redirect can occur with or without a preceding FIB lookup.
7474
*
75+
* If redirect_neigh() is available, it is always preferred. Passing
76+
* through the nh information from @fib_params if available.
77+
*
78+
* Otherwise:
7579
* If a previous FIB lookup was performed with result BPF_FIB_LKUP_RET_SUCCESS,
7680
* then the L2 addresses are updated from the provided @fib_params along with a
7781
* plain ctx_redirect().
7882
*
79-
* If no FIB lookup was performed (BPF_FIB_LKUP_NO_NEIGH with no @fib_params) or
80-
* the FIB lookup returned BPF_FIB_LKUP_NO_NEIGH, then redirect_neigh() is used
81-
* for the redirect. Passing through the nh information from @fib_params if available.
82-
*
83-
* If redirect_neigh() is not available (== XDP context), a plain ctx_redirect()
84-
* is used. The `dmac` is resolved from the neighbour map.
83+
* Without a successful FIB lookup, the `dmac` is resolved from the neighbour map.
8584
*/
8685
static __always_inline int
8786
fib_do_redirect(struct __ctx_buff *ctx, const bool needs_l2_check,

0 commit comments

Comments
 (0)