From: Paolo Abeni <pabeni@redhat.com>
To: Rosen Penev <rosenp@gmail.com>, netdev@vger.kernel.org
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] net: ibm: emac: Clear MAL descriptors without memset
Date: Thu, 21 May 2026 11:45:25 +0200 [thread overview]
Message-ID: <b9a1ce9c-1f5c-485c-8d65-bb00c7850842@redhat.com> (raw)
In-Reply-To: <20260517033621.1839397-1-rosenp@gmail.com>
On 5/17/26 5:36 AM, Rosen Penev wrote:
> Clear MAL descriptor rings with explicit field stores instead of
> memset(). The descriptor rings are carved from MAL coherent DMA memory,
> which may be mapped uncached on 32-bit powerpc. The optimized memset()
> path can use dcbz there and trigger an alignment warning.
>
> The skb tracking arrays remain ordinary CPU memory and still use memset().
>
> Assisted-by: Codex:GPT-5.5
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> drivers/net/ethernet/ibm/emac/core.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
> index 1fd7cb50c568..7ab5c944f5de 100644
> --- a/drivers/net/ethernet/ibm/emac/core.c
> +++ b/drivers/net/ethernet/ibm/emac/core.c
> @@ -1161,6 +1161,17 @@ static void emac_clean_rx_ring(struct emac_instance *dev)
> }
> }
>
> +static void emac_clear_mal_desc(struct mal_descriptor *desc, int count)
> +{
> + int i;
> +
> + for (i = 0; i < count; i++) {
> + desc[i].ctrl = 0;
> + desc[i].data_len = 0;
> + desc[i].data_ptr = 0;
Sashiko noted that the compiler could still optimize the above to a
memset(). Perhaps a barrier() is needed here?
/P
next prev parent reply other threads:[~2026-05-21 9:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-17 3:36 Rosen Penev
2026-05-21 9:45 ` Paolo Abeni [this message]
2026-05-21 12:06 ` Andrew Lunn
2026-05-21 19:02 ` Rosen Penev
2026-05-21 19:01 ` Rosen Penev
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=b9a1ce9c-1f5c-485c-8d65-bb00c7850842@redhat.com \
--to=pabeni@redhat.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®