Skip to content

Commit f485164

Browse files
Andre Guedesanguy11
authored andcommitted
igc: Refactor igc_clean_rx_ring()
Refactor igc_clean_rx_ring() helper, preparing the code for AF_XDP zero-copy support which is added by upcoming patches. The refactor consists of encapsulating page-shared specific code into its own helper, leaving common code that will be shared by both page-shared and xsk pool in igc_clean_rx_ring(). Signed-off-by: Andre Guedes <[email protected]> Signed-off-by: Vedang Patel <[email protected]> Signed-off-by: Jithu Joseph <[email protected]> Reviewed-by: Maciej Fijalkowski <[email protected]> Tested-by: Dvora Fuxbrumer <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 73a6e37 commit f485164

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,7 @@ static int igc_setup_all_tx_resources(struct igc_adapter *adapter)
346346
return err;
347347
}
348348

349-
/**
350-
* igc_clean_rx_ring - Free Rx Buffers per Queue
351-
* @rx_ring: ring to free buffers from
352-
*/
353-
static void igc_clean_rx_ring(struct igc_ring *rx_ring)
349+
static void igc_clean_rx_ring_page_shared(struct igc_ring *rx_ring)
354350
{
355351
u16 i = rx_ring->next_to_clean;
356352

@@ -383,12 +379,21 @@ static void igc_clean_rx_ring(struct igc_ring *rx_ring)
383379
if (i == rx_ring->count)
384380
i = 0;
385381
}
382+
}
383+
384+
/**
385+
* igc_clean_rx_ring - Free Rx Buffers per Queue
386+
* @ring: ring to free buffers from
387+
*/
388+
static void igc_clean_rx_ring(struct igc_ring *ring)
389+
{
390+
igc_clean_rx_ring_page_shared(ring);
386391

387-
clear_ring_uses_large_buffer(rx_ring);
392+
clear_ring_uses_large_buffer(ring);
388393

389-
rx_ring->next_to_alloc = 0;
390-
rx_ring->next_to_clean = 0;
391-
rx_ring->next_to_use = 0;
394+
ring->next_to_alloc = 0;
395+
ring->next_to_clean = 0;
396+
ring->next_to_use = 0;
392397
}
393398

394399
/**

0 commit comments

Comments
 (0)