]> git.baikalelectronics.ru Git - kernel.git/commit
net-af_xdp: Use correct number of channels from ethtool
authorLuigi Rizzo <lrizzo@google.com>
Tue, 19 Nov 2019 00:19:51 +0000 (16:19 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 19 Nov 2019 22:06:35 +0000 (14:06 -0800)
commita793b66e076fe8d804e961f0ce84bba19a40f7cf
treea5ca98f429517394b3799c63a7be0674365df9d1
parent6ddb4fa26109c240562b31c828c0cfa70a71de71
net-af_xdp: Use correct number of channels from ethtool

Drivers use different fields to report the number of channels, so take
the maximum of all data channels (rx, tx, combined) when determining the
size of the xsk map. The current code used only 'combined' which was set
to 0 in some drivers e.g. mlx4.

Tested: compiled and run xdpsock -q 3 -r -S on mlx4

Signed-off-by: Luigi Rizzo <lrizzo@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Magnus Karlsson <magnus.karlsson@intel.com>
Link: https://lore.kernel.org/bpf/20191119001951.92930-1-lrizzo@google.com
tools/lib/bpf/xsk.c