Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3599236pxf; Mon, 22 Mar 2021 10:08:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL9LyxbNd6lFjJSnFMeLGSYIIrxRIx/y5egaDYl7lt5dqAHQGNGwILg236dIL1LxyYDusn X-Received: by 2002:a17:907:9e6:: with SMTP id ce6mr788332ejc.207.1616432917751; Mon, 22 Mar 2021 10:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616432917; cv=none; d=google.com; s=arc-20160816; b=zaPPafEiCCJ75LOzUdpaXyITFIwb46fRhgk5zFDGwCQ1EilaGQZ8TZe9Jz6INHfB5P 1AVGuNDXSKi5Lg6KWD6uuiikaK09HC3xQ+fCbQvK9VDqPzoODEMJadMwAxNOMMVCgsvI K22h8HepD61aohKXiLAIh+heTmhTrqSqWsh70JT7rpB1jfm8xVqqZ21ZCiuAV5viAyJJ sggbKsyVkwRbJtej4FuCGhDjnz+ZL3fujmJ+1WxkQN8DGqlNkXVwu/tobKMR8A6zssoF sL+EQkatZpYaCziNUnCZ/rtfMunRLKtA/7oa6+gmPlnlI8C83NBDW9fNmhhprQ9cfdXF Y+tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ihzH3n3aHmXKOtcPI8KDnr7LGDtclLmi/Ni6ekZYQ8Q=; b=unOtn6SsTBGXAFEHtuuJD9bY3thgg86pucI7jrqAbmkjq4UNehEylVUI/Z4c9PzPlQ 5I2Q+FkWckL+2Qaad/NFiqJrAlK/gl4IW7CpvGaWHBJ2FhG29Qqr0cXsEP1i3fqkcf1x UwRZ2HzeX71NZJTNxyGtUXFBQskkGOJBSJMPmnG1E8gUdcVF8liVqkN6cJDGdrlHyFBF o952dc/BXxY30+RPWG9Y85b05R4+RvbNp3mjDKTmmP/D8XtfhKzoOK6QHV3N55N+ndYa Jf7AL2osUQmjg0EF9v5Q2z/QKLcxmHccZ8MW3iJ+Y7DKPsP4wwA6I11zNj+5DW1LQLqn gIDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jl2si12390474ejc.488.2021.03.22.10.08.14; Mon, 22 Mar 2021 10:08:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231593AbhCVRFB (ORCPT + 99 others); Mon, 22 Mar 2021 13:05:01 -0400 Received: from mail-ej1-f43.google.com ([209.85.218.43]:39429 "EHLO mail-ej1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232036AbhCVREe (ORCPT ); Mon, 22 Mar 2021 13:04:34 -0400 Received: by mail-ej1-f43.google.com with SMTP id ce10so22483417ejb.6; Mon, 22 Mar 2021 10:04:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ihzH3n3aHmXKOtcPI8KDnr7LGDtclLmi/Ni6ekZYQ8Q=; b=RAQiCc6Iu0MyRhjmihJEEZYBD37Y0pptCTJIZRdJ9iEBg8sf0YpzocyiQVkLu14EQO 9HBa4ax7PyKRH4BrIbQXBIJx9kWWvHV9r7Irn5+53AA5rpPnMRkJqq6XdEtc790vUIXT shU1vGiMeCZRRu3cWwyW/cKPNWrHzOX/ttEfDzlnK4Jj8ZqO4UlUVHnQTWx78owKxiye SKLiHuYN2RmA9FYQUwKSsk4RV9U3s+c6mgE0yTYfx/mzIDi9L6m+bMIpbZ4Aav7w3RwI EdwaVcONh8MrSTBjiOvcMJV96s3CtA+zQLpzSN0rfeOuvZGU5jvho0U5g+y+dWS/WiJO 61DA== X-Gm-Message-State: AOAM531PIx8och63vuMgqRRISOgRvRLFHnbrfWy7c6fSeKy1aL/jCMhU HpQPNFyWK5YVxMoC5rCmJAVMrqnMVRc= X-Received: by 2002:a17:906:3f88:: with SMTP id b8mr854411ejj.36.1616432673283; Mon, 22 Mar 2021 10:04:33 -0700 (PDT) Received: from msft-t490s.teknoraver.net (net-2-34-63-208.cust.vodafonedsl.it. [2.34.63.208]) by smtp.gmail.com with ESMTPSA id h22sm9891589eji.80.2021.03.22.10.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 10:04:32 -0700 (PDT) From: Matteo Croce To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Jonathan Lemon , "David S. Miller" , Ilias Apalodimas , Jesper Dangaard Brouer , Lorenzo Bianconi , Saeed Mahameed , David Ahern , Saeed Mahameed , Andrew Lunn Subject: [PATCH net-next 6/6] mvneta: recycle buffers Date: Mon, 22 Mar 2021 18:03:01 +0100 Message-Id: <20210322170301.26017-7-mcroce@linux.microsoft.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210322170301.26017-1-mcroce@linux.microsoft.com> References: <20210322170301.26017-1-mcroce@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matteo Croce Use the new recycling API for page_pool. In a drop rate test, the packet rate increased di 10%, from 269 Kpps to 296 Kpps. perf top on a stock system shows: Overhead Shared Object Symbol 21.78% [kernel] [k] __pi___inval_dcache_area 21.66% [mvneta] [k] mvneta_rx_swbm 7.00% [kernel] [k] kmem_cache_alloc 6.05% [kernel] [k] eth_type_trans 4.44% [kernel] [k] kmem_cache_free.part.0 3.80% [kernel] [k] __netif_receive_skb_core 3.68% [kernel] [k] dev_gro_receive 3.65% [kernel] [k] get_page_from_freelist 3.43% [kernel] [k] page_pool_release_page 3.35% [kernel] [k] free_unref_page And this is the same output with recycling enabled: Overhead Shared Object Symbol 24.10% [kernel] [k] __pi___inval_dcache_area 23.02% [mvneta] [k] mvneta_rx_swbm 7.19% [kernel] [k] kmem_cache_alloc 6.50% [kernel] [k] eth_type_trans 4.93% [kernel] [k] __netif_receive_skb_core 4.77% [kernel] [k] kmem_cache_free.part.0 3.93% [kernel] [k] dev_gro_receive 3.03% [kernel] [k] build_skb 2.91% [kernel] [k] page_pool_put_page 2.85% [kernel] [k] __xdp_return The test was done with mausezahn on the TX side with 64 byte raw ethernet frames. Signed-off-by: Matteo Croce --- drivers/net/ethernet/marvell/mvneta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index a635cf84608a..8b3250394703 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -2332,7 +2332,7 @@ mvneta_swbm_build_skb(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, if (!skb) return ERR_PTR(-ENOMEM); - page_pool_release_page(rxq->page_pool, virt_to_page(xdp->data)); + skb_mark_for_recycle(skb, virt_to_page(xdp->data), &xdp->rxq->mem); skb_reserve(skb, xdp->data - xdp->data_hard_start); skb_put(skb, xdp->data_end - xdp->data); @@ -2344,7 +2344,7 @@ mvneta_swbm_build_skb(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, skb_frag_page(frag), skb_frag_off(frag), skb_frag_size(frag), PAGE_SIZE); - page_pool_release_page(rxq->page_pool, skb_frag_page(frag)); + skb_mark_for_recycle(skb, skb_frag_page(frag), &xdp->rxq->mem); } return skb; -- 2.30.2