From: Alexander Lobakin <alexandr.lobakin@intel.com>
To: "shenjian (K)" <shenjian15@huawei.com>
Cc: Alexander Lobakin <alexandr.lobakin@intel.com>,
davem@davemloft.net, kuba@kernel.org, andrew@lunn.ch,
ecree.xilinx@gmail.com, hkallweit1@gmail.com, saeed@kernel.org,
leon@kernel.org, netdev@vger.kernel.org, linuxarm@openeuler.org
Subject: Re: [RFCv7 PATCH net-next 02/36] net: replace general features macroes with global netdev_features variables
Date: Thu, 11 Aug 2022 13:05:29 +0200 [thread overview]
Message-ID: <20220811110529.4866-1-alexandr.lobakin@intel.com> (raw)
In-Reply-To: <7eb9ad01-cf1f-afea-0c16-4b269462236f@huawei.com>
From: "shenjian (K)" <shenjian15@huawei.com>
Date: Wed, 10 Aug 2022 20:01:15 +0800
> 在 2022/8/10 17:58, Alexander Lobakin 写道:
> > From: Jian Shen <shenjian15@huawei.com>
> > Date: Wed, 10 Aug 2022 11:05:50 +0800
> >
> >> There are many netdev_features bits group used in kernel. The definition
> >> will be illegal when using feature bit more than 64. Replace these macroes
> >> with global netdev_features variables, initialize them when netdev module
> >> init.
> >>
> >> Signed-off-by: Jian Shen <shenjian15@huawei.com>
> >> ---
[...]
> >> @@ -11362,6 +11363,86 @@ static struct pernet_operations __net_initdata default_device_ops = {
> >> .exit_batch = default_device_exit_batch,
> >> };
> >>
> >> +static void __init netdev_features_init(void)
> > Given that you're creating a new file dedicated to netdev features,
> > I'd place that initializer there. You can then declare its proto in
> > net/core/dev.h.
> I want to make sure it cann't be called outside net/core/dev.c, for some
> drivers include net/core/dev.h, then they can see it.
net/core/dev.h is internal, nobody outside net/core/ uses it and
this was its purpose.
>
> >> +{
> >> + netdev_features_t features;
> >> +
> >> + netdev_features_set_array(&netif_f_ip_csum_feature_set,
> >> + &netdev_ip_csum_features);
> >> + netdev_features_set_array(&netif_f_csum_feature_set_mask,
> >> + &netdev_csum_features_mask);
> >> +
> >> + netdev_features_set_array(&netif_f_gso_feature_set_mask,
> >> + &netdev_gso_features_mask);
> >> + netdev_features_set_array(&netif_f_general_tso_feature_set,
> >> + &netdev_general_tso_features);
> >> + netdev_features_set_array(&netif_f_all_tso_feature_set,
> >> + &netdev_all_tso_features);
> >> + netdev_features_set_array(&netif_f_tso_ecn_feature_set,
> >> + &netdev_tso_ecn_features);
> >> + netdev_features_set_array(&netif_f_all_fcoe_feature_set,
> >> + &netdev_all_fcoe_features);
> >> + netdev_features_set_array(&netif_f_gso_soft_feature_set,
> >> + &netdev_gso_software_features);
> >> + netdev_features_set_array(&netif_f_gso_encap_feature_set,
> >> + &netdev_gso_encap_all_features);
> >> +
> >> + netdev_csum_gso_features_mask =
> >> + netdev_features_or(netdev_gso_features_mask,
> >> + netdev_csum_features_mask);
> > (I forgot to mention this in 01/36 ._.)
> >
> > As you're converting to bitmaps, you should probably avoid direct
> > assignments. All the bitmap_*() modification functions take a pointer
> > to the destination as a first argument. So it should be
> >
> > netdev_features_or(netdev_features_t *dst, const netdev_features_t *src1,
> > const netdev_features_t *src1);
> The netdev_features_t will be convert to a structure which only contained
> a feature bitmap. So assginement is ok.
Yeah I realized it later, probably a good idea.
>
>
> >> +
> >> + netdev_features_set_array(&netif_f_one_for_all_feature_set,
> >> + &netdev_one_for_all_features);
> > Does it make sense to prefix features and the corresponding sets
> > differently? Why not just 'netdev_' for both of them?
> For all the feature bits are named "NETFI_F_XXX_BIT",
Right, but then why are netdev_*_features prefixed with 'netdev',
not 'netif_f'? :D Those sets are tied tightly with the feature
structures, so I think they should have the same prefix. I'd go
with 'netdev' for both.
>
>
> >> + netdev_features_set_array(&netif_f_all_for_all_feature_set,
> >> + &netdev_all_for_all_features);
[...]
> >> --
> >> 2.33.0
> > Thanks,
> > Olek
> >
> > .
>
> Thank,
> Jian
Thanks,
Olek
next prev parent reply other threads:[~2022-08-11 11:14 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-10 3:05 [RFCv7 PATCH net-next 00/36] net: extend the type of netdev_features_t to bitmap Jian Shen
2022-08-10 3:05 ` [RFCv7 PATCH net-next 01/36] net: introduce operation helpers for netdev features Jian Shen
2022-08-10 9:43 ` Alexander Lobakin
2022-08-10 11:32 ` shenjian (K)
2022-08-11 10:49 ` Alexander Lobakin
2022-08-12 2:39 ` shenjian (K)
2022-08-10 3:05 ` [RFCv7 PATCH net-next 02/36] net: replace general features macroes with global netdev_features variables Jian Shen
2022-08-10 9:58 ` Alexander Lobakin
2022-08-10 12:01 ` shenjian (K)
2022-08-11 11:05 ` Alexander Lobakin [this message]
2022-08-12 10:58 ` shenjian (K)
2022-08-10 3:05 ` [RFCv7 PATCH net-next 03/36] net: replace multiple feature bits with DECLARE_NETDEV_FEATURE_SET Jian Shen
2022-08-10 10:37 ` Alexander Lobakin
2022-08-10 12:15 ` shenjian (K)
2022-08-10 3:05 ` [RFCv7 PATCH net-next 04/36] net: sfc: replace const features initialization " Jian Shen
2022-08-10 3:05 ` [RFCv7 PATCH net-next 05/36] net: atlantic: replace const features initialization with NETDEV_FEATURE_SET Jian Shen
2022-08-10 3:05 ` [RFCv7 PATCH net-next 06/36] iwlwifi: " Jian Shen
2022-08-10 3:05 ` [RFCv7 PATCH net-next 07/36] net: ethernet: mtk_eth_soc: " Jian Shen
2022-08-10 3:05 ` [RFCv7 PATCH net-next 08/36] ravb: " Jian Shen
2022-08-10 3:05 ` [RFCv7 PATCH net-next 09/36] test_bpf: " Jian Shen
2022-08-10 3:05 ` [RFCv7 PATCH net-next 10/36] treewide: replace NETIF_F_CSUM_MASK | NETIF_F_GSO_MASK by netdev_csum_gso_features_mask Jian Shen
2022-08-10 3:05 ` [RFCv7 PATCH net-next 11/36] treewide: replace NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM by netdev_ip_csum_features Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 12/36] treewide: replace NETIF_F_TSO | NETIF_F_TSO6 by netdev_general_tso_features Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 13/36] treewide: replace VLAN tag feature array by const vlan features Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 14/36] net: simplify the netdev features expressions for xxx_gso_segment Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 15/36] treewide: simplify the netdev features expression Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 16/36] treewide: use replace features '0' by netdev_empty_features Jian Shen
2022-08-10 10:48 ` Alexander Lobakin
2022-08-10 12:25 ` shenjian (K)
2022-08-11 12:35 ` Alexander Lobakin
2022-08-10 3:06 ` [RFCv7 PATCH net-next 17/36] treewide: adjust features initialization Jian Shen
2022-08-10 10:58 ` Alexander Lobakin
2022-08-10 14:06 ` shenjian (K)
2022-08-10 3:06 ` [RFCv7 PATCH net-next 18/36] net: mlx4: adjust the net device feature relative macroes Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 19/36] net: mlx5e: adjust " Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 20/36] net: mlxsw: adjust input parameter for function mlxsw_sp_handle_feature Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 21/36] net: iavf: adjust net device features relative macroes Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 22/36] net: core: adjust netdev_sync_xxx_features Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 23/36] net: adjust the build check for net_gso_ok() Jian Shen
2022-08-10 11:09 ` Alexander Lobakin
2022-08-10 14:41 ` shenjian (K)
2022-08-10 3:06 ` [RFCv7 PATCH net-next 24/36] treewide: use netdev_feature_add helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 25/36] treewide: use netdev_features_or/set helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 26/36] treewide: use netdev_feature_change helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 27/36] treewide: use netdev_feature_del helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 28/36] treewide: use netdev_features_andnot and netdev_features_clear helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 29/36] treewide: use netdev_features_xor helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 30/36] treewide: use netdev_feature_test helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 31/36] treewide: use netdev_features_intersects helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 32/36] net: use netdev_features_and and netdev_features_mask helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 33/36] treewide: use netdev_features_subset helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 34/36] treewide: use netdev_features_equal helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 35/36] treewide: use netdev_features_empty helpers Jian Shen
2022-08-10 3:06 ` [RFCv7 PATCH net-next 36/36] net: redefine the prototype of netdev_features_t Jian Shen
2022-08-10 11:35 ` Alexander Lobakin
[not found] ` <3df89822-7dec-c01e-0df9-15b8e6f7d4e5@huawei.com>
2022-08-11 13:07 ` Alexander Lobakin
2022-08-11 15:13 ` Jakub Kicinski
2022-08-12 11:43 ` shenjian (K)
2022-08-12 11:30 ` shenjian (K)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220811110529.4866-1-alexandr.lobakin@intel.com \
--to=alexandr.lobakin@intel.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linuxarm@openeuler.org \
--cc=netdev@vger.kernel.org \
--cc=saeed@kernel.org \
--cc=shenjian15@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).