From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Matteo Croce <mcroce@linux.microsoft.com>
Cc: netdev@vger.kernel.org, linux-mm@kvack.org,
Ayush Sawal <ayush.sawal@chelsio.com>,
Vinay Kumar Yadav <vinay.yadav@chelsio.com>,
Rohit Maheshwari <rohitm@chelsio.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Marcin Wojtas <mw@semihalf.com>,
Mirko Lindner <mlindner@marvell.com>,
Stephen Hemminger <stephen@networkplumber.org>,
Tariq Toukan <tariqt@nvidia.com>,
Jesper Dangaard Brouer <hawk@kernel.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
Boris Pismenny <borisp@nvidia.com>, Arnd Bergmann <arnd@arndb.de>,
Andrew Morton <akpm@linux-foundation.org>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Vlastimil Babka <vbabka@suse.cz>, Yu Zhao <yuzhao@google.com>,
Will Deacon <will@kernel.org>, Fenghua Yu <fenghua.yu@intel.com>,
Roman Gushchin <guro@fb.com>, Hugh Dickins <hughd@google.com>,
Peter Xu <peterx@redhat.com>, Jason Gunthorpe <jgg@ziepe.ca>,
Jonathan Lemon <jonathan.lemon@gmail.com>,
Alexander Lobakin <alobakin@pm.me>,
Cong Wang <cong.wang@bytedance.com>, wenxu <wenxu@ucloud.cn>,
Kevin Hao <haokexin@gmail.com>,
Jakub Sitnicki <jakub@cloudflare.com>,
Marco Elver <elver@google.com>,
Willem de Bruijn <willemb@google.com>,
Miaohe Lin <linmiaohe@huawei.com>,
Yunsheng Lin <linyunsheng@huawei.com>,
Guillaume Nault <gnault@redhat.com>,
linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
bpf@vger.kernel.org, Matthew Wilcox <willy@infradead.org>,
Eric Dumazet <edumazet@google.com>,
David Ahern <dsahern@gmail.com>,
Lorenzo Bianconi <lorenzo@kernel.org>,
Saeed Mahameed <saeedm@nvidia.com>, Andrew Lunn <andrew@lunn.ch>,
Paolo Abeni <pabeni@redhat.com>,
Sven Auhagen <sven.auhagen@voleatech.de>
Subject: Re: [PATCH net-next v5 5/5] mvneta: recycle buffers
Date: Thu, 13 May 2021 19:25:54 +0100 [thread overview]
Message-ID: <20210513182554.GB12395@shell.armlinux.org.uk> (raw)
In-Reply-To: <20210513165846.23722-6-mcroce@linux.microsoft.com>
On Thu, May 13, 2021 at 06:58:46PM +0200, Matteo Croce wrote:
> From: Matteo Croce <mcroce@microsoft.com>
>
> Use the new recycling API for page_pool.
> In a drop rate test, the packet rate increased di 10%,
Typo - "by" ?
> 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 <mcroce@microsoft.com>
Other than the typo, I have no objection to the patch.
Acked-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> ---
> drivers/net/ethernet/marvell/mvneta.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index 7d5cd9bc6c99..6d2f8dce4900 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -2320,7 +2320,7 @@ mvneta_swbm_add_rx_fragment(struct mvneta_port *pp,
> }
>
> static struct sk_buff *
> -mvneta_swbm_build_skb(struct mvneta_port *pp, struct mvneta_rx_queue *rxq,
> +mvneta_swbm_build_skb(struct mvneta_port *pp, struct page_pool *pool,
> struct xdp_buff *xdp, u32 desc_status)
> {
> struct skb_shared_info *sinfo = xdp_get_shared_info_from_buff(xdp);
> @@ -2331,7 +2331,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), pool);
>
> skb_reserve(skb, xdp->data - xdp->data_hard_start);
> skb_put(skb, xdp->data_end - xdp->data);
> @@ -2343,7 +2343,10 @@ 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));
> + /* We don't need to reset pp_recycle here. It's already set, so
> + * just mark fragments for recycling.
> + */
> + page_pool_store_mem_info(skb_frag_page(frag), pool);
> }
>
> return skb;
> @@ -2425,7 +2428,7 @@ static int mvneta_rx_swbm(struct napi_struct *napi,
> mvneta_run_xdp(pp, rxq, xdp_prog, &xdp_buf, frame_sz, &ps))
> goto next;
>
> - skb = mvneta_swbm_build_skb(pp, rxq, &xdp_buf, desc_status);
> + skb = mvneta_swbm_build_skb(pp, pp, &xdp_buf, desc_status);
> if (IS_ERR(skb)) {
> struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats);
>
> --
> 2.31.1
>
>
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
prev parent reply other threads:[~2021-05-13 18:26 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-13 16:58 [PATCH net-next v5 0/5] page_pool: recycle buffers Matteo Croce
2021-05-13 16:58 ` [PATCH net-next v5 1/5] mm: add a signature in struct page Matteo Croce
2021-05-14 1:00 ` Matthew Wilcox
2021-05-14 1:34 ` Matteo Croce
2021-05-18 15:44 ` Matteo Croce
2021-05-13 16:58 ` [PATCH net-next v5 2/5] skbuff: add a parameter to __skb_frag_unref Matteo Croce
2021-05-13 16:58 ` [PATCH net-next v5 3/5] page_pool: Allow drivers to hint on SKB recycling Matteo Croce
2021-05-14 3:39 ` Yunsheng Lin
2021-05-14 7:36 ` Ilias Apalodimas
2021-05-14 8:31 ` Yunsheng Lin
2021-05-14 9:17 ` Ilias Apalodimas
2021-05-15 2:07 ` Yunsheng Lin
2021-05-17 6:38 ` Ilias Apalodimas
2021-05-17 8:25 ` Yunsheng Lin
2021-05-17 9:36 ` Ilias Apalodimas
2021-05-17 11:10 ` Yunsheng Lin
2021-05-17 11:35 ` Ilias Apalodimas
2021-05-13 16:58 ` [PATCH net-next v5 4/5] mvpp2: recycle buffers Matteo Croce
2021-05-13 18:20 ` Russell King (Oracle)
2021-05-13 23:52 ` Matteo Croce
2021-05-13 16:58 ` [PATCH net-next v5 5/5] mvneta: " Matteo Croce
2021-05-13 18:25 ` Russell King (Oracle) [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210513182554.GB12395@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=akpm@linux-foundation.org \
--cc=alobakin@pm.me \
--cc=andrew@lunn.ch \
--cc=arnd@arndb.de \
--cc=ast@kernel.org \
--cc=ayush.sawal@chelsio.com \
--cc=borisp@nvidia.com \
--cc=bpf@vger.kernel.org \
--cc=cong.wang@bytedance.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=edumazet@google.com \
--cc=elver@google.com \
--cc=fenghua.yu@intel.com \
--cc=gnault@redhat.com \
--cc=guro@fb.com \
--cc=haokexin@gmail.com \
--cc=hawk@kernel.org \
--cc=hughd@google.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jakub@cloudflare.com \
--cc=jgg@ziepe.ca \
--cc=john.fastabend@gmail.com \
--cc=jonathan.lemon@gmail.com \
--cc=kuba@kernel.org \
--cc=linmiaohe@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linyunsheng@huawei.com \
--cc=lorenzo@kernel.org \
--cc=mcroce@linux.microsoft.com \
--cc=mlindner@marvell.com \
--cc=mw@semihalf.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peterx@redhat.com \
--cc=peterz@infradead.org \
--cc=rohitm@chelsio.com \
--cc=saeedm@nvidia.com \
--cc=stephen@networkplumber.org \
--cc=sven.auhagen@voleatech.de \
--cc=tariqt@nvidia.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=vbabka@suse.cz \
--cc=vinay.yadav@chelsio.com \
--cc=wenxu@ucloud.cn \
--cc=will@kernel.org \
--cc=willemb@google.com \
--cc=willy@infradead.org \
--cc=yuzhao@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).