summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-08-09 20:17:02 +0200
committerThomas Haller <thaller@redhat.com>2018-08-10 10:38:19 +0200
commitda109a291c6d219a554578e32c4c0daae6def241 (patch)
treec5b8d0e4909990bff9356a121230708ddd677ba8 /shared
parent9e7c960fadfc166ea27fd17e42d590d1d5bc1b55 (diff)
downloadNetworkManager-da109a291c6d219a554578e32c4c0daae6def241.tar.gz
all/ethtool: add support for all currently supported kernel features
As of upstream kernel v4.18-rc8. Note that we name the features like they are called in ethtool's ioctl API ETH_SS_FEATURES. Except, for features like "tx-gro", which ethtool utility aliases as "gro". So, for those features where ethtool has a built-in, alternative name, we prefer the alias. And again, note that a few aliases of ethtool utility ("sg", "tso", "tx") actually affect more than one underlying kernel feature. Note that 3 kernel features which are announced via ETH_SS_FEATURES are explicitly exluded because kernel marks them as "never_changed": #define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \ NETIF_F_LLTX | NETIF_F_NETNS_LOCAL)
Diffstat (limited to 'shared')
-rw-r--r--shared/nm-ethtool-utils.c78
-rw-r--r--shared/nm-ethtool-utils.h43
2 files changed, 119 insertions, 2 deletions
diff --git a/shared/nm-ethtool-utils.c b/shared/nm-ethtool-utils.c
index a57228040c..d50695ae0e 100644
--- a/shared/nm-ethtool-utils.c
+++ b/shared/nm-ethtool-utils.c
@@ -35,36 +35,114 @@
const NMEthtoolData *const nm_ethtool_data[_NM_ETHTOOL_ID_NUM + 1] = {
/* indexed by NMEthtoolID */
+ ETHT_DATA (FEATURE_ESP_HW_OFFLOAD),
+ ETHT_DATA (FEATURE_ESP_TX_CSUM_HW_OFFLOAD),
+ ETHT_DATA (FEATURE_FCOE_MTU),
ETHT_DATA (FEATURE_GRO),
ETHT_DATA (FEATURE_GSO),
+ ETHT_DATA (FEATURE_HIGHDMA),
+ ETHT_DATA (FEATURE_HW_TC_OFFLOAD),
+ ETHT_DATA (FEATURE_L2_FWD_OFFLOAD),
+ ETHT_DATA (FEATURE_LOOPBACK),
ETHT_DATA (FEATURE_LRO),
ETHT_DATA (FEATURE_NTUPLE),
ETHT_DATA (FEATURE_RX),
ETHT_DATA (FEATURE_RXHASH),
ETHT_DATA (FEATURE_RXVLAN),
+ ETHT_DATA (FEATURE_RX_ALL),
+ ETHT_DATA (FEATURE_RX_FCS),
+ ETHT_DATA (FEATURE_RX_GRO_HW),
+ ETHT_DATA (FEATURE_RX_UDP_TUNNEL_PORT_OFFLOAD),
+ ETHT_DATA (FEATURE_RX_VLAN_FILTER),
+ ETHT_DATA (FEATURE_RX_VLAN_STAG_FILTER),
+ ETHT_DATA (FEATURE_RX_VLAN_STAG_HW_PARSE),
ETHT_DATA (FEATURE_SG),
+ ETHT_DATA (FEATURE_TLS_HW_RECORD),
+ ETHT_DATA (FEATURE_TLS_HW_TX_OFFLOAD),
ETHT_DATA (FEATURE_TSO),
ETHT_DATA (FEATURE_TX),
ETHT_DATA (FEATURE_TXVLAN),
+ ETHT_DATA (FEATURE_TX_CHECKSUM_FCOE_CRC),
+ ETHT_DATA (FEATURE_TX_CHECKSUM_IPV4),
+ ETHT_DATA (FEATURE_TX_CHECKSUM_IPV6),
+ ETHT_DATA (FEATURE_TX_CHECKSUM_IP_GENERIC),
+ ETHT_DATA (FEATURE_TX_CHECKSUM_SCTP),
+ ETHT_DATA (FEATURE_TX_ESP_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_FCOE_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_GRE_CSUM_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_GRE_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_GSO_PARTIAL),
+ ETHT_DATA (FEATURE_TX_GSO_ROBUST),
+ ETHT_DATA (FEATURE_TX_IPXIP4_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_IPXIP6_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_NOCACHE_COPY),
+ ETHT_DATA (FEATURE_TX_SCATTER_GATHER),
+ ETHT_DATA (FEATURE_TX_SCATTER_GATHER_FRAGLIST),
+ ETHT_DATA (FEATURE_TX_SCTP_SEGMENTATION),
ETHT_DATA (FEATURE_TX_TCP6_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_TCP_ECN_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_TCP_MANGLEID_SEGMENTATION),
ETHT_DATA (FEATURE_TX_TCP_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_UDP_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_UDP_TNL_CSUM_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_UDP_TNL_SEGMENTATION),
+ ETHT_DATA (FEATURE_TX_VLAN_STAG_HW_INSERT),
[_NM_ETHTOOL_ID_NUM] = NULL,
};
const guint8 const _by_name[_NM_ETHTOOL_ID_NUM] = {
/* sorted by optname. */
+ NM_ETHTOOL_ID_FEATURE_ESP_HW_OFFLOAD,
+ NM_ETHTOOL_ID_FEATURE_ESP_TX_CSUM_HW_OFFLOAD,
+ NM_ETHTOOL_ID_FEATURE_FCOE_MTU,
NM_ETHTOOL_ID_FEATURE_GRO,
NM_ETHTOOL_ID_FEATURE_GSO,
+ NM_ETHTOOL_ID_FEATURE_HIGHDMA,
+ NM_ETHTOOL_ID_FEATURE_HW_TC_OFFLOAD,
+ NM_ETHTOOL_ID_FEATURE_L2_FWD_OFFLOAD,
+ NM_ETHTOOL_ID_FEATURE_LOOPBACK,
NM_ETHTOOL_ID_FEATURE_LRO,
NM_ETHTOOL_ID_FEATURE_NTUPLE,
NM_ETHTOOL_ID_FEATURE_RX,
+ NM_ETHTOOL_ID_FEATURE_RX_ALL,
+ NM_ETHTOOL_ID_FEATURE_RX_FCS,
+ NM_ETHTOOL_ID_FEATURE_RX_GRO_HW,
+ NM_ETHTOOL_ID_FEATURE_RX_UDP_TUNNEL_PORT_OFFLOAD,
+ NM_ETHTOOL_ID_FEATURE_RX_VLAN_FILTER,
+ NM_ETHTOOL_ID_FEATURE_RX_VLAN_STAG_FILTER,
+ NM_ETHTOOL_ID_FEATURE_RX_VLAN_STAG_HW_PARSE,
NM_ETHTOOL_ID_FEATURE_RXHASH,
NM_ETHTOOL_ID_FEATURE_RXVLAN,
NM_ETHTOOL_ID_FEATURE_SG,
+ NM_ETHTOOL_ID_FEATURE_TLS_HW_RECORD,
+ NM_ETHTOOL_ID_FEATURE_TLS_HW_TX_OFFLOAD,
NM_ETHTOOL_ID_FEATURE_TSO,
NM_ETHTOOL_ID_FEATURE_TX,
+ NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_FCOE_CRC,
+ NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IP_GENERIC,
+ NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IPV4,
+ NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IPV6,
+ NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_SCTP,
+ NM_ETHTOOL_ID_FEATURE_TX_ESP_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_FCOE_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_GRE_CSUM_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_GRE_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_GSO_PARTIAL,
+ NM_ETHTOOL_ID_FEATURE_TX_GSO_ROBUST,
+ NM_ETHTOOL_ID_FEATURE_TX_IPXIP4_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_IPXIP6_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_NOCACHE_COPY,
+ NM_ETHTOOL_ID_FEATURE_TX_SCATTER_GATHER,
+ NM_ETHTOOL_ID_FEATURE_TX_SCATTER_GATHER_FRAGLIST,
+ NM_ETHTOOL_ID_FEATURE_TX_SCTP_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_TCP_ECN_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_TCP_MANGLEID_SEGMENTATION,
NM_ETHTOOL_ID_FEATURE_TX_TCP_SEGMENTATION,
NM_ETHTOOL_ID_FEATURE_TX_TCP6_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_UDP_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_UDP_TNL_CSUM_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_UDP_TNL_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_VLAN_STAG_HW_INSERT,
NM_ETHTOOL_ID_FEATURE_TXVLAN,
};
diff --git a/shared/nm-ethtool-utils.h b/shared/nm-ethtool-utils.h
index 3846450803..5f22a9a06e 100644
--- a/shared/nm-ethtool-utils.h
+++ b/shared/nm-ethtool-utils.h
@@ -29,20 +29,59 @@ typedef enum {
_NM_ETHTOOL_ID_FIRST = 0,
_NM_ETHTOOL_ID_FEATURE_FIRST = _NM_ETHTOOL_ID_FIRST,
- NM_ETHTOOL_ID_FEATURE_GRO = _NM_ETHTOOL_ID_FEATURE_FIRST,
+ NM_ETHTOOL_ID_FEATURE_ESP_HW_OFFLOAD = _NM_ETHTOOL_ID_FEATURE_FIRST,
+ NM_ETHTOOL_ID_FEATURE_ESP_TX_CSUM_HW_OFFLOAD,
+ NM_ETHTOOL_ID_FEATURE_FCOE_MTU,
+ NM_ETHTOOL_ID_FEATURE_GRO,
NM_ETHTOOL_ID_FEATURE_GSO,
+ NM_ETHTOOL_ID_FEATURE_HIGHDMA,
+ NM_ETHTOOL_ID_FEATURE_HW_TC_OFFLOAD,
+ NM_ETHTOOL_ID_FEATURE_L2_FWD_OFFLOAD,
+ NM_ETHTOOL_ID_FEATURE_LOOPBACK,
NM_ETHTOOL_ID_FEATURE_LRO,
NM_ETHTOOL_ID_FEATURE_NTUPLE,
NM_ETHTOOL_ID_FEATURE_RX,
NM_ETHTOOL_ID_FEATURE_RXHASH,
NM_ETHTOOL_ID_FEATURE_RXVLAN,
+ NM_ETHTOOL_ID_FEATURE_RX_ALL,
+ NM_ETHTOOL_ID_FEATURE_RX_FCS,
+ NM_ETHTOOL_ID_FEATURE_RX_GRO_HW,
+ NM_ETHTOOL_ID_FEATURE_RX_UDP_TUNNEL_PORT_OFFLOAD,
+ NM_ETHTOOL_ID_FEATURE_RX_VLAN_FILTER,
+ NM_ETHTOOL_ID_FEATURE_RX_VLAN_STAG_FILTER,
+ NM_ETHTOOL_ID_FEATURE_RX_VLAN_STAG_HW_PARSE,
NM_ETHTOOL_ID_FEATURE_SG,
+ NM_ETHTOOL_ID_FEATURE_TLS_HW_RECORD,
+ NM_ETHTOOL_ID_FEATURE_TLS_HW_TX_OFFLOAD,
NM_ETHTOOL_ID_FEATURE_TSO,
NM_ETHTOOL_ID_FEATURE_TX,
NM_ETHTOOL_ID_FEATURE_TXVLAN,
+ NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_FCOE_CRC,
+ NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IPV4,
+ NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IPV6,
+ NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_IP_GENERIC,
+ NM_ETHTOOL_ID_FEATURE_TX_CHECKSUM_SCTP,
+ NM_ETHTOOL_ID_FEATURE_TX_ESP_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_FCOE_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_GRE_CSUM_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_GRE_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_GSO_PARTIAL,
+ NM_ETHTOOL_ID_FEATURE_TX_GSO_ROBUST,
+ NM_ETHTOOL_ID_FEATURE_TX_IPXIP4_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_IPXIP6_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_NOCACHE_COPY,
+ NM_ETHTOOL_ID_FEATURE_TX_SCATTER_GATHER,
+ NM_ETHTOOL_ID_FEATURE_TX_SCATTER_GATHER_FRAGLIST,
+ NM_ETHTOOL_ID_FEATURE_TX_SCTP_SEGMENTATION,
NM_ETHTOOL_ID_FEATURE_TX_TCP6_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_TCP_ECN_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_TCP_MANGLEID_SEGMENTATION,
NM_ETHTOOL_ID_FEATURE_TX_TCP_SEGMENTATION,
- _NM_ETHTOOL_ID_FEATURE_LAST = NM_ETHTOOL_ID_FEATURE_TX_TCP_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_UDP_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_UDP_TNL_CSUM_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_UDP_TNL_SEGMENTATION,
+ NM_ETHTOOL_ID_FEATURE_TX_VLAN_STAG_HW_INSERT,
+ _NM_ETHTOOL_ID_FEATURE_LAST = NM_ETHTOOL_ID_FEATURE_TX_VLAN_STAG_HW_INSERT,
_NM_ETHTOOL_ID_FEATURE_NUM = (_NM_ETHTOOL_ID_FEATURE_LAST - _NM_ETHTOOL_ID_FEATURE_FIRST + 1),
_NM_ETHTOOL_ID_LAST = _NM_ETHTOOL_ID_FEATURE_LAST,