platform/ethtool: add code to get/set offload features via ethtool
Also, add two more features "tx-tcp-segmentation" and "tx-tcp6-segmentation". There are two reasons for that: - systemd-networkd supports setting these two features, so lets support them too (apparently they are important enough for networkd). - these two features are already implicitly covered by "tso". Like for the "ethtool" program, "tso" is an alias for several actual features. By adding two features that are already also covered by an alias (which sets multiple kernel names at once), we showcase how aliases for the same feature can coexist. In particular, note how setting "tso on tx-tcp6-segmentation off" will behave as one would expect: all 4 tso features covered by the alias are enabled, except that particular one.
This commit is contained in:
@@ -3213,6 +3213,32 @@ NM_UTILS_LOOKUP_STR_DEFINE (nm_platform_link_duplex_type_to_string, NMPlatformLi
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
NMEthtoolFeatureStates *
|
||||
nm_platform_ethtool_get_link_features (NMPlatform *self, int ifindex)
|
||||
{
|
||||
_CHECK_SELF_NETNS (self, klass, netns, NULL);
|
||||
|
||||
g_return_val_if_fail (ifindex > 0, NULL);
|
||||
|
||||
return nmp_utils_ethtool_get_features (ifindex);
|
||||
}
|
||||
|
||||
gboolean
|
||||
nm_platform_ethtool_set_features (NMPlatform *self,
|
||||
int ifindex,
|
||||
const NMEthtoolFeatureStates *features,
|
||||
const NMTernary *requested /* indexed by NMEthtoolID - _NM_ETHTOOL_ID_FEATURE_FIRST */,
|
||||
gboolean do_set /* or reset */)
|
||||
{
|
||||
_CHECK_SELF_NETNS (self, klass, netns, FALSE);
|
||||
|
||||
g_return_val_if_fail (ifindex > 0, FALSE);
|
||||
|
||||
return nmp_utils_ethtool_set_features (ifindex, features, requested, do_set);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
const NMDedupMultiHeadEntry *
|
||||
nm_platform_lookup_all (NMPlatform *platform,
|
||||
NMPCacheIdType cache_id_type,
|
||||
|
Reference in New Issue
Block a user