Re: [PATCH net-next V5] net/mlx5: Improve write-combining test reliability for ARM64 Grace CPUs

From: Arnd Bergmann
Date: Thu Sep 25 2025 - 09:06:48 EST


On Thu, Sep 25, 2025, at 14:21, Jason Gunthorpe wrote:
> On Thu, Sep 25, 2025 at 03:15:46PM +0300, Patrisious Haddad wrote:
>>
>> On 9/25/2025 2:54 PM, Jason Gunthorpe wrote:
>> > On Thu, Sep 25, 2025 at 02:48:33PM +0300, Tariq Toukan wrote:
>> > > +static void mlx5_iowrite64_copy(struct mlx5_wc_sq *sq, __be32 mmio_wqe[16],
>> > > + size_t mmio_wqe_size, unsigned int offset)
>> > > +{
>> > > +#if defined(CONFIG_KERNEL_MODE_NEON) && defined(CONFIG_ARM64)
>> > IS_ENABLED() not defined()
>> I just wonder why, Is there a preference in the driver from like
>> aesthetic/convention point of view?
>> Since here it technically doesnt matter - IS_ENABLED have no functional
>> difference from defined since these are boolean configs not *tristate*ones
>> (cant be loaded as module).
>
> I think it is an aesthetic convention to avoid defined(CONFIG_*) as
> the reasoning it is not tristate is a bit tricky.

In my impression there is no general agreement on this, I would
probably have picked defined() here myself but don't mind the
IS_ENABLED() variant either.

On the other hand, I would in general strongly prefer

if (IS_ENABLED(CONFIG_FOO)) {
...
}

over any of the preprocessor conditionals, both for readability
and for improving compile-time coverage of the conditional code.

Unfortunately that does not work here because kernel_neon_begin()
etc are only defined on Arm.

Arnd