[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3bae8002-1e16-b7c2-f7a2-3c13c14b7aed@huawei.com>
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