The branch main has been updated by bz:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4b6b9c1368b346f7093153d14e7931403ac3202d

commit 4b6b9c1368b346f7093153d14e7931403ac3202d
Author:     Bjoern A. Zeeb <b...@freebsd.org>
AuthorDate: 2025-05-10 01:41:12 +0000
Commit:     Bjoern A. Zeeb <b...@freebsd.org>
CommitDate: 2025-06-03 18:35:10 +0000

    LinuxKPI: netdev features style, annotate, and add %b decoding mask
    
    Start to sort through the netdevice features to match them with
    FreeBSD.  Annotate them a bit more verbose though the names are
    pretty telling already.
    
    While here adjust style(9) as well.
    
    Lastly add the bit definitions for use with printf(9) %b as names
    read easier than bitmasks.  We will use that in LinuxKPI 802.11.
    
    No functional changes.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 .../common/include/linux/netdev_features.h         | 24 +++++++++++++---------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/netdev_features.h 
b/sys/compat/linuxkpi/common/include/linux/netdev_features.h
index 51d2586e8aac..fae82776b071 100644
--- a/sys/compat/linuxkpi/common/include/linux/netdev_features.h
+++ b/sys/compat/linuxkpi/common/include/linux/netdev_features.h
@@ -33,16 +33,20 @@
 
 typedef        uint32_t                netdev_features_t;
 
-#define NETIF_F_HIGHDMA         BIT(0)
-#define NETIF_F_SG              BIT(1)
-#define NETIF_F_IP_CSUM         BIT(2)
-#define NETIF_F_IPV6_CSUM       BIT(3)
-#define NETIF_F_TSO             BIT(4)
-#define NETIF_F_TSO6            BIT(5)
-#define NETIF_F_RXCSUM          BIT(6)
-#define        NETIF_F_HW_CSUM         BIT(7)
-#define        NETIF_F_HW_TC           BIT(8)
+#define        NETIF_F_HIGHDMA         BIT(0)  /* Can DMA to high memory. */
+#define        NETIF_F_SG              BIT(1)  /* Can do scatter/gather I/O. */
+#define        NETIF_F_IP_CSUM         BIT(2)  /* Can csum TCP/UDP on IPv4. */
+#define        NETIF_F_IPV6_CSUM       BIT(3)  /* Can csum TCP/UDP on IPv6. */
+#define        NETIF_F_TSO             BIT(4)  /* Can do TCP over IPv4 
segmentation. */
+#define        NETIF_F_TSO6            BIT(5)  /* Can do TCP over IPv6 
segmentation. */
+#define        NETIF_F_RXCSUM          BIT(6)  /* Can do receive csum offload. 
*/
+#define        NETIF_F_HW_CSUM         BIT(7)  /* Can csum packets (which?). */
+#define        NETIF_F_HW_TC           BIT(8)  /* Can offload TC. */
 
-#define NETIF_F_CSUM_MASK       (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)
+#define        NETIF_F_CSUM_MASK       (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)
+
+#define        NETIF_F_BITS                                                    
\
+   "\20\1HIGHDMA\2SG\3IP_CSUM\4IPV6_CSUM\5TSO\6TSO6\7RXCSUM"           \
+   "\10HW_CSUM\11HW_TC"
 
 #endif /* _LINUXKPI_LINUX_NETDEV_FEATURES_H_ */

Reply via email to