From: Yu Watanabe Date: Tue, 14 Sep 2021 13:12:42 +0000 (+0900) Subject: ethtool-util: add more network device features X-Git-Tag: v250-rc1~673^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F20729%2Fhead;p=thirdparty%2Fsystemd.git ethtool-util: add more network device features Then, we can easily add new settings to configure features in .link file. --- diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c index e95ce1a2091..00060abff40 100644 --- a/src/shared/ethtool-util.c +++ b/src/shared/ethtool-util.c @@ -70,15 +70,70 @@ DEFINE_STRING_TABLE_LOOKUP(port, NetDevPort); DEFINE_CONFIG_PARSE_ENUM(config_parse_port, port, NetDevPort, "Failed to parse Port setting"); static const char* const netdev_feature_table[_NET_DEV_FEAT_MAX] = { - [NET_DEV_FEAT_RX] = "rx-checksum", - [NET_DEV_FEAT_GSO] = "tx-generic-segmentation", - [NET_DEV_FEAT_GRO] = "rx-gro", - [NET_DEV_FEAT_GRO_HW] = "rx-gro-hw", - [NET_DEV_FEAT_LRO] = "rx-lro", - [NET_DEV_FEAT_TSO] = "tx-tcp-segmentation", - [NET_DEV_FEAT_TSO6] = "tx-tcp6-segmentation", - - [NET_DEV_FEAT_TX] = "tx-checksum-", /* The suffix "-" means any feature beginning with "tx-checksum-" */ + [NET_DEV_FEAT_SG] = "tx-scatter-gather", + [NET_DEV_FEAT_IP_CSUM] = "tx-checksum-ipv4", + [NET_DEV_FEAT_HW_CSUM] = "tx-checksum-ip-generic", + [NET_DEV_FEAT_IPV6_CSUM] = "tx-checksum-ipv6", + [NET_DEV_FEAT_HIGHDMA] = "highdma", + [NET_DEV_FEAT_FRAGLIST] = "tx-scatter-gather-fraglist", + [NET_DEV_FEAT_HW_VLAN_CTAG_TX] = "tx-vlan-hw-insert", + [NET_DEV_FEAT_HW_VLAN_CTAG_RX] = "rx-vlan-hw-parse", + [NET_DEV_FEAT_HW_VLAN_CTAG_FILTER] = "rx-vlan-filter", + [NET_DEV_FEAT_HW_VLAN_STAG_TX] = "tx-vlan-stag-hw-insert", + [NET_DEV_FEAT_HW_VLAN_STAG_RX] = "rx-vlan-stag-hw-parse", + [NET_DEV_FEAT_HW_VLAN_STAG_FILTER] = "rx-vlan-stag-filter", + [NET_DEV_FEAT_VLAN_CHALLENGED] = "vlan-challenged", + [NET_DEV_FEAT_GSO] = "tx-generic-segmentation", + [NET_DEV_FEAT_LLTX] = "tx-lockless", + [NET_DEV_FEAT_NETNS_LOCAL] = "netns-local", + [NET_DEV_FEAT_GRO] = "rx-gro", + [NET_DEV_FEAT_GRO_HW] = "rx-gro-hw", + [NET_DEV_FEAT_LRO] = "rx-lro", + [NET_DEV_FEAT_TSO] = "tx-tcp-segmentation", + [NET_DEV_FEAT_GSO_ROBUST] = "tx-gso-robust", + [NET_DEV_FEAT_TSO_ECN] = "tx-tcp-ecn-segmentation", + [NET_DEV_FEAT_TSO_MANGLEID] = "tx-tcp-mangleid-segmentation", + [NET_DEV_FEAT_TSO6] = "tx-tcp6-segmentation", + [NET_DEV_FEAT_FSO] = "tx-fcoe-segmentation", + [NET_DEV_FEAT_GSO_GRE] = "tx-gre-segmentation", + [NET_DEV_FEAT_GSO_GRE_CSUM] = "tx-gre-csum-segmentation", + [NET_DEV_FEAT_GSO_IPXIP4] = "tx-ipxip4-segmentation", + [NET_DEV_FEAT_GSO_IPXIP6] = "tx-ipxip6-segmentation", + [NET_DEV_FEAT_GSO_UDP_TUNNEL] = "tx-udp_tnl-segmentation", + [NET_DEV_FEAT_GSO_UDP_TUNNEL_CSUM] = "tx-udp_tnl-csum-segmentation", + [NET_DEV_FEAT_GSO_PARTIAL] = "tx-gso-partial", + [NET_DEV_FEAT_GSO_TUNNEL_REMCSUM] = "tx-tunnel-remcsum-segmentation", + [NET_DEV_FEAT_GSO_SCTP] = "tx-sctp-segmentation", + [NET_DEV_FEAT_GSO_ESP] = "tx-esp-segmentation", + [NET_DEV_FEAT_GSO_UDP_L4] = "tx-udp-segmentation", + [NET_DEV_FEAT_GSO_FRAGLIST] = "tx-gso-list", + [NET_DEV_FEAT_FCOE_CRC] = "tx-checksum-fcoe-crc", + [NET_DEV_FEAT_SCTP_CRC] = "tx-checksum-sctp", + [NET_DEV_FEAT_FCOE_MTU] = "fcoe-mtu", + [NET_DEV_FEAT_NTUPLE] = "rx-ntuple-filter", + [NET_DEV_FEAT_RXHASH] = "rx-hashing", + [NET_DEV_FEAT_RXCSUM] = "rx-checksum", + [NET_DEV_FEAT_NOCACHE_COPY] = "tx-nocache-copy", + [NET_DEV_FEAT_LOOPBACK] = "loopback", + [NET_DEV_FEAT_RXFCS] = "rx-fcs", + [NET_DEV_FEAT_RXALL] = "rx-all", + [NET_DEV_FEAT_HW_L2FW_DOFFLOAD] = "l2-fwd-offload", + [NET_DEV_FEAT_HW_TC] = "hw-tc-offload", + [NET_DEV_FEAT_HW_ESP] = "esp-hw-offload", + [NET_DEV_FEAT_HW_ESP_TX_CSUM] = "esp-tx-csum-hw-offload", + [NET_DEV_FEAT_RX_UDP_TUNNEL_PORT] = "rx-udp_tunnel-port-offload", + [NET_DEV_FEAT_HW_TLS_RECORD] = "tls-hw-record", + [NET_DEV_FEAT_HW_TLS_TX] = "tls-hw-tx-offload", + [NET_DEV_FEAT_HW_TLS_RX] = "tls-hw-rx-offload", + [NET_DEV_FEAT_GRO_FRAGLIST] = "rx-gro-list", + [NET_DEV_FEAT_HW_MACSEC] = "macsec-hw-offload", + [NET_DEV_FEAT_GRO_UDP_FWD] = "rx-udp-gro-forwarding", + [NET_DEV_FEAT_HW_HSR_TAG_INS] = "hsr-tag-ins-offload", + [NET_DEV_FEAT_HW_HSR_TAG_RM] = "hsr-tag-rm-offload", + [NET_DEV_FEAT_HW_HSR_FWD] = "hsr-fwd-offload", + [NET_DEV_FEAT_HW_HSR_DUP] = "hsr-dup-offload", + + [NET_DEV_FEAT_TXCSUM] = "tx-checksum-", /* The suffix "-" means any feature beginning with "tx-checksum-" */ }; static const char* const ethtool_link_mode_bit_table[] = { diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h index 3f225256330..cc065589317 100644 --- a/src/shared/ethtool-util.h +++ b/src/shared/ethtool-util.h @@ -19,16 +19,71 @@ typedef enum Duplex { } Duplex; typedef enum NetDevFeature { - NET_DEV_FEAT_RX, + NET_DEV_FEAT_SG, + NET_DEV_FEAT_IP_CSUM, + NET_DEV_FEAT_HW_CSUM, + NET_DEV_FEAT_IPV6_CSUM, + NET_DEV_FEAT_HIGHDMA, + NET_DEV_FEAT_FRAGLIST, + NET_DEV_FEAT_HW_VLAN_CTAG_TX, + NET_DEV_FEAT_HW_VLAN_CTAG_RX, + NET_DEV_FEAT_HW_VLAN_CTAG_FILTER, + NET_DEV_FEAT_HW_VLAN_STAG_TX, + NET_DEV_FEAT_HW_VLAN_STAG_RX, + NET_DEV_FEAT_HW_VLAN_STAG_FILTER, + NET_DEV_FEAT_VLAN_CHALLENGED, NET_DEV_FEAT_GSO, + NET_DEV_FEAT_LLTX, + NET_DEV_FEAT_NETNS_LOCAL, NET_DEV_FEAT_GRO, NET_DEV_FEAT_GRO_HW, NET_DEV_FEAT_LRO, NET_DEV_FEAT_TSO, + NET_DEV_FEAT_GSO_ROBUST, + NET_DEV_FEAT_TSO_ECN, + NET_DEV_FEAT_TSO_MANGLEID, NET_DEV_FEAT_TSO6, + NET_DEV_FEAT_FSO, + NET_DEV_FEAT_GSO_GRE, + NET_DEV_FEAT_GSO_GRE_CSUM, + NET_DEV_FEAT_GSO_IPXIP4, + NET_DEV_FEAT_GSO_IPXIP6, + NET_DEV_FEAT_GSO_UDP_TUNNEL, + NET_DEV_FEAT_GSO_UDP_TUNNEL_CSUM, + NET_DEV_FEAT_GSO_PARTIAL, + NET_DEV_FEAT_GSO_TUNNEL_REMCSUM, + NET_DEV_FEAT_GSO_SCTP, + NET_DEV_FEAT_GSO_ESP, + NET_DEV_FEAT_GSO_UDP_L4, + NET_DEV_FEAT_GSO_FRAGLIST, + NET_DEV_FEAT_FCOE_CRC, + NET_DEV_FEAT_SCTP_CRC, + NET_DEV_FEAT_FCOE_MTU, + NET_DEV_FEAT_NTUPLE, + NET_DEV_FEAT_RXHASH, + NET_DEV_FEAT_RXCSUM, + NET_DEV_FEAT_NOCACHE_COPY, + NET_DEV_FEAT_LOOPBACK, + NET_DEV_FEAT_RXFCS, + NET_DEV_FEAT_RXALL, + NET_DEV_FEAT_HW_L2FW_DOFFLOAD, + NET_DEV_FEAT_HW_TC, + NET_DEV_FEAT_HW_ESP, + NET_DEV_FEAT_HW_ESP_TX_CSUM, + NET_DEV_FEAT_RX_UDP_TUNNEL_PORT, + NET_DEV_FEAT_HW_TLS_RECORD, + NET_DEV_FEAT_HW_TLS_TX, + NET_DEV_FEAT_HW_TLS_RX, + NET_DEV_FEAT_GRO_FRAGLIST, + NET_DEV_FEAT_HW_MACSEC, + NET_DEV_FEAT_GRO_UDP_FWD, + NET_DEV_FEAT_HW_HSR_TAG_INS, + NET_DEV_FEAT_HW_HSR_TAG_RM, + NET_DEV_FEAT_HW_HSR_FWD, + NET_DEV_FEAT_HW_HSR_DUP, _NET_DEV_FEAT_SIMPLE_MAX, - NET_DEV_FEAT_TX = _NET_DEV_FEAT_SIMPLE_MAX, + NET_DEV_FEAT_TXCSUM = _NET_DEV_FEAT_SIMPLE_MAX, _NET_DEV_FEAT_MAX, _NET_DEV_FEAT_INVALID = -EINVAL, } NetDevFeature; diff --git a/src/udev/net/link-config-gperf.gperf b/src/udev/net/link-config-gperf.gperf index 44b46cb17c0..e3cdaaee050 100644 --- a/src/udev/net/link-config-gperf.gperf +++ b/src/udev/net/link-config-gperf.gperf @@ -50,8 +50,8 @@ Link.Duplex, config_parse_duplex, Link.AutoNegotiation, config_parse_tristate, 0, offsetof(LinkConfig, autonegotiation) Link.WakeOnLan, config_parse_wol, 0, offsetof(LinkConfig, wol) Link.Port, config_parse_port, 0, offsetof(LinkConfig, port) -Link.ReceiveChecksumOffload, config_parse_tristate, 0, offsetof(LinkConfig, features[NET_DEV_FEAT_RX]) -Link.TransmitChecksumOffload, config_parse_tristate, 0, offsetof(LinkConfig, features[NET_DEV_FEAT_TX]) +Link.ReceiveChecksumOffload, config_parse_tristate, 0, offsetof(LinkConfig, features[NET_DEV_FEAT_RXCSUM]) +Link.TransmitChecksumOffload, config_parse_tristate, 0, offsetof(LinkConfig, features[NET_DEV_FEAT_TXCSUM]) Link.GenericSegmentationOffload, config_parse_tristate, 0, offsetof(LinkConfig, features[NET_DEV_FEAT_GSO]) Link.TCPSegmentationOffload, config_parse_tristate, 0, offsetof(LinkConfig, features[NET_DEV_FEAT_TSO]) Link.TCP6SegmentationOffload, config_parse_tristate, 0, offsetof(LinkConfig, features[NET_DEV_FEAT_TSO6])