On Fri, 19 May 2017 20:34:00 -0700, Alexei Starovoitov wrote: > On Fri, May 19, 2017 at 08:21:47PM -0700, Jakub Kicinski wrote: > > On Fri, 19 May 2017 20:07:52 -0700, Alexei Starovoitov wrote: > > > How about exposing 'struct mlx5_cqe64 *' to XDP programs as-is? > > > We can make sure that XDP program does read only access into it and > > > it will see cqe->rss_hash_result, cqe->rss_hash_type and everything else > > > in there, but this will not be uapi and it will be pretty obvious > > > to program authors that their programs are vendor specific. > > > 'not uapi' here means that mellanox is free to change their HW descriptor > > > and its contents as they wish. > > > > Hm.. Would that mean we have to teach the verifier about all possible > > drivers and their metadata structures (i.e. sizes thereof). And add an > > UAPI enum of known drivers? > > why? no uapi other than a pointer to this hw rx descriptor. > Different sizeof(hw_rx_descriptor) is not a problem. > We deal with it already in tracing. All tracepoints have different > sizeof(*ctx), yet the safety is preserved.
Ack, quick read of tracing code reveals this indeed should work.