hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/netdev_features.h
....@@ -1,11 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Network device features.
3
- *
4
- *
5
- * This program is free software; you can redistribute it and/or
6
- * modify it under the terms of the GNU General Public License
7
- * as published by the Free Software Foundation; either version
8
- * 2 of the License, or (at your option) any later version.
94 */
105 #ifndef _LINUX_NETDEV_FEATURES_H
116 #define _LINUX_NETDEV_FEATURES_H
....@@ -58,8 +53,9 @@
5853 NETIF_F_GSO_ESP_BIT, /* ... ESP with TSO */
5954 NETIF_F_GSO_UDP_BIT, /* ... UFO, deprecated except tuntap */
6055 NETIF_F_GSO_UDP_L4_BIT, /* ... UDP payload GSO (not UFO) */
56
+ NETIF_F_GSO_FRAGLIST_BIT, /* ... Fraglist GSO */
6157 /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */
62
- NETIF_F_GSO_UDP_L4_BIT,
58
+ NETIF_F_GSO_FRAGLIST_BIT,
6359
6460 NETIF_F_FCOE_CRC_BIT, /* FCoE CRC32 */
6561 NETIF_F_SCTP_CRC_BIT, /* SCTP checksum offload */
....@@ -85,12 +81,15 @@
8581
8682 NETIF_F_GRO_HW_BIT, /* Hardware Generic receive offload */
8783 NETIF_F_HW_TLS_RECORD_BIT, /* Offload TLS record */
84
+ NETIF_F_GRO_FRAGLIST_BIT, /* Fraglist GRO */
85
+
86
+ NETIF_F_HW_MACSEC_BIT, /* Offload MACsec operations */
8887
8988 /*
9089 * Add your fresh new feature above and remember to update
9190 * netdev_features_strings[] in net/ethtool/common.c and maybe
9291 * some feature mask #defines below. Please also describe it
93
- * in Documentation/networking/netdev-features.txt.
92
+ * in Documentation/networking/netdev-features.rst.
9493 */
9594
9695 /**/NETDEV_FEATURE_COUNT
....@@ -155,8 +154,11 @@
155154 #define NETIF_F_GSO_UDP_L4 __NETIF_F(GSO_UDP_L4)
156155 #define NETIF_F_HW_TLS_TX __NETIF_F(HW_TLS_TX)
157156 #define NETIF_F_HW_TLS_RX __NETIF_F(HW_TLS_RX)
157
+#define NETIF_F_GRO_FRAGLIST __NETIF_F(GRO_FRAGLIST)
158
+#define NETIF_F_GSO_FRAGLIST __NETIF_F(GSO_FRAGLIST)
159
+#define NETIF_F_HW_MACSEC __NETIF_F(HW_MACSEC)
158160
159
-/* Finds the next feature with the highest number of the range of start till 0.
161
+/* Finds the next feature with the highest number of the range of start-1 till 0.
160162 */
161163 static inline int find_next_netdev_feature(u64 feature, unsigned long start)
162164 {
....@@ -175,7 +177,7 @@
175177 for ((bit) = find_next_netdev_feature((mask_addr), \
176178 NETDEV_FEATURE_COUNT); \
177179 (bit) >= 0; \
178
- (bit) = find_next_netdev_feature((mask_addr), (bit) - 1))
180
+ (bit) = find_next_netdev_feature((mask_addr), (bit)))
179181
180182 /* Features valid for ethtool to change */
181183 /* = all defined minus driver/device-class-related */
....@@ -191,7 +193,7 @@
191193 #define NETIF_F_GSO_MASK (__NETIF_F_BIT(NETIF_F_GSO_LAST + 1) - \
192194 __NETIF_F_BIT(NETIF_F_GSO_SHIFT))
193195
194
-/* List of IP checksum features. Note that NETIF_F_ HW_CSUM should not be
196
+/* List of IP checksum features. Note that NETIF_F_HW_CSUM should not be
195197 * set in features when NETIF_F_IP_CSUM or NETIF_F_IPV6_CSUM are set--
196198 * this would be contradictory
197199 */
....@@ -231,6 +233,9 @@
231233 /* changeable features with no special hardware requirements */
232234 #define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)
233235
236
+/* Changeable features with no special hardware requirements that defaults to off. */
237
+#define NETIF_F_SOFT_FEATURES_OFF NETIF_F_GRO_FRAGLIST
238
+
234239 #define NETIF_F_VLAN_FEATURES (NETIF_F_HW_VLAN_CTAG_FILTER | \
235240 NETIF_F_HW_VLAN_CTAG_RX | \
236241 NETIF_F_HW_VLAN_CTAG_TX | \