Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sfc: eliminate xdp_rxq_info_valid using XDP base API

Commit eb9a36be7f3e ("sfc: perform XDP processing on received packets")
use xdp_rxq_info_valid to track failures of xdp_rxq_info_reg().
However, this driver-maintained state becomes redundant since the XDP
framework already provides xdp_rxq_info_is_reg() for checking registration
status.

Signed-off-by: Fushuai Wang <wangfushuai@baidu.com>
Acked-by: Edward Cree <ecree.xilinx@gmail.com>
Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://patch.msgid.link/20250628051016.51022-1-wangfushuai@baidu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Fushuai Wang and committed by
Jakub Kicinski
58264367 21deb2d9

+1 -7
-2
drivers/net/ethernet/sfc/net_driver.h
··· 404 404 * @old_rx_packets: Value of @rx_packets as of last efx_init_rx_queue() 405 405 * @old_rx_bytes: Value of @rx_bytes as of last efx_init_rx_queue() 406 406 * @xdp_rxq_info: XDP specific RX queue information. 407 - * @xdp_rxq_info_valid: Is xdp_rxq_info valid data?. 408 407 */ 409 408 struct efx_rx_queue { 410 409 struct efx_nic *efx; ··· 442 443 unsigned long old_rx_packets; 443 444 unsigned long old_rx_bytes; 444 445 struct xdp_rxq_info xdp_rxq_info; 445 - bool xdp_rxq_info_valid; 446 446 }; 447 447 448 448 enum efx_sync_events_state {
+1 -5
drivers/net/ethernet/sfc/rx_common.c
··· 269 269 "Failure to initialise XDP queue information rc=%d\n", 270 270 rc); 271 271 efx->xdp_rxq_info_failed = true; 272 - } else { 273 - rx_queue->xdp_rxq_info_valid = true; 274 272 } 275 273 276 274 /* Set up RX descriptor ring */ ··· 300 302 301 303 efx_fini_rx_recycle_ring(rx_queue); 302 304 303 - if (rx_queue->xdp_rxq_info_valid) 305 + if (xdp_rxq_info_is_reg(&rx_queue->xdp_rxq_info)) 304 306 xdp_rxq_info_unreg(&rx_queue->xdp_rxq_info); 305 - 306 - rx_queue->xdp_rxq_info_valid = false; 307 307 } 308 308 309 309 void efx_remove_rx_queue(struct efx_rx_queue *rx_queue)