From e9ce333a4b7056f46cdbea6662a8a7ca69fec1fd Mon Sep 17 00:00:00 2001 From: Petr Oros Date: Mon, 23 Nov 2020 17:16:57 +0100 Subject: [PATCH 66/78] net: ena: xdp: XDP_TX: fix memory leak Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1861967 Upstream commit(s): commit cd07ecccba13b8bd5023ffe7be57363d07e3105f Author: Sameeh Jubran Date: Wed Jun 3 08:50:22 2020 +0000 net: ena: xdp: XDP_TX: fix memory leak When sending very high packet rate, the XDP tx queues can get full and start dropping packets. In this case we don't free the pages which results in ena driver draining the system memory. Fix: Simply free the pages when necessary. Fixes: 548c4940b9f1 ("net: ena: Implement XDP_TX action") Signed-off-by: Sameeh Jubran Signed-off-by: David S. Miller Signed-off-by: Petr Oros --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 81ed6e28d707..2284857a49b2 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -356,7 +356,7 @@ static int ena_xdp_xmit_buff(struct net_device *dev, ena_unmap_tx_buff(xdp_ring, tx_info); tx_info->xdpf = NULL; error_drop_packet: - + __free_page(tx_info->xdp_rx_page); return NETDEV_TX_OK; } -- 2.13.6