Re: [PATCH net-next] net: ibm: emac: Clear MAL descriptors without memset

From: Rosen Penev

Date: Thu May 21 2026 - 15:03:34 EST


On Thu, May 21, 2026 at 5:06 AM Andrew Lunn <andrew@xxxxxxx> wrote:
>
> On Thu, May 21, 2026 at 11:45:25AM +0200, Paolo Abeni wrote:
> > 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.
> >
> > Sashiko noted that the compiler could still optimize the above to a
> > memset(). Perhaps a barrier() is needed here?
>
> Maybe my understanding is wrong, but the compiler should have the
> knowledge about if the addresses are aligned or not, and so if it can
> call the optimised memset, or needs to keep with individual byte
> accesses?
>
> Has this patch been in user for a while, a port from downstream
> OpenWRT or something?
Yes and no. These devices are currently on kernel 6.12, where the
warnings are present. In the transition to 6.18, I'm fixing them.
>
> Andrew