]> git.dujemihanovic.xyz Git - linux.git/commit
ionic: Allow XDP program to be hot swapped
authorBrett Creeley <brett.creeley@amd.com>
Fri, 6 Sep 2024 23:26:23 +0000 (16:26 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 10 Sep 2024 02:18:15 +0000 (19:18 -0700)
commit3c0bf13f5d5fcd6722e83a7203bf3dbb3ef73b6f
tree38920c3751ada421c72421a2236e9662804594b1
parentac8813c0ab7d2816946379bff2677a5f725e37bf
ionic: Allow XDP program to be hot swapped

Using examples of other driver(s), add the ability to hot-swap an XDP
program without having to reconfigure the queues. To prevent the
q->xdp_prog to be read/written more than once use READ_ONCE() and
WRITE_ONCE() on the q->xdp_prog.

The q->xdp_prog was being checked in multiple different for loops in the
hot path. The change to allow xdp_prog hot swapping created the
possibility for many READ_ONCE(q->xdp_prog) calls during a single napi
callback. Refactor the Rx napi handling to allow a previous
READ_ONCE(q->xdp_prog) (or NULL for hwstamp_rxq) to be passed into the
relevant functions.

Also, move other Rx related hotpath handling into the newly created
ionic_rx_cq_service() function to reduce the scope of the xdp_prog
local variable and put all Rx handling in one function similar to Tx.

Signed-off-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Link: https://patch.msgid.link/20240906232623.39651-8-brett.creeley@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/pensando/ionic/ionic_lif.c
drivers/net/ethernet/pensando/ionic/ionic_txrx.c
drivers/net/ethernet/pensando/ionic/ionic_txrx.h