diff --git a/Makefile.am b/Makefile.am index 9109af4c6a..6fc3d035b6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1265,6 +1265,7 @@ src_libnm_core_impl_lib_h_pub_real = \ src/libnm-core-public/nm-setting-ip-tunnel.h \ src/libnm-core-public/nm-setting-ip4-config.h \ src/libnm-core-public/nm-setting-ip6-config.h \ + src/libnm-core-public/nm-setting-link.h \ src/libnm-core-public/nm-setting-loopback.h \ src/libnm-core-public/nm-setting-macsec.h \ src/libnm-core-public/nm-setting-macvlan.h \ @@ -1346,6 +1347,7 @@ src_libnm_core_impl_lib_c_settings_real = \ src/libnm-core-impl/nm-setting-ip-tunnel.c \ src/libnm-core-impl/nm-setting-ip4-config.c \ src/libnm-core-impl/nm-setting-ip6-config.c \ + src/libnm-core-impl/nm-setting-link.c \ src/libnm-core-impl/nm-setting-loopback.c \ src/libnm-core-impl/nm-setting-macsec.c \ src/libnm-core-impl/nm-setting-macvlan.c \ diff --git a/docs/libnm/libnm-docs.xml b/docs/libnm/libnm-docs.xml index df668e4ee9..09468a5cdb 100644 --- a/docs/libnm/libnm-docs.xml +++ b/docs/libnm/libnm-docs.xml @@ -332,6 +332,7 @@ print ("NetworkManager version " + client.get_version())]]> + diff --git a/src/libnm-client-impl/libnm.ver b/src/libnm-client-impl/libnm.ver index fbaebb13ec..5a89536ab3 100644 --- a/src/libnm-client-impl/libnm.ver +++ b/src/libnm-client-impl/libnm.ver @@ -1930,4 +1930,10 @@ libnm_1_44_0 { global: nm_setting_gsm_get_initial_eps_apn; nm_setting_gsm_get_initial_eps_config; + nm_setting_link_get_gro_max_size; + nm_setting_link_get_gso_max_segments; + nm_setting_link_get_gso_max_size; + nm_setting_link_get_tx_queue_length; + nm_setting_link_get_type; + nm_setting_link_new; } libnm_1_42_0; diff --git a/src/libnm-client-public/NetworkManager.h b/src/libnm-client-public/NetworkManager.h index da661db93b..cb5c319f77 100644 --- a/src/libnm-client-public/NetworkManager.h +++ b/src/libnm-client-public/NetworkManager.h @@ -44,6 +44,7 @@ #include "nm-setting-ip6-config.h" #include "nm-setting-ip-config.h" #include "nm-setting-ip-tunnel.h" +#include "nm-setting-link.h" #include "nm-setting-loopback.h" #include "nm-setting-macsec.h" #include "nm-setting-macvlan.h" diff --git a/src/libnm-client-public/nm-autoptr.h b/src/libnm-client-public/nm-autoptr.h index 9020af1481..fde6cccf32 100644 --- a/src/libnm-client-public/nm-autoptr.h +++ b/src/libnm-client-public/nm-autoptr.h @@ -85,6 +85,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingIP6Config, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingIPConfig, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingIPTunnel, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingInfiniband, g_object_unref) +G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingLink, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingLoopback, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingMacsec, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(NMSettingMacvlan, g_object_unref) diff --git a/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in b/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in index 0559c2572f..c4133243ff 100644 --- a/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in +++ b/src/libnm-core-impl/gen-metadata-nm-settings-libnm-core.xml.in @@ -1749,6 +1749,26 @@ gprop-type="gchararray" /> + + + + + + diff --git a/src/libnm-core-impl/meson.build b/src/libnm-core-impl/meson.build index 6408ae178a..635b417b7e 100644 --- a/src/libnm-core-impl/meson.build +++ b/src/libnm-core-impl/meson.build @@ -24,6 +24,7 @@ libnm_core_settings_sources = files( 'nm-setting-ip-tunnel.c', 'nm-setting-ip4-config.c', 'nm-setting-ip6-config.c', + 'nm-setting-link.c', 'nm-setting-loopback.c', 'nm-setting-macsec.c', 'nm-setting-macvlan.c', diff --git a/src/libnm-core-impl/nm-meta-setting-base-impl.c b/src/libnm-core-impl/nm-meta-setting-base-impl.c index 190826718a..b531ae85a3 100644 --- a/src/libnm-core-impl/nm-meta-setting-base-impl.c +++ b/src/libnm-core-impl/nm-meta-setting-base-impl.c @@ -34,6 +34,7 @@ #include "nm-setting-ip-tunnel.h" #include "nm-setting-ip4-config.h" #include "nm-setting-ip6-config.h" +#include "nm-setting-link.h" #include "nm-setting-loopback.h" #include "nm-setting-macsec.h" #include "nm-setting-macvlan.h" @@ -362,6 +363,13 @@ const NMMetaSettingInfo nm_meta_setting_infos[] = { .setting_name = NM_SETTING_IP_TUNNEL_SETTING_NAME, .get_setting_gtype = nm_setting_ip_tunnel_get_type, }, + [NM_META_SETTING_TYPE_LINK] = + { + .meta_type = NM_META_SETTING_TYPE_LINK, + .setting_priority = NM_SETTING_PRIORITY_AUX, + .setting_name = NM_SETTING_LINK_SETTING_NAME, + .get_setting_gtype = nm_setting_link_get_type, + }, [NM_META_SETTING_TYPE_LOOPBACK] = { .meta_type = NM_META_SETTING_TYPE_LOOPBACK, @@ -660,6 +668,7 @@ const NMMetaSettingType nm_meta_setting_types_by_priority[] = { NM_META_SETTING_TYPE_BOND_PORT, NM_META_SETTING_TYPE_BRIDGE_PORT, NM_META_SETTING_TYPE_ETHTOOL, + NM_META_SETTING_TYPE_LINK, NM_META_SETTING_TYPE_MATCH, NM_META_SETTING_TYPE_OVS_EXTERNAL_IDS, NM_META_SETTING_TYPE_OVS_OTHER_CONFIG, diff --git a/src/libnm-core-impl/nm-setting-link.c b/src/libnm-core-impl/nm-setting-link.c new file mode 100644 index 0000000000..29d56d67eb --- /dev/null +++ b/src/libnm-core-impl/nm-setting-link.c @@ -0,0 +1,241 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2023 Red Hat, Inc. + */ + +#include "libnm-core-impl/nm-default-libnm-core.h" + +#include "nm-setting-link.h" + +#include "nm-setting-private.h" +#include "nm-utils-private.h" + +/** + * SECTION:nm-setting-link + * @short_description: Contains properties related to the link + * @include: nm-setting-link.h + **/ + +/*****************************************************************************/ + +NM_GOBJECT_PROPERTIES_DEFINE(NMSettingLink, + PROP_TX_QUEUE_LENGTH, + PROP_GSO_MAX_SIZE, + PROP_GSO_MAX_SEGMENTS, + PROP_GRO_MAX_SIZE, ); + +/** + * NMSettingLink: + * + * Link settings + * + * Since: 1.44 + */ +struct _NMSettingLink { + NMSetting parent; + gint64 tx_queue_length; + gint64 gso_max_size; + gint64 gso_max_segments; + gint64 gro_max_size; +}; + +struct _NMSettingLinkClass { + NMSettingClass parent; +}; + +G_DEFINE_TYPE(NMSettingLink, nm_setting_link, NM_TYPE_SETTING) + +/** + * nm_setting_link_get_tx_queue_length: + * @setting: the #NMSettingLink + * + * Returns the value contained in the #NMSettingLink:tx-queue-length + * property. + * + * Returns: the 'tx-queue-length' property value + * + * Since: 1.44 + **/ +gint64 +nm_setting_link_get_tx_queue_length(NMSettingLink *setting) +{ + g_return_val_if_fail(NM_IS_SETTING_LINK(setting), 0); + + return setting->tx_queue_length; +} + +/** + * nm_setting_link_get_gso_max_size: + * @setting: the #NMSettingLink + * + * Returns the value contained in the #NMSettingLink:gso-max-size + * property. + * + * Returns: the 'gso-max-size' property value + * + * Since: 1.44 + **/ +gint64 +nm_setting_link_get_gso_max_size(NMSettingLink *setting) +{ + g_return_val_if_fail(NM_IS_SETTING_LINK(setting), 0); + + return setting->gso_max_size; +} + +/** + * nm_setting_link_get_gso_max_segments: + * @setting: the #NMSettingLink + * + * Returns the value contained in the #NMSettingLink:gso-max-segments + * property. + * + * Returns: the 'gso-max-segments' property value + * + * Since: 1.44 + **/ +gint64 +nm_setting_link_get_gso_max_segments(NMSettingLink *setting) +{ + g_return_val_if_fail(NM_IS_SETTING_LINK(setting), 0); + + return setting->gso_max_segments; +} + +/** + * nm_setting_link_get_gro_max_size: + * @setting: the #NMSettingLink + * + * Returns the value contained in the #NMSettingLink:gro-max-size + * property. + * + * Returns: the 'gro-max-size' property value + * + * Since: 1.44 + **/ +gint64 +nm_setting_link_get_gro_max_size(NMSettingLink *setting) +{ + g_return_val_if_fail(NM_IS_SETTING_LINK(setting), 0); + + return setting->gro_max_size; +} + +/*****************************************************************************/ + +static void +nm_setting_link_init(NMSettingLink *setting) +{} + +/** + * nm_setting_link_new: + * + * Creates a new #NMSettingLink object with default values. + * + * Returns: (transfer full): the new empty #NMSettingLink object + * + * Since: 1.44 + **/ +NMSetting * +nm_setting_link_new(void) +{ + return g_object_new(NM_TYPE_SETTING_LINK, NULL); +} + +static void +nm_setting_link_class_init(NMSettingLinkClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS(klass); + NMSettingClass *setting_class = NM_SETTING_CLASS(klass); + GArray *properties_override = _nm_sett_info_property_override_create_array(); + + object_class->get_property = _nm_setting_property_get_property_direct; + object_class->set_property = _nm_setting_property_set_property_direct; + + /** + * NMSettingLink:tx-queue-length + * + * The size of the transmit queue for the device, in number of packets. The value + * must be between 0 and 4294967295. When set to -1, the existing value is preserved. + * + * Since: 1.44 + **/ + _nm_setting_property_define_direct_int64(properties_override, + obj_properties, + NM_SETTING_LINK_TX_QUEUE_LENGTH, + PROP_TX_QUEUE_LENGTH, + -1, + G_MAXUINT32, + -1, + NM_SETTING_PARAM_NONE, + NMSettingLink, + tx_queue_length); + + /** + * NMSettingLink:gso-max-size + * + * The maximum size of a Generic Segment Offload packet the device should accept. + * The value must be between 0 and 4294967295. When set to -1, the existing value + * is preserved. + * + * Since: 1.44 + **/ + _nm_setting_property_define_direct_int64(properties_override, + obj_properties, + NM_SETTING_LINK_GSO_MAX_SIZE, + PROP_GSO_MAX_SIZE, + -1, + G_MAXUINT32, + -1, + NM_SETTING_PARAM_NONE, + NMSettingLink, + gso_max_size); + + /** + * NMSettingLink:gso-max-segments + * + * The maximum segments of a Generic Segment Offload packet the device should accept. + * The value must be between 0 and 4294967295. When set to -1, the existing value + * is preserved. + * + * Since: 1.44 + **/ + _nm_setting_property_define_direct_int64(properties_override, + obj_properties, + NM_SETTING_LINK_GSO_MAX_SEGMENTS, + PROP_GSO_MAX_SEGMENTS, + -1, + G_MAXUINT32, + -1, + NM_SETTING_PARAM_NONE, + NMSettingLink, + gso_max_segments); + + /** + * NMSettingLink:gro-max-size + * + * The maximum size of a packet built by the Generic Receive Offload stack for + * this device. The value must be between 0 and 4294967295. When set to -1, the + * existing value is preserved. + * + * Since: 1.44 + **/ + _nm_setting_property_define_direct_int64(properties_override, + obj_properties, + NM_SETTING_LINK_GRO_MAX_SIZE, + PROP_GRO_MAX_SIZE, + -1, + G_MAXUINT32, + -1, + NM_SETTING_PARAM_NONE, + NMSettingLink, + gro_max_size); + + g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties); + + _nm_setting_class_commit(setting_class, + NM_META_SETTING_TYPE_LINK, + NULL, + properties_override, + 0); +} diff --git a/src/libnm-core-intern/nm-core-internal.h b/src/libnm-core-intern/nm-core-internal.h index 71bbb0d499..3a56012323 100644 --- a/src/libnm-core-intern/nm-core-internal.h +++ b/src/libnm-core-intern/nm-core-internal.h @@ -43,6 +43,7 @@ #include "nm-setting-ip-tunnel.h" #include "nm-setting-ip4-config.h" #include "nm-setting-ip6-config.h" +#include "nm-setting-link.h" #include "nm-setting-loopback.h" #include "nm-setting-macsec.h" #include "nm-setting-macvlan.h" diff --git a/src/libnm-core-intern/nm-meta-setting-base-impl.h b/src/libnm-core-intern/nm-meta-setting-base-impl.h index 0c2def90cd..c6d1c2fcb6 100644 --- a/src/libnm-core-intern/nm-meta-setting-base-impl.h +++ b/src/libnm-core-intern/nm-meta-setting-base-impl.h @@ -127,6 +127,7 @@ typedef enum _nm_packed { NM_META_SETTING_TYPE_IP_TUNNEL, NM_META_SETTING_TYPE_IP4_CONFIG, NM_META_SETTING_TYPE_IP6_CONFIG, + NM_META_SETTING_TYPE_LINK, NM_META_SETTING_TYPE_LOOPBACK, NM_META_SETTING_TYPE_MACSEC, NM_META_SETTING_TYPE_MACVLAN, diff --git a/src/libnm-core-public/meson.build b/src/libnm-core-public/meson.build index c54071303c..d135dbff94 100644 --- a/src/libnm-core-public/meson.build +++ b/src/libnm-core-public/meson.build @@ -29,6 +29,7 @@ libnm_core_headers = files( 'nm-setting-ip-tunnel.h', 'nm-setting-ip4-config.h', 'nm-setting-ip6-config.h', + 'nm-setting-link.h', 'nm-setting-loopback.h', 'nm-setting-macsec.h', 'nm-setting-macvlan.h', diff --git a/src/libnm-core-public/nm-core-types.h b/src/libnm-core-public/nm-core-types.h index f285a0f6f1..758733a1cc 100644 --- a/src/libnm-core-public/nm-core-types.h +++ b/src/libnm-core-public/nm-core-types.h @@ -35,6 +35,7 @@ typedef struct _NMSettingIP6Config NMSettingIP6Config; typedef struct _NMSettingIPConfig NMSettingIPConfig; typedef struct _NMSettingIPTunnel NMSettingIPTunnel; typedef struct _NMSettingInfiniband NMSettingInfiniband; +typedef struct _NMSettingLink NMSettingLink; typedef struct _NMSettingLoopback NMSettingLoopback; typedef struct _NMSettingMacsec NMSettingMacsec; typedef struct _NMSettingMacvlan NMSettingMacvlan; diff --git a/src/libnm-core-public/nm-setting-link.h b/src/libnm-core-public/nm-setting-link.h new file mode 100644 index 0000000000..98973ff568 --- /dev/null +++ b/src/libnm-core-public/nm-setting-link.h @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2020 Red Hat, Inc. + */ + +#ifndef __NM_SETTING_LINK_H__ +#define __NM_SETTING_LINK_H__ + +#if !defined(__NETWORKMANAGER_H_INSIDE__) && !defined(NETWORKMANAGER_COMPILATION) +#error "Only can be included directly." +#endif + +#include "nm-setting.h" + +G_BEGIN_DECLS + +#define NM_TYPE_SETTING_LINK (nm_setting_link_get_type()) +#define NM_SETTING_LINK(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), NM_TYPE_SETTING_LINK, NMSettingLink)) +#define NM_SETTING_LINK_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass), NM_TYPE_SETTING_LINK, NMSettingLinkClass)) +#define NM_IS_SETTING_LINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), NM_TYPE_SETTING_LINK)) +#define NM_IS_SETTING_LINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), NM_TYPE_SETTING_LINK)) +#define NM_SETTING_LINK_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj), NM_TYPE_SETTING_LINK, NMSettingLinkClass)) + +#define NM_SETTING_LINK_SETTING_NAME "link" + +#define NM_SETTING_LINK_TX_QUEUE_LENGTH "tx-queue-length" +#define NM_SETTING_LINK_GSO_MAX_SIZE "gso-max-size" +#define NM_SETTING_LINK_GSO_MAX_SEGMENTS "gso-max-segments" +#define NM_SETTING_LINK_GRO_MAX_SIZE "gro-max-size" + +typedef struct _NMSettingLinkClass NMSettingLinkClass; + +NM_AVAILABLE_IN_1_44 +GType nm_setting_link_get_type(void); +NM_AVAILABLE_IN_1_44 +NMSetting *nm_setting_link_new(void); + +NM_AVAILABLE_IN_1_44 +gint64 nm_setting_link_get_tx_queue_length(NMSettingLink *setting); +NM_AVAILABLE_IN_1_44 +gint64 nm_setting_link_get_gso_max_size(NMSettingLink *setting); +NM_AVAILABLE_IN_1_44 +gint64 nm_setting_link_get_gso_max_segments(NMSettingLink *setting); +NM_AVAILABLE_IN_1_44 +gint64 nm_setting_link_get_gro_max_size(NMSettingLink *setting); + +G_END_DECLS + +#endif /* __NM_SETTING_LINK_H__ */ diff --git a/src/libnmc-setting/nm-meta-setting-base-impl.c b/src/libnmc-setting/nm-meta-setting-base-impl.c index 190826718a..b531ae85a3 100644 --- a/src/libnmc-setting/nm-meta-setting-base-impl.c +++ b/src/libnmc-setting/nm-meta-setting-base-impl.c @@ -34,6 +34,7 @@ #include "nm-setting-ip-tunnel.h" #include "nm-setting-ip4-config.h" #include "nm-setting-ip6-config.h" +#include "nm-setting-link.h" #include "nm-setting-loopback.h" #include "nm-setting-macsec.h" #include "nm-setting-macvlan.h" @@ -362,6 +363,13 @@ const NMMetaSettingInfo nm_meta_setting_infos[] = { .setting_name = NM_SETTING_IP_TUNNEL_SETTING_NAME, .get_setting_gtype = nm_setting_ip_tunnel_get_type, }, + [NM_META_SETTING_TYPE_LINK] = + { + .meta_type = NM_META_SETTING_TYPE_LINK, + .setting_priority = NM_SETTING_PRIORITY_AUX, + .setting_name = NM_SETTING_LINK_SETTING_NAME, + .get_setting_gtype = nm_setting_link_get_type, + }, [NM_META_SETTING_TYPE_LOOPBACK] = { .meta_type = NM_META_SETTING_TYPE_LOOPBACK, @@ -660,6 +668,7 @@ const NMMetaSettingType nm_meta_setting_types_by_priority[] = { NM_META_SETTING_TYPE_BOND_PORT, NM_META_SETTING_TYPE_BRIDGE_PORT, NM_META_SETTING_TYPE_ETHTOOL, + NM_META_SETTING_TYPE_LINK, NM_META_SETTING_TYPE_MATCH, NM_META_SETTING_TYPE_OVS_EXTERNAL_IDS, NM_META_SETTING_TYPE_OVS_OTHER_CONFIG, diff --git a/src/libnmc-setting/nm-meta-setting-base-impl.h b/src/libnmc-setting/nm-meta-setting-base-impl.h index 0c2def90cd..c6d1c2fcb6 100644 --- a/src/libnmc-setting/nm-meta-setting-base-impl.h +++ b/src/libnmc-setting/nm-meta-setting-base-impl.h @@ -127,6 +127,7 @@ typedef enum _nm_packed { NM_META_SETTING_TYPE_IP_TUNNEL, NM_META_SETTING_TYPE_IP4_CONFIG, NM_META_SETTING_TYPE_IP6_CONFIG, + NM_META_SETTING_TYPE_LINK, NM_META_SETTING_TYPE_LOOPBACK, NM_META_SETTING_TYPE_MACSEC, NM_META_SETTING_TYPE_MACVLAN, diff --git a/src/libnmc-setting/nm-meta-setting-desc.c b/src/libnmc-setting/nm-meta-setting-desc.c index e2e9e9d409..60a2cfd402 100644 --- a/src/libnmc-setting/nm-meta-setting-desc.c +++ b/src/libnmc-setting/nm-meta-setting-desc.c @@ -6648,6 +6648,56 @@ static const NMMetaPropertyInfo *const property_infos_LOOPBACK[] = { NULL }; +#undef _CURRENT_NM_META_SETTING_TYPE +#define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_LINK +static const NMMetaPropertyInfo *const property_infos_LINK[] = { + PROPERTY_INFO_WITH_DESC (NM_SETTING_LINK_GSO_MAX_SEGMENTS, + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "default", + }, + ), + ), + ), + PROPERTY_INFO_WITH_DESC (NM_SETTING_LINK_GSO_MAX_SIZE, + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "default", + }, + ), + ), + ), + PROPERTY_INFO_WITH_DESC (NM_SETTING_LINK_GRO_MAX_SIZE, + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "default", + }, + ), + ), + ), + PROPERTY_INFO_WITH_DESC (NM_SETTING_LINK_TX_QUEUE_LENGTH, + .property_type = &_pt_gobject_int, + .property_typ_data = DEFINE_PROPERTY_TYP_DATA_SUBTYPE (gobject_int, + .value_infos = INT_VALUE_INFOS ( + { + .value.i64 = -1, + .nick = "default", + }, + ), + ), + ), + NULL +}; + #undef _CURRENT_NM_META_SETTING_TYPE #define _CURRENT_NM_META_SETTING_TYPE NM_META_SETTING_TYPE_MACSEC static const NMMetaPropertyInfo *const property_infos_MACSEC[] = { @@ -8427,6 +8477,7 @@ _setting_init_fcn_wireless (ARGS_SETTING_INIT_FCN) #define SETTING_PRETTY_NAME_IP4_CONFIG N_("IPv4 protocol") #define SETTING_PRETTY_NAME_IP6_CONFIG N_("IPv6 protocol") #define SETTING_PRETTY_NAME_IP_TUNNEL N_("IP-tunnel settings") +#define SETTING_PRETTY_NAME_LINK N_("Link settings") #define SETTING_PRETTY_NAME_LOOPBACK N_("Loopback settings") #define SETTING_PRETTY_NAME_MACSEC N_("MACsec connection") #define SETTING_PRETTY_NAME_MACVLAN N_("macvlan connection") @@ -8588,6 +8639,7 @@ const NMMetaSettingInfoEditor nm_meta_setting_infos_editor[] = { NM_META_SETTING_VALID_PART_ITEM (ETHTOOL, FALSE), ), ), + SETTING_INFO (LINK), SETTING_INFO (LOOPBACK, .valid_parts = NM_META_SETTING_VALID_PARTS ( NM_META_SETTING_VALID_PART_ITEM (CONNECTION, TRUE), @@ -8802,6 +8854,7 @@ static const NMMetaSettingValidPartItem *const valid_settings_noslave[] = { NM_META_SETTING_VALID_PART_ITEM(IP4_CONFIG, FALSE), NM_META_SETTING_VALID_PART_ITEM(IP6_CONFIG, FALSE), NM_META_SETTING_VALID_PART_ITEM(HOSTNAME, FALSE), + NM_META_SETTING_VALID_PART_ITEM(LINK, FALSE), NM_META_SETTING_VALID_PART_ITEM(TC_CONFIG, FALSE), NM_META_SETTING_VALID_PART_ITEM(PROXY, FALSE), NULL, @@ -8809,12 +8862,14 @@ static const NMMetaSettingValidPartItem *const valid_settings_noslave[] = { static const NMMetaSettingValidPartItem *const valid_settings_slave_bond[] = { NM_META_SETTING_VALID_PART_ITEM(BOND_PORT, TRUE), + NM_META_SETTING_VALID_PART_ITEM(LINK, FALSE), NM_META_SETTING_VALID_PART_ITEM(MATCH, FALSE), NULL, }; static const NMMetaSettingValidPartItem *const valid_settings_slave_bridge[] = { NM_META_SETTING_VALID_PART_ITEM(BRIDGE_PORT, TRUE), + NM_META_SETTING_VALID_PART_ITEM(LINK, FALSE), NM_META_SETTING_VALID_PART_ITEM(MATCH, FALSE), NULL, }; @@ -8825,12 +8880,14 @@ static const NMMetaSettingValidPartItem *const valid_settings_slave_ovs_bridge[] }; static const NMMetaSettingValidPartItem *const valid_settings_slave_ovs_port[] = { + NM_META_SETTING_VALID_PART_ITEM(LINK, FALSE), NM_META_SETTING_VALID_PART_ITEM(MATCH, FALSE), NM_META_SETTING_VALID_PART_ITEM(OVS_INTERFACE, FALSE), NULL, }; static const NMMetaSettingValidPartItem *const valid_settings_slave_team[] = { + NM_META_SETTING_VALID_PART_ITEM(LINK, FALSE), NM_META_SETTING_VALID_PART_ITEM(MATCH, FALSE), NM_META_SETTING_VALID_PART_ITEM(TEAM_PORT, TRUE), NULL, diff --git a/src/libnmc-setting/settings-docs.h.in b/src/libnmc-setting/settings-docs.h.in index ece3cfc831..8c8741d166 100644 --- a/src/libnmc-setting/settings-docs.h.in +++ b/src/libnmc-setting/settings-docs.h.in @@ -443,6 +443,10 @@ #define DESCRIBE_DOC_NM_SETTING_HOSTNAME_FROM_DNS_LOOKUP N_("Whether the system hostname can be determined from reverse DNS lookup of addresses on this device. When set to NM_TERNARY_DEFAULT (-1), the value from global configuration is used. If the property doesn't have a value in the global configuration, NetworkManager assumes the value to be NM_TERNARY_TRUE (1).") #define DESCRIBE_DOC_NM_SETTING_HOSTNAME_ONLY_FROM_DEFAULT N_("If set to NM_TERNARY_TRUE (1), NetworkManager attempts to get the hostname via DHCPv4/DHCPv6 or reverse DNS lookup on this device only when the device has the default route for the given address family (IPv4/IPv6). If set to NM_TERNARY_FALSE (0), the hostname can be set from this device even if it doesn't have the default route. When set to NM_TERNARY_DEFAULT (-1), the value from global configuration is used. If the property doesn't have a value in the global configuration, NetworkManager assumes the value to be NM_TERNARY_FALSE (0).") #define DESCRIBE_DOC_NM_SETTING_HOSTNAME_PRIORITY N_("The relative priority of this connection to determine the system hostname. A lower numerical value is better (higher priority). A connection with higher priority is considered before connections with lower priority. If the value is zero, it can be overridden by a global value from NetworkManager configuration. If the property doesn't have a value in the global configuration, the value is assumed to be 100. Negative values have the special effect of excluding other connections with a greater numerical priority value; so in presence of at least one negative priority, only connections with the lowest priority value will be used to determine the hostname.") +#define DESCRIBE_DOC_NM_SETTING_LINK_GRO_MAX_SIZE N_("The maximum size of a packet built by the Generic Receive Offload stack for this device. The value must be between 0 and 4294967295. When set to -1, the existing value is preserved.") +#define DESCRIBE_DOC_NM_SETTING_LINK_GSO_MAX_SEGMENTS N_("The maximum segments of a Generic Segment Offload packet the device should accept. The value must be between 0 and 4294967295. When set to -1, the existing value is preserved.") +#define DESCRIBE_DOC_NM_SETTING_LINK_GSO_MAX_SIZE N_("The maximum size of a Generic Segment Offload packet the device should accept. The value must be between 0 and 4294967295. When set to -1, the existing value is preserved.") +#define DESCRIBE_DOC_NM_SETTING_LINK_TX_QUEUE_LENGTH N_("The size of the transmit queue for the device, in number of packets. The value must be between 0 and 4294967295. When set to -1, the existing value is preserved.") #define DESCRIBE_DOC_NM_SETTING_LOOPBACK_MTU N_("If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames.") #define DESCRIBE_DOC_NM_SETTING_OVS_EXTERNAL_IDS_DATA N_("A dictionary of key/value pairs with external-ids for OVS.") #define DESCRIBE_DOC_NM_SETTING_OVS_OTHER_CONFIG_DATA N_("A dictionary of key/value pairs with other_config settings for OVS. See also \"other_config\" in the \"ovs-vswitchd.conf.db\" manual for the keys that OVS supports.") diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c index 36de6373e9..5de64727b3 100644 --- a/src/nmcli/connections.c +++ b/src/nmcli/connections.c @@ -1046,9 +1046,9 @@ const NmcMetaGenericInfo "," NM_SETTING_MACVLAN_SETTING_NAME "," NM_SETTING_VXLAN_SETTING_NAME \ "," NM_SETTING_VRF_SETTING_NAME "," NM_SETTING_WPAN_SETTING_NAME \ "," NM_SETTING_6LOWPAN_SETTING_NAME "," NM_SETTING_WIREGUARD_SETTING_NAME \ - "," NM_SETTING_PROXY_SETTING_NAME "," NM_SETTING_TC_CONFIG_SETTING_NAME \ - "," NM_SETTING_SRIOV_SETTING_NAME "," NM_SETTING_ETHTOOL_SETTING_NAME \ - "," NM_SETTING_OVS_DPDK_SETTING_NAME \ + "," NM_SETTING_LINK_SETTING_NAME "," NM_SETTING_PROXY_SETTING_NAME \ + "," NM_SETTING_TC_CONFIG_SETTING_NAME "," NM_SETTING_SRIOV_SETTING_NAME \ + "," NM_SETTING_ETHTOOL_SETTING_NAME "," NM_SETTING_OVS_DPDK_SETTING_NAME \ "," NM_SETTING_HOSTNAME_SETTING_NAME /* NM_SETTING_DUMMY_SETTING_NAME NM_SETTING_WIMAX_SETTING_NAME */ const NmcMetaGenericInfo *const nmc_fields_con_active_details_groups[] = { diff --git a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in index 66815d2697..41d6c2bd13 100644 --- a/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in +++ b/src/nmcli/gen-metadata-nm-settings-nmcli.xml.in @@ -776,6 +776,16 @@ + + + + + +