From patchwork Wed Jun 3 08:50:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jubran, Samih" X-Patchwork-Id: 218021 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=-9.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, 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 DBEC0C433E0 for ; Wed, 3 Jun 2020 08:50:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A976320678 for ; Wed, 3 Jun 2020 08:50:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="DL6ghsqt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbgFCIuo (ORCPT ); Wed, 3 Jun 2020 04:50:44 -0400 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:27382 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726295AbgFCIum (ORCPT ); Wed, 3 Jun 2020 04:50:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1591174242; x=1622710242; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d8OPArTBK9ZuFtaJ7t3TovGghoPEIE3jc+lKdatjVp8=; b=DL6ghsqtQ03ALrHeLW9cqUYzvCbuMFkm1Ba/hpLkle2kK442JsZDF/kp ysTls8ofKnXstciHT1lD7DtTkF/7xoomKxunYKaTaehq9WhQAs+jwViC+ 7sQ3nhsEOSqeEDlNpgMRgXfapyhfu3xGuvpjasGDx+7bOwE8kP/sMiIiO w=; IronPort-SDR: LNxQbrMTgdaag7bWQrXqQy/i1n4QHnJRRvPlbHe5fqHDTvgiteFvQJN1XSTL69KKBkgS5qKvqA Ba13jTxEQGkA== X-IronPort-AV: E=Sophos;i="5.73,467,1583193600"; d="scan'208";a="34079150" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-e7be2041.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 03 Jun 2020 08:50:28 +0000 Received: from EX13MTAUWC001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-e7be2041.us-west-2.amazon.com (Postfix) with ESMTPS id 4BEF6A0693; Wed, 3 Jun 2020 08:50:27 +0000 (UTC) Received: from EX13d09UWC004.ant.amazon.com (10.43.162.114) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Jun 2020 08:50:26 +0000 Received: from EX13MTAUWC001.ant.amazon.com (10.43.162.135) by EX13d09UWC004.ant.amazon.com (10.43.162.114) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 3 Jun 2020 08:50:26 +0000 Received: from dev-dsk-sameehj-1c-1edacdb5.eu-west-1.amazon.com (172.19.82.3) by mail-relay.amazon.com (10.43.162.232) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 3 Jun 2020 08:50:26 +0000 Received: by dev-dsk-sameehj-1c-1edacdb5.eu-west-1.amazon.com (Postfix, from userid 9775579) id 1D3D3816BC; Wed, 3 Jun 2020 08:50:26 +0000 (UTC) From: To: , CC: Sameeh Jubran , , , , , , , , , , , , , Subject: [PATCH V2 net 1/2] net: ena: xdp: XDP_TX: fix memory leak Date: Wed, 3 Jun 2020 08:50:22 +0000 Message-ID: <20200603085023.24221-2-sameehj@amazon.com> X-Mailer: git-send-email 2.24.1.AMZN In-Reply-To: <20200603085023.24221-1-sameehj@amazon.com> References: <20200603085023.24221-1-sameehj@amazon.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Sameeh Jubran 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 --- 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 281896542..ec115b753 100644 --- 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; }