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]
Date:   Thu, 29 Jun 2017 13:47:33 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Jakub Kicinski' <jakub.kicinski@...ronome.com>,
        Yunsheng Lin <linyunsheng@...wei.com>
CC:     Simon Horman <simon.horman@...ronome.com>,
        David Miller <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "oss-drivers@...ronome.com" <oss-drivers@...ronome.com>,
        "Pieter Jansen van Vuuren" <pieter.jansenvanvuuren@...ronome.com>
Subject: RE: [PATCH net-next v2 4/9] nfp: extend flower add flow offload

From: Jakub Kicinski
> Sent: 29 June 2017 07:48
> On Thu, 29 Jun 2017 14:18:07 +0800, Yunsheng Lin wrote:
> > > +	if (mask_basic->n_proto) {
> > cpu_to_be16(mask_basic->n_proto)

Should be be16_to_cpu()

> > remove cpu_to_be16 in case.
> 
> Thanks, but this is incorrect.  Byte swapping constants is done at
> compilation time - therefore it's preferred.

Except that the 'cpu' values are likely to be dense so the compiler
is likely to generate a jump table for the switch statement instead
of sequence of conditionals.

OTOH the jump table is almost certainly a data cache miss, whereas
the conditionals might be predicted correctly.

The best code might come from an explicitly ordered sequence of
conditionals.

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ