RE: XDP-hints: how to inform driver about hints

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

 



Michal Swiatkowski wrote:
> Hi
> 
> I have just stareted working on generic hints implementation that was
> discussed on netdev workshop. I wondering how we should tell driver that
> hints is supported on XDP program.

I would reword this as, 'how do we enable the hardware to populate hints'.
Sorry bit of a nitpick but there is nothing in the XDP program about
supporting hints.

> 
> I prepared 3 implementation of this approach. In 1 and 3 solution I
> wanted to automatically search for hints usage in XDP program, but it
> doesn't look good because of comparing lines of XDP program in libbpf
> (3) or in bpf core (1).
> 
> For me solution 2 with reusing XDP flags looks good, but I don't
> know if XDP flags can be used for storing information about hints.
> What do you guys think about that?
> 
> Please take a look at code samples:
> 
> (1)
> https://github.com/alobakin/linux/commit/a4f32ba74e5d3eefe607789547e9d5529ed775b0
> don't know how to send flag to driver. Searching for metadata happens
> in load program path, but communication with driver
> (by ndo_bpf call happens in creating link)

I would say no to this because its not an attribute of the bpf program. The
program is going to be just happy to accesss metadata with or without
the driver/hardware cooperating. Its just doing so will result in garbage.

> 
> (2)
> https://github.com/alobakin/linux/commit/72a5d930bea330f5f4827fdf098b723f96acff0c
> simplest solution. Add another flag, everything are there, driver will
> check this flag in ndo_bpf

+1. This makes the most sense to me. Its also easy to implement as a bonus.
These flags are passed to the driver and independent of the program which
I think is correct way to view it. Also if some driver needs to do a
hard reset or flush descriptor rings, etc. its probably already doing it
to configure for XDP.

> 
> (3)
> https://github.com/alobakin/linux/commit/92de1e0e3523317c5749f3c87173dc90b1e8011b
> I haven't tested it yet. I think it is doable to do this search in creating
> link path, but only when user uses syscall instead of netlink API
> (I am pretty sure that this is used in auto generated code by libbpf).
> If we will decide that this solution can be correct I will write a suitable
> sample and chec if this works

I don't like having more knobs 'do it this way and it works', but 'do it
that way and it doesn't'. anyways it seems like the wrong way to me the
link is about BPF program. This is about enabling the hardware.



[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