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: <20240215050857.GC4861@lst.de>
Date: Thu, 15 Feb 2024 06:08:57 +0100
From: Christoph Hellwig <hch@....de>
To: Robin Murphy <robin.murphy@....com>
Cc: Alexander Lobakin <aleksander.lobakin@...el.com>,
	"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 Wed, Feb 14, 2024 at 05:55:23PM +0000, Robin Murphy wrote:
>>   #define DMA_F_PCI_P2PDMA_SUPPORTED     (1 << 0)
>> +#define DMA_F_CAN_SKIP_SYNC		BIT(1)
>
> Yuck, please be consistent - either match the style of the existing code, 
> or change that to BIT(0) as well.

Just don't use BIT() ever.  It doesn't save any typing and creates a
totally pointless mental indirection.

> I guess this was the existing condition from dma_need_sync(), but now it's 
> on a one-off slow path it might be nice to check the sync_sg_* ops as well 
> for completeness, or at least comment that nobody should be implementing 
> those without also implementing the sync_single_* ops.

Implementing only one and not the other doesn't make any sense.  Maybe
a debug check for that is ok, but thing will break badly if they aren't
in sync anyway.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ