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:   Fri, 25 Mar 2022 11:32:08 +0800
From:   "shenjian (K)" <shenjian15@...wei.com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     <davem@...emloft.net>, <andrew@...n.ch>, <ecree.xilinx@...il.com>,
        <hkallweit1@...il.com>, <alexandr.lobakin@...el.com>,
        <saeed@...nel.org>, <leon@...nel.org>, <netdev@...r.kernel.org>,
        <linuxarm@...neuler.org>, <lipeng321@...wei.com>
Subject: Re: [RFCv5 PATCH net-next 04/20] net: replace multiple feature bits
 with netdev features array



在 2022/3/25 9:22, Jakub Kicinski 写道:
> On Thu, 24 Mar 2022 23:49:16 +0800 Jian Shen wrote:
>> There are many netdev_features bits group used in drivers, replace them
>> with netdev features array.
> Maybe we can avoid the ARRAY_SIZE calls by doing something like:
>
> struct netdev_feature_set {
> 	unsigned int cnt;
> 	unsigned short feature_bits[];
> };
>
> #define DECLARE_NETDEV_FEATURE_SET(name, features...)    \
>          static unsigned short __ ## name ## _s [] = {features}; \
>          struct netdev_feature_set name = {               \
>                  .cnt = ARRAY_SIZE(__ ## name ## _s),     \
>                  .feature_bits = {features},              \
>          }
>
> Then:
>
> DECLARE_NETDEV_FEATURE_SET(siena_offload_features,
> 			   NETIF_F_IP_CSUM_BIT,
> 			   NETIF_F_IPV6_CSUM_BIT,
> 			   NETIF_F_RXHASH_BIT,
> 			   NETIF_F_NTUPLE_BIT);
>
> etc.?
> .
>
Thanks, it looks good to me.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ