igc: Don't clear the large buffer bit before memory release
Subsystems (2)
PATCH 1/1 igc: Don't clear the large buffer bit before memory release
When XDP is enabled, it uses large buffers to accomodate headroom and tailroom required by XDP infrastructure. But, it clears the large buffer bit before unmapping the buffer.
dma_unmap_page_attrs() (called by igc_clean_rx_ring_page_shared()) needs size of the buffer to unmap. If the large buffer bit is cleared before calling igc_clean_rx_ring_page_shared(), all of the memory won't be unmapped.
--- drivers/net/ethernet/intel/igc/igc_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +2 -2
@@ -418,13 +418,13 @@ static void igc_clean_rx_ring_xsk_pool(struct igc_ring *ring)*/ static void igc_clean_rx_ring (struct igc_ring *ring) { -clear_ring_uses_large_buffer (ring); -if (ring->xsk_pool)igc_clean_rx_ring_xsk_pool (ring);else igc_clean_rx_ring_page_shared (ring); +clear_ring_uses_large_buffer (ring); + ring->next_to_alloc =0 ; ring->next_to_clean =0 ; ring->next_to_use =0 ;
Signature · 1 line
2.17.1
PATCH 1/1 igc: Don't clear the large buffer bit before memory release
Quoted 21 lines · Vedang Patel
When XDP is enabled, it uses large buffers to accomodate headroom and tailroom required by XDP infrastructure. But, it clears the large buffer bit before unmapping the buffer.
dma_unmap_page_attrs()(called byigc_clean_rx_ring_page_shared()) needs size of the buffer to unmap. If the large buffer bit is cleared before callingigc_clean_rx_ring_page_shared(), all of the memory won't be unmapped.Fixes 2e739318416b ("igc: Add initial XDP support")Signed-off-by Vedang Patel <[email protected]>--- drivers/net/ethernet/intel/igc/igc_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/net/ethernet/intel/igc/igc_main.c +0
-0
drivers/net/ethernet/intel/igc/igc_main.c static void igc_clean_rx_ring_xsk_pool(struct igc_ring *ring) · line 424
Quoted 9 lines
drivers/net/ethernet/intel/igc/igc_main.c +0
-2@@ -418,13 +418,13 @@ static void igc_clean_rx_ring_xsk_pool(struct igc_ring *ring)*/ static void igc_clean_rx_ring (struct igc_ring *ring) { -clear_ring_uses_large_buffer (ring); -if (ring->xsk_pool)igc_clean_rx_ring_xsk_pool (ring);else igc_clean_rx_ring_page_shared (ring);
This code is not yet upstreamed AFAICT. Probably you should ask Andre to include this fix onto igc's AFXDP support?
Quoted 13 lines
drivers/net/ethernet/intel/igc/igc_main.c +2
-0+clear_ring_uses_large_buffer (ring); + ring->next_to_alloc =0 ; ring->next_to_clean =0 ; ring->next_to_use =0 ;Signature · 6 lines
2.17.1 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan at osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan