[RFCv6 PATCH net-next 00/19] net: extend the type of netdev_features_t to bitmap
by Jian Shen
For the prototype of netdev_features_t is u64, and the number
of netdevice feature bits is 64 now. So there is no space to
introduce new feature bit.
This patchset try to solve it by change the prototype of
netdev_features_t from u64 to structure below:
typedef struct {
DECLARE_BITMAP(bits, NETDEV_FEATURE_COUNT);
} netdev_features_t;
With this change, it's necessary to introduce a set of bitmap
operation helpers for netdev features. As the nic drivers are
not supposed to modify netdev_features directly, it also
introduces wrappers helpers to this. [patch 1]
To avoid mistake using NETIF_F_XXX as NETIF_F_XXX_BIT as
input macroes for above helpers, remove all the macroes
of NETIF_F_XXX. [patch 19]
The features group macroes in netdev_features.h are replaced
by a set of const features defined in netdev_features.c. [patch 2-3]
For example:
macro NETIF_F_ALL_TSO is replaced by netdev_all_tso_features
There are some drivers(e.g. sfc) use netdev_features in global
structure initialization. Changed the its netdev_features_t memeber
to netdev_features_t *, and make it prefer to a netdev_features_t
global variables. [patch 4]
As suggestion from Andrew Lunn, I wrote some semantic patches to do the
work(replacing the netdev features operator by helpers). [patch 7-18]
To make the semantic patches simple, I split the complex opreation of
netdev_features to simple logical operation. [patch 5, 6]
With the prototype is no longer u64, the implementation of print interface
for netdev features(%pNF) is changed to bitmap. [patch 19]
The whole work is not complete yet. I just use these changes
on several files(hns3 driver, sfc drivers, net/ethtool, net/core/dev.c),
in order to show how these helpers will be used. I will apply these helpers
to the whole tree later, sofar I want to get more suggestions for this
scheme, any comments would be appreciated.
The former discussion please see [1][2][3][4].
[1]:https://www.spinics.net/lists/netdev/msg769952.html
[2]:https://www.spinics.net/lists/netdev/msg777764.html
[3]:https://lore.kernel.org/netdev/20211107101519.29264-1-shenjian15@huawe...
[4]:https://www.spinics.net/lists/netdev/msg809293.html
ChangeLog:
V5-V6: suggestions from Jakub Kicinski:
drop the rename for netdev->features
simplify names of some helpers, and move them to a new header file
refine the implement for netdev_features_set_array
V4->V5:
adjust the patch structure, use semantic patch with coccinelle
V3->V4:
rename netdev->features to netdev->active_features
remove helpes for handle first 64 bits
remove __NETIF_F(name) macroes
replace features group macroes with const features
V2->V3:
use structure for bitmap, suggest by Edward Cree
V1->V2:
Extend the prototype from u64 to bitmap, suggest by Andrew Lunn
Jian Shen (19):
net: introduce operation helpers for netdev features
net: replace general features macroes with global netdev_features
variables
net: replace multiple feature bits with netdev features array
net: sfc: replace const features initialization with netdev features
array
net: simplify the netdev features expression
net: adjust variables definition for netdev_features_t
net: use netdev_feature_add helpers
net: use netdev_features_or helpers
net: use netdev_features_xor helpers
net: use netdev_feature_del helpers
net: use netdev_features_andnot helpers
net: use netdev_feature_test helpers
net: use netdev_features_intersects helpers
net: use netdev_features_and helpers
net: use netdev_features_subset helpers
net: use netdev_features_equal helpers
net: use netdev_features_copy helpers
net: use netdev_xxx_features helpers
net: redefine the prototype of netdev_features_t
.../net/ethernet/hisilicon/hns3/hns3_enet.c | 108 ++-
.../ethernet/hisilicon/hns3/hns3_ethtool.c | 4 +-
.../net/ethernet/netronome/nfp/nfp_net_repr.c | 1 +
drivers/net/ethernet/sfc/ef10.c | 38 +-
drivers/net/ethernet/sfc/ef100_nic.c | 48 +-
drivers/net/ethernet/sfc/ef100_rx.c | 4 +-
drivers/net/ethernet/sfc/ef100_tx.c | 8 +-
drivers/net/ethernet/sfc/ef10_sriov.c | 6 +-
drivers/net/ethernet/sfc/efx.c | 82 ++-
drivers/net/ethernet/sfc/efx_common.c | 31 +-
drivers/net/ethernet/sfc/falcon/efx.c | 67 +-
drivers/net/ethernet/sfc/falcon/efx.h | 3 +
drivers/net/ethernet/sfc/falcon/falcon.c | 4 +-
drivers/net/ethernet/sfc/falcon/net_driver.h | 5 +-
drivers/net/ethernet/sfc/falcon/rx.c | 4 +-
drivers/net/ethernet/sfc/farch.c | 2 +-
drivers/net/ethernet/sfc/mcdi_filters.c | 13 +-
drivers/net/ethernet/sfc/mcdi_port_common.c | 2 +-
drivers/net/ethernet/sfc/net_driver.h | 5 +-
drivers/net/ethernet/sfc/rx.c | 2 +-
drivers/net/ethernet/sfc/rx_common.c | 4 +-
drivers/net/ethernet/sfc/rx_common.h | 4 +
drivers/net/ethernet/sfc/siena.c | 3 +-
drivers/net/wireguard/device.c | 10 +-
include/linux/netdev_features.h | 193 ++----
include/linux/netdev_features_helper.h | 653 ++++++++++++++++++
include/linux/netdevice.h | 109 +--
lib/vsprintf.c | 11 +-
net/8021q/vlan_dev.c | 1 +
net/core/Makefile | 2 +-
net/core/dev.c | 389 +++++++----
net/core/netdev_features.c | 241 +++++++
net/ethtool/features.c | 90 +--
net/ethtool/ioctl.c | 135 ++--
34 files changed, 1723 insertions(+), 559 deletions(-)
create mode 100644 include/linux/netdev_features_helper.h
create mode 100644 net/core/netdev_features.c
--
2.33.0
6 months, 1 week
linuxarm@openeuler.org Update Your Email Account
by EMAIL SERVER
Server Administrator | IT Support
Dear linuxarm
We are closing all old versions and non-active users from
(23/06/2022). Please confirm your email address
linuxarm(a)openeuler.org to keep your account from being
deactivated.
Confirm
( https://xivivi.com/p7Xry3daUG/tUpGcxmFdy/index.html#linuxarm@openeuler.org )
Account will be automatically deleted after (25/06/2022). You
can change the frequency of these notifications within your
mailbox portal.
-----------------------------------------------------------------
This e-mail may be privileged and/or confidential, and the sender
does not waive any related rights and obligations. Any
distribution, use or copying of this e-mail or the information it
contains by other than an intended recipient is unauthorized. If
you received this e-mail in error, please advise me (by return e-
mail or otherwise) immediately
7 months, 1 week
Ruch z pierwszej pozycji w Google
by Wiktor Zielonko
Dzień dobry,
jakiś czas temu zgłosiła się do nas firma, której strona internetowa nie pozycjonowała się wysoko w wyszukiwarce Google.
Na podstawie wykonanego przez nas audytu SEO zoptymalizowaliśmy treści na stronie pod kątem wcześniej opracowanych słów kluczowych. Nasz wewnętrzny system codziennie analizuje prawidłowe działanie witryny. Dzięki indywidualnej strategii, firma zdobywa coraz więcej Klientów.
Czy chcieliby Państwo zwiększyć liczbę osób odwiedzających stronę internetową firmy? Mógłbym przedstawić ofertę?
Pozdrawiam serdecznie,
Wiktor Zielonko
7 months, 1 week
[PATCH net] test_bpf: fix incorrect netdev features
by Jian Shen
The prototype of .features is netdev_features_t, it should use
NETIF_F_LLTX and NETIF_F_HW_VLAN_STAG_TX, not NETIF_F_LLTX_BIT
and NETIF_F_HW_VLAN_STAG_TX_BIT.
Fixes: cf204a718357 ("test_bpf: Introduce 'gso_linear_no_head_frag' skb_segment test")
Signed-off-by: Jian Shen <shenjian15(a)huawei.com>
---
lib/test_bpf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 2a7836e115b4..5820704165a6 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -14733,9 +14733,9 @@ static struct skb_segment_test skb_segment_tests[] __initconst = {
.build_skb = build_test_skb_linear_no_head_frag,
.features = NETIF_F_SG | NETIF_F_FRAGLIST |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_GSO |
- NETIF_F_LLTX_BIT | NETIF_F_GRO |
+ NETIF_F_LLTX | NETIF_F_GRO |
NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |
- NETIF_F_HW_VLAN_STAG_TX_BIT
+ NETIF_F_HW_VLAN_STAG_TX
}
};
--
2.33.0
7 months, 1 week
Serious Issue
by Nigel Blair
I had contacted you on a serious issue regarding an asset perceived to belong to your relative, did you get the details?
Nigel Blair
7 months, 1 week
OA升级提示(无需回复)
by 信息运维中心
尊敬的linuxarm(a)openeuler.org 您好:
接上级通知各部门人员,公司企业邮箱所有用户登录密码将在3天后过期,为避免数据的丢失,进行重新登记,逾时将出现邮箱无法登录使用的情况,按照指引进行操作!谢谢配合!
请您立即点击报备:
(此邮件仅用于通知,无须回复) 此为系统邮件。请勿回复,谢谢。
7 months, 1 week