[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200310112214.GB2295@nanopsycho.orion>
Date: Tue, 10 Mar 2020 12:22:14 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Edward Cree <ecree@...arflare.com>, netdev@...r.kernel.org,
davem@...emloft.net, 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
Mon, Mar 09, 2020 at 11:38:17PM CET, kuba@...nel.org wrote:
>On Mon, 9 Mar 2020 22:27:59 +0000 Edward Cree wrote:
>> > Driver author can understandably try to simply handle all the values
>> > in a switch statement and be unpleasantly surprised.
>> In my experience, unenumerated enum values of this kind are fully
>> idiomatic C; and a driver author looking at the header file to see
>> what enumeration constants are defined will necessarily see all the
>> calls to BIT() and the bitwise-or construction of _ANY.
>> I'm not sure I believe a naïve switch() implementation is an
>> "understandable" error.
>
>Could be my slight exposure to HDLs that makes me strongly averse to
>encoding state outside of a enumeration into a value of that type :)
>
>> How about if we also rename the field "hw_stats_types", or squeeze
>> the word "mask" in there somewhere?
>
>That'd make things slightly better.
It is not a mask though...
Powered by blists - more mailing lists