Skip to content

Commit 5826436

Browse files
Fushuai Wangkuba-moo
authored andcommitted
sfc: eliminate xdp_rxq_info_valid using XDP base API
Commit eb9a36b ("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 <[email protected]> Acked-by: Edward Cree <[email protected]> Reviewed-by: Larysa Zaremba <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 21deb2d commit 5826436

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

drivers/net/ethernet/sfc/net_driver.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ struct efx_rx_page_state {
404404
* @old_rx_packets: Value of @rx_packets as of last efx_init_rx_queue()
405405
* @old_rx_bytes: Value of @rx_bytes as of last efx_init_rx_queue()
406406
* @xdp_rxq_info: XDP specific RX queue information.
407-
* @xdp_rxq_info_valid: Is xdp_rxq_info valid data?.
408407
*/
409408
struct efx_rx_queue {
410409
struct efx_nic *efx;
@@ -443,7 +442,6 @@ struct efx_rx_queue {
443442
unsigned long old_rx_packets;
444443
unsigned long old_rx_bytes;
445444
struct xdp_rxq_info xdp_rxq_info;
446-
bool xdp_rxq_info_valid;
447445
};
448446

449447
enum efx_sync_events_state {

drivers/net/ethernet/sfc/rx_common.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,6 @@ void efx_init_rx_queue(struct efx_rx_queue *rx_queue)
269269
"Failure to initialise XDP queue information rc=%d\n",
270270
rc);
271271
efx->xdp_rxq_info_failed = true;
272-
} else {
273-
rx_queue->xdp_rxq_info_valid = true;
274272
}
275273

276274
/* Set up RX descriptor ring */
@@ -302,10 +300,8 @@ void efx_fini_rx_queue(struct efx_rx_queue *rx_queue)
302300

303301
efx_fini_rx_recycle_ring(rx_queue);
304302

305-
if (rx_queue->xdp_rxq_info_valid)
303+
if (xdp_rxq_info_is_reg(&rx_queue->xdp_rxq_info))
306304
xdp_rxq_info_unreg(&rx_queue->xdp_rxq_info);
307-
308-
rx_queue->xdp_rxq_info_valid = false;
309305
}
310306

311307
void efx_remove_rx_queue(struct efx_rx_queue *rx_queue)

0 commit comments

Comments
 (0)