net: enetc: recalculate num_real_tx_queues when XDP program attaches
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 3 Feb 2023 00:11:15 +0000 (02:11 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 4 Feb 2023 04:05:57 +0000 (20:05 -0800)
commit4ea1dd743eb6c76dec6ed28fae7e1629961a55af
tree8b6e2e64eceea6206328d96bda4a8236c9cbb058
parent46a0ecf93b6d188379efe05cdde8564f1fe7fdad
net: enetc: recalculate num_real_tx_queues when XDP program attaches

Since the blamed net-next commit, enetc_setup_xdp_prog() no longer goes
through enetc_open(), and therefore, the function which was supposed to
detect whether a BPF program exists (in order to crop some TX queues
from network stack usage), enetc_num_stack_tx_queues(), no longer gets
called.

We can move the netif_set_real_num_rx_queues() call to enetc_alloc_msix()
(probe time), since it is a runtime invariant. We can do the same thing
with netif_set_real_num_tx_queues(), and let enetc_reconfigure_xdp_cb()
explicitly recalculate and change the number of stack TX queues.

Fixes: c33bfaf91c4c ("net: enetc: set up XDP program under enetc_reconfigure()")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/freescale/enetc/enetc.c