]> git.proxmox.com Git - mirror_ubuntu-eoan-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)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 05:04:26 +0000 (00:04 -0500)
commit37cadfbd22300a23fb11656916edd10c86173198
tree3dabc06a5091a9b2a269e6487aa73ed633f20222
parent34434ffd0c733c68d4e40433ed269393e3a26f29
net-af_xdp: Use correct number of channels from ethtool

BugLink: https://bugs.launchpad.net/bugs/1860490
[ Upstream commit 3de88c9113f88c04abda339f1aa629397bf89e02 ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
tools/lib/bpf/xsk.c