From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2850C433E0 for ; Tue, 16 Jun 2020 15:42:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7C61D208E4 for ; Tue, 16 Jun 2020 15:42:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592322170; bh=zhLQDx6aEqFN4TaReRg65a9+NkNhKHZlyDQxLDm6aMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=PuppjERK8D1Ha10WLwSrT033qpEuZD+7MIFBRBpJzy+HbMg3x+L/9hwrkuIROyFsu lOKXB6KpwSpXp3GkMawvmakAchqPEi0+ef+w2wUzbazSSQI+k11QVYwaSrFCMqqcl6 YzxeKF7OJVbMPqYuueHzUiyvxP9lZF1Xwoyk1c2w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731724AbgFPPmt (ORCPT ); Tue, 16 Jun 2020 11:42:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:59698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731701AbgFPPmp (ORCPT ); Tue, 16 Jun 2020 11:42:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 323D8208E4; Tue, 16 Jun 2020 15:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592322164; bh=zhLQDx6aEqFN4TaReRg65a9+NkNhKHZlyDQxLDm6aMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lm+91RvknzZngt0xjeOvQSfO7WiZvTBVLpHr22buBjsiWDXSTvD4e3R7177AUaNSn 8tyB3xOrzQVT6bq2yO7hgfz9t4WCZTYlMHHIH+NxsKT1oyILbUd00aEnI7qotvpX/j cO0TS7UDkGSV2X1dRuQhsaiwxvXhlI8uCctl6QJk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sameeh Jubran , "David S. Miller" Subject: [PATCH 5.7 007/163] net: ena: xdp: XDP_TX: fix memory leak Date: Tue, 16 Jun 2020 17:33:01 +0200 Message-Id: <20200616153107.216068403@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200616153106.849127260@linuxfoundation.org> References: <20200616153106.849127260@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sameeh Jubran [ Upstream commit cd07ecccba13b8bd5023ffe7be57363d07e3105f ] 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: Greg Kroah-Hartman --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -355,7 +355,7 @@ error_unmap_dma: 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; }