lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7e3c779e-09ae-4c87-855e-f0e6ae945169@arm.com>
Date: Mon, 26 Feb 2024 15:45:44 +0000
From: Robin Murphy <robin.murphy@....com>
To: Alexander Lobakin <aleksander.lobakin@...el.com>
Cc: "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, Christoph Hellwig <hch@....de>,
 Marek Szyprowski <m.szyprowski@...sung.com>, Joerg Roedel <joro@...tes.org>,
 Will Deacon <will@...nel.org>,
 Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
 "Rafael J. Wysocki" <rafael@...nel.org>,
 Magnus Karlsson <magnus.karlsson@...el.com>,
 Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
 Alexander Duyck <alexanderduyck@...com>, bpf@...r.kernel.org,
 netdev@...r.kernel.org, iommu@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v3 2/7] dma: avoid redundant calls for sync
 operations

On 19/02/2024 12:49 pm, Alexander Lobakin wrote:
> From: Robin Murphy <robin.murphy@....com>
> Date: Wed, 14 Feb 2024 17:55:23 +0000
> 
>> On 2024-02-14 4:21 pm, Alexander Lobakin wrote:
> 
> [...]
> 
>>> +        /*
>>> +         * Synchronization is not possible when none of DMA sync ops
>>> +         * is set. This check precedes the below one as it disables
>>> +         * the synchronization unconditionally.
>>> +         */
>>> +        dev->dma_skip_sync = true;
>>> +    else if (ops->flags & DMA_F_CAN_SKIP_SYNC)
>>
>> Personally I'd combine this into the dma-direct condition.
> 
> Please read the code comment a couple lines above :D

And my point is that that logic is not actually useful, since it would 
be nonsensical for ops to set DMA_F_CAN_SKIP_SYNC if they don't even 
implement sync ops anyway.

If the intent of DMA_F_CAN_SKIP_SYNC is to mean "behaves like 
dma-direct", then "if (dma_map_direct(...) || ops->flags & 
DMA_F_CAN_SKIP_SYNC)" is an entirely logical and expected condition.

Thanks,
Robin.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ