]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sfc: eliminate xdp_rxq_info_valid using XDP base API
authorFushuai Wang <wangfushuai@baidu.com>
Sat, 28 Jun 2025 05:10:16 +0000 (13:10 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 2 Jul 2025 00:01:15 +0000 (17:01 -0700)
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>
drivers/net/ethernet/sfc/net_driver.h
drivers/net/ethernet/sfc/rx_common.c

index 5c0f306fb019acb94459660ce1c994e4796da32b..b98c259f672db52177d1e9156ac25fcf1941edef 100644 (file)
@@ -404,7 +404,6 @@ struct efx_rx_page_state {
  * @old_rx_packets: Value of @rx_packets as of last efx_init_rx_queue()
  * @old_rx_bytes: Value of @rx_bytes as of last efx_init_rx_queue()
  * @xdp_rxq_info: XDP specific RX queue information.
- * @xdp_rxq_info_valid: Is xdp_rxq_info valid data?.
  */
 struct efx_rx_queue {
        struct efx_nic *efx;
@@ -443,7 +442,6 @@ struct efx_rx_queue {
        unsigned long old_rx_packets;
        unsigned long old_rx_bytes;
        struct xdp_rxq_info xdp_rxq_info;
-       bool xdp_rxq_info_valid;
 };
 
 enum efx_sync_events_state {
index f4f75299dfa948e942b356c2cd2fbf1ce81ac2b4..5306f4c44be402923baf1dcc2c933a79a3e41885 100644 (file)
@@ -269,8 +269,6 @@ void efx_init_rx_queue(struct efx_rx_queue *rx_queue)
                          "Failure to initialise XDP queue information rc=%d\n",
                          rc);
                efx->xdp_rxq_info_failed = true;
-       } else {
-               rx_queue->xdp_rxq_info_valid = true;
        }
 
        /* Set up RX descriptor ring */
@@ -302,10 +300,8 @@ void efx_fini_rx_queue(struct efx_rx_queue *rx_queue)
 
        efx_fini_rx_recycle_ring(rx_queue);
 
-       if (rx_queue->xdp_rxq_info_valid)
+       if (xdp_rxq_info_is_reg(&rx_queue->xdp_rxq_info))
                xdp_rxq_info_unreg(&rx_queue->xdp_rxq_info);
-
-       rx_queue->xdp_rxq_info_valid = false;
 }
 
 void efx_remove_rx_queue(struct efx_rx_queue *rx_queue)