Re: [PATCH bpf-next V5 2/5] bpf: bpf_fib_lookup return MTU value as output when looked up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Ahern wrote:
> On 11/2/20 2:28 AM, Jesper Dangaard Brouer wrote:
> >>> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> >>> index e6ceac3f7d62..01b2b17c645a 100644
> >>> --- a/include/uapi/linux/bpf.h
> >>> +++ b/include/uapi/linux/bpf.h
> >>> @@ -2219,6 +2219,9 @@ union bpf_attr {
> >>>   *		* > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the
> >>>   *		  packet is not forwarded or needs assist from full stack
> >>>   *
> >>> + *		If lookup fails with BPF_FIB_LKUP_RET_FRAG_NEEDED, then the MTU
> >>> + *		was exceeded and result params->mtu contains the MTU.
> >>> + *  
> >>
> >> Do we need to hide this behind a flag? It seems otherwise you might confuse
> >> users. I imagine on error we could reuse the params arg, but now we changed
> >> the tot_len value underneath them?
> > 
> > The principle behind this bpf_fib_lookup helper, is that params (struct
> > bpf_fib_lookup) is used for both input and output (results). Almost
> > every field is change after the lookup. (For performance reasons this
> > is kept at 64 bytes (cache-line))  Thus, users of this helper already
> > expect/knows the contents of params have changed.
> > 
> 
> yes, that was done on purpose.

OK sounds good then. Thanks.

> 
> Jesper: you should remove the '(if requested check_mtu)' comment in the
> documentation. That is an internal flag only -- xdp is true, tc is false.





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux