]> git.baikalelectronics.ru Git - kernel.git/commit
sfc: ensure correct number of XDP queues
authorÍñigo Huguet <ihuguet@redhat.com>
Tue, 13 Jul 2021 14:21:28 +0000 (16:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 13 Jul 2021 17:02:41 +0000 (10:02 -0700)
commit8def9a8645f17c6fe3fdea14e3b2c894f8c5ff45
tree799f40e10da9468be0a799069a5df9cf083c513c
parent97013b4d3a6f6440dfc0a30f213118348c28b99c
sfc: ensure correct number of XDP queues

Commit 783d3dbb4f4c ("sfc: adjust efx->xdp_tx_queue_count with the real
number of initialized queues") intended to fix a problem caused by a
round up when calculating the number of XDP channels and queues.
However, this was not the real problem. The real problem was that the
number of XDP TX queues had been reduced to half in
commit 22f4acfb1b58 ("sfc: reduce the number of requested xdp ev queues"),
but the variable xdp_tx_queue_count had remained the same.

Once the correct number of XDP TX queues is created again in the
previous patch of this series, this also can be reverted since the error
doesn't actually exist.

Only in the case that there is a bug in the code we can have different
values in xdp_queue_number and efx->xdp_tx_queue_count. Because of this,
and per Edward Cree's suggestion, I add instead a WARN_ON to catch if it
happens again in the future.

Note that the number of allocated queues can be higher than the number
of used ones due to the round up, as explained in the existing comment
in the code. That's why we also have to stop increasing xdp_queue_number
beyond efx->xdp_tx_queue_count.

Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/efx_channels.c