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: <28ec0ed4-38b6-bb27-d769-5bf9d1d4f09c@solarflare.com>
Date:   Mon, 9 Mar 2020 17:46:57 +0000
From:   Edward Cree <ecree@...arflare.com>
To:     Jiri Pirko <jiri@...nulli.us>
CC:     <netdev@...r.kernel.org>, <davem@...emloft.net>, <kuba@...nel.org>,
        <saeedm@...lanox.com>, <leon@...nel.org>,
        <michael.chan@...adcom.com>, <vishal@...lsio.com>,
        <jeffrey.t.kirsher@...el.com>, <idosch@...lanox.com>,
        <aelior@...vell.com>, <peppe.cavallaro@...com>,
        <alexandre.torgue@...com>, <jhs@...atatu.com>,
        <xiyou.wangcong@...il.com>, <pablo@...filter.org>,
        <mlxsw@...lanox.com>
Subject: Re: [patch net-next v4 01/10] flow_offload: Introduce offload of HW
 stats type

On 09/03/2020 17:34, Jiri Pirko wrote:
> Mon, Mar 09, 2020 at 05:52:16PM CET, ecree@...arflare.com wrote:
>> An enum type seems safer.
> Well, it's is a bitfield, how do you envision to implement it. Have enum
> value for every combination? I don't get it.
enum flow_action_stats_type {
    FLOW_ACTION_HW_STATS_TYPE_DISABLED=0,
    FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE=BIT(0),
    FLOW_ACTION_HW_STATS_TYPE_DELAYED=BIT(1),
    FLOW_ACTION_HW_STATS_TYPE_ANY=(FLOW_ACTION_HW_STATS_TYPE_IMMEDIATE |
                                   FLOW_ACTION_HW_STATS_TYPE_DELAYED),
};

It's not a requirement of the language for every value used withan
 enumeration to be a defined enumerator value, so if someone ends up
 putting (FLOW_ACTION_HW_STATS_TYPE_FOO | FLOW_ACTION_HW_STATS_TYPE_BAR)
 into (say) a driver that supports only FOO and BAR, that will work
 just fine.  I don't see what problem you expect to occur here.

-ed

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ