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] [day] [month] [year] [list]
Date:	Tue, 23 Aug 2011 16:24:37 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	rmody@...cade.com
Cc:	netdev@...r.kernel.org, adapter_linux_open_src_team@...cade.com,
	gkaraje@...cade.com
Subject: Re: [net-next,v4 04/12] bna: TX Path and RX Path Changes

From: David Miller <davem@...emloft.net>
Date: Tue, 23 Aug 2011 16:22:20 -0700 (PDT)

> From: Rasesh Mody <rmody@...cade.com>
> Date: Tue, 23 Aug 2011 10:56:00 -0700
> 
>> +	BNA_QE_INDX_ADD(_index, 1, _depth); \
>> +	for (j = 0; j < (_frag); j++) { \
>> +		prefetch(&(_array)[(_index) + 1]); \
>> +		dma_unmap_page(_pdev, dma_unmap_addr(&(_array)[_index], \
> 
> This prefetch is excessive and a waste of cpu cycles.
> 
> You're going to prefetch a full 64-byte (or even 128-byte) cache line
> for every 16-byte blob (at best) you iterate over.  This means you'll
> prefetch the same cache line, needlessly, over and over again.

Also this whole idea to macroize this operation is bad.

Use a real seperate C function if you want to avoid code duplicaiton.
Don't mark it inline, let the compiler take care of that.

Otherwise you're sacrificing type safety and risking the usual problems
created by macros (multiple variable evaluation etc.).
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ