On 2019-06-12 23:10, Jakub Kicinski wrote: > On Wed, 12 Jun 2019 15:56:43 +0000, Maxim Mikityanskiy wrote: >> The typical XDP memory scheme is one packet per page. Change the AF_XDP >> frame size in libbpf to 4096, which is the page size on x86, to allow >> libbpf to be used with the drivers with the packet-per-page scheme. > > This is slightly surprising. Why does the driver care about the bufsz? The classic XDP implementation supports only the packet-per-page scheme. mlx5e implements this scheme, because it perfectly fits with xdp_return and page pool APIs. AF_XDP relies on XDP, and even though AF_XDP doesn't really allocate or release pages, it works on top of XDP, and XDP implementation in mlx5e does allocate and release pages (in general case) and works with the packet-per-page scheme. > You're not supposed to so page operations on UMEM pages, anyway. > And the RX size filter should be configured according to MTU regardless > of XDP state. Yes, of course, MTU is taken into account. > Can you explain? > >> Add a command line option -f to xdpsock to allow to specify a custom >> frame size. >> >> Signed-off-by: Maxim Mikityanskiy <maximmi@xxxxxxxxxxxx> >> Reviewed-by: Tariq Toukan <tariqt@xxxxxxxxxxxx> >> Acked-by: Saeed Mahameed <saeedm@xxxxxxxxxxxx>