From: Simon Horman <horms@kernel.org>
To: Rosen Penev <rosenp@gmail.com>
Cc: netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] net: ibm: emac: use page_pool for RX buffers
Date: Thu, 5 Nov 2026 20:13:02 +0000 [thread overview]
Message-ID: <20261105201302.GY865646@horms.kernel.org> (raw)
In-Reply-To: <20261102034806.190498-1-rosenp@gmail.com>
On Sun, Nov 01, 2026 at 07:48:06PM -0800, Rosen Penev wrote:
> The RX ring held skbs that were allocated and DMA mapped when a slot was
> refilled. By the time a frame arrived in that slot the skb was cold, and
> every refill paid for a full skb allocation and a dma_map_single().
>
> Take the RX buffers from a page_pool instead and build the skb with
> napi_build_skb() once a frame has arrived. Frames spanning several BDs
> get the following buffers attached as page fragments instead of being
> copied into one large skb. The BD size is capped so that a buffer always
> fits into a page. The driver now syncs the received data for the CPU
> before reading it.
>
> The pool recycles directly into the MAL NAPI instance, so it is
> destroyed while that instance is disabled.
>
> Routing a single TCP stream through the qca8k switch of a Meraki MX60
> (iperf3 median of 3):
>
> LAN->WAN WAN->LAN (Mbit/s)
> before 588 508
> after 614 528
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
...
> @@ -1661,17 +1667,23 @@ static void emac_poll_tx(void *param)
> netif_tx_unlock_bh(dev->ndev);
> }
>
> +static inline void emac_rx_sync_for_cpu(struct emac_instance *dev, int slot,
> + int len)
> +{
> + dma_sync_single_for_cpu(&dev->ofdev->dev, dev->rx_dma[slot],
> + SKB_DATA_ALIGN(len + NET_IP_ALIGN),
> + DMA_FROM_DEVICE);
> +}
> +
Hi Rosen,
I realise this is pattern already pervasive in this file.
But please do not add new instances of the inline keyword
in C files unless there is a demonstrable reason to do so -
usually performance.
Instead, please let the compiler do it's thing.
Otherwise this patch looks good to me.
--
pw-bot: changes-requested
...
prev parent reply other threads:[~2026-11-05 20:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 3:48 [PATCH net-next] net: ibm: emac: use page_pool for RX buffers Rosen Penev
2026-11-05 20:13 ` Simon Horman [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=20261105201302.GY865646@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rosenp@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.