Skip to content

Commit

Permalink
linux/ena: Free copybreak page if NUMA is incorrect
Browse files Browse the repository at this point in the history
RX page allocation mechanism allocates pages on the NUMA node associated
with the CPU which serves the queue's napi routine.
Specifically, in LPC case, we check the allocated cache pages per
RX refill routine, and re-allocate them in case they are located in the
wrong NUMA node.

These mechanisms were not applied to copybreak pages, as their content
is being copied and the pages are being reused, without checking
whether they are allocated on the correct NUMA node.
This patch makes sure that an RX page is re-allocated if it's on the
wrong NUMA for packets on the copybreak path.

Fixes: 798070a ("First commit of Amazon Elastic Network Adapter (ENA) Linux driver")
Signed-off-by: Shahar Itzko <itzko@amazon.com>
  • Loading branch information
akiyano committed Jul 9, 2024
1 parent 806da4f commit cad7152
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/linux/ena/ena_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,11 @@ static struct sk_buff *ena_rx_skb(struct ena_ring *rx_ring,
rx_ring->free_ids[*next_to_clean] = req_id;
*next_to_clean = ENA_RX_RING_IDX_ADD(*next_to_clean, descs,
rx_ring->ring_size);

/* Don't reuse the RX page if we're on the wrong NUMA */
if (page_to_nid(rx_info->page) != numa_mem_id())
ena_free_rx_page(rx_ring, rx_info);

return skb;
}

Expand Down

0 comments on commit cad7152

Please sign in to comment.