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: <CAJ3xEMjaaCWZ7gMaRVj-WRV5rcUc1JLwQZrQZihxjbg21uXTbA@mail.gmail.com>
Date:   Thu, 29 Jun 2017 16:46:58 +0300
From:   Or Gerlitz <gerlitz.or@...il.com>
To:     Simon Horman <simon.horman@...ronome.com>
Cc:     David Miller <davem@...emloft.net>,
        Jakub Kicinski <jakub.kicinski@...ronome.com>,
        Linux Netdev List <netdev@...r.kernel.org>,
        oss-drivers@...ronome.com,
        Pieter Jansen van Vuuren 
        <pieter.jansenvanvuuren@...ronome.com>
Subject: Re: [PATCH net-next v2 9/9] nfp: add control message passing
 capabilities to flower offloads

On Wed, Jun 28, 2017 at 11:30 PM, Simon Horman
<simon.horman@...ronome.com> wrote:
> From: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@...ronome.com>

> +nfp_flower_xmit_flow(struct net_device *netdev,
> +                    struct nfp_fl_payload *nfp_flow, u8 mtype)
> +{
> +       u32 meta_len, key_len, mask_len, act_len, tot_len;
> +       struct nfp_repr *priv = netdev_priv(netdev);
> +       struct sk_buff *skb;
> +       unsigned char *msg;
> +
> +       meta_len =  sizeof(struct nfp_fl_rule_metadata);
> +       key_len = nfp_flow->meta.key_len;
> +       mask_len = nfp_flow->meta.mask_len;
> +       act_len = nfp_flow->meta.act_len;
> +
> +       tot_len = meta_len + key_len + mask_len + act_len;
> +
> +       /* Convert to long words as firmware expects
> +        * lengths in units of NFP_FL_LW_SIZ.
> +        */
> +       nfp_flow->meta.key_len /= NFP_FL_LW_SIZ;
> +       nfp_flow->meta.mask_len /= NFP_FL_LW_SIZ;
> +       nfp_flow->meta.act_len /= NFP_FL_LW_SIZ;

better to use use x >>= 2 instead x /= 4

I saw it in other places across the patch/set

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ