From f20710c74c08bf69472f62c886e5bdd5e38c87a5 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 19 Aug 2021 13:37:41 +0100 Subject: [PATCH 1/2] link: Stop prefixing features with "the" --- man/systemd.link.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/man/systemd.link.xml b/man/systemd.link.xml index fe85e1b209..6d8dcb9af7 100644 --- a/man/systemd.link.xml +++ b/man/systemd.link.xml @@ -662,49 +662,49 @@ ReceiveChecksumOffload= - Takes a boolean. If set to true, the hardware offload for checksumming of ingress + Takes a boolean. If set to true, hardware offload for checksumming of ingress network packets is enabled. When unset, the kernel's default will be used. TransmitChecksumOffload= - Takes a boolean. If set to true, the hardware offload for checksumming of egress + Takes a boolean. If set to true, hardware offload for checksumming of egress network packets is enabled. When unset, the kernel's default will be used. TCPSegmentationOffload= - Takes a boolean. If set to true, the TCP Segmentation Offload (TSO) is enabled. + Takes a boolean. If set to true, TCP Segmentation Offload (TSO) is enabled. When unset, the kernel's default will be used. TCP6SegmentationOffload= - Takes a boolean. If set to true, the TCP6 Segmentation Offload (tx-tcp6-segmentation) is enabled. + Takes a boolean. If set to true, TCP6 Segmentation Offload (tx-tcp6-segmentation) is enabled. When unset, the kernel's default will be used. GenericSegmentationOffload= - Takes a boolean. If set to true, the Generic Segmentation Offload (GSO) is enabled. + Takes a boolean. If set to true, Generic Segmentation Offload (GSO) is enabled. When unset, the kernel's default will be used. GenericReceiveOffload= - Takes a boolean. If set to true, the Generic Receive Offload (GRO) is enabled. + Takes a boolean. If set to true, Generic Receive Offload (GRO) is enabled. When unset, the kernel's default will be used. LargeReceiveOffload= - Takes a boolean. If set to true, the Large Receive Offload (LRO) is enabled. + Takes a boolean. If set to true, Large Receive Offload (LRO) is enabled. When unset, the kernel's default will be used. @@ -736,7 +736,7 @@ RxFlowControl= - Takes a boolean. When set, enables the receive flow control, also known as the ethernet + Takes a boolean. When set, enables receive flow control, also known as the ethernet receive PAUSE message (generate and send ethernet PAUSE frames). When unset, the kernel's default will be used. @@ -744,7 +744,7 @@ TxFlowControl= - Takes a boolean. When set, enables the transmit flow control, also known as the ethernet + Takes a boolean. When set, enables transmit flow control, also known as the ethernet transmit PAUSE message (respond to received ethernet PAUSE frames). When unset, the kernel's default will be used. @@ -752,7 +752,7 @@ AutoNegotiationFlowControl= - Takes a boolean. When set, the auto negotiation enables the interface to exchange state + Takes a boolean. When set, auto negotiation enables the interface to exchange state advertisements with the connected peer so that the two devices can agree on the ethernet PAUSE configuration. When unset, the kernel's default will be used. From 8f821d90bfa6769a266294066d5d3ac4091794f3 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 19 Aug 2021 13:44:35 +0100 Subject: [PATCH 2/2] link: Add support for rx-gro-hw nic feature --- man/systemd.link.xml | 7 +++++++ src/shared/ethtool-util.c | 15 ++++++++------- src/shared/ethtool-util.h | 1 + src/udev/net/link-config-gperf.gperf | 1 + test/fuzz/fuzz-link-parser/directives.link | 1 + 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/man/systemd.link.xml b/man/systemd.link.xml index 6d8dcb9af7..638a1522cd 100644 --- a/man/systemd.link.xml +++ b/man/systemd.link.xml @@ -701,6 +701,13 @@ When unset, the kernel's default will be used. + + GenericReceiveOffloadHardware= + + Takes a boolean. If set to true, hardware accelerated Generic Receive Offload (GRO) is + enabled. When unset, the kernel's default will be used. + + LargeReceiveOffload= diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c index 25dc2ba490..c47d819f05 100644 --- a/src/shared/ethtool-util.c +++ b/src/shared/ethtool-util.c @@ -70,13 +70,14 @@ 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_TX] = "tx-checksum-", /* The suffix "-" means any feature beginning with "tx-checksum-" */ - [NET_DEV_FEAT_GSO] = "tx-generic-segmentation", - [NET_DEV_FEAT_GRO] = "rx-gro", - [NET_DEV_FEAT_LRO] = "rx-lro", - [NET_DEV_FEAT_TSO] = "tx-tcp-segmentation", - [NET_DEV_FEAT_TSO6] = "tx-tcp6-segmentation", + [NET_DEV_FEAT_RX] = "rx-checksum", + [NET_DEV_FEAT_TX] = "tx-checksum-", /* The suffix "-" means any feature beginning with "tx-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", }; static const char* const ethtool_link_mode_bit_table[] = { diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h index f1f2a19113..6e18099505 100644 --- a/src/shared/ethtool-util.h +++ b/src/shared/ethtool-util.h @@ -23,6 +23,7 @@ typedef enum NetDevFeature { NET_DEV_FEAT_TX, NET_DEV_FEAT_GSO, NET_DEV_FEAT_GRO, + NET_DEV_FEAT_GRO_HW, NET_DEV_FEAT_LRO, NET_DEV_FEAT_TSO, NET_DEV_FEAT_TSO6, diff --git a/src/udev/net/link-config-gperf.gperf b/src/udev/net/link-config-gperf.gperf index f800de8386..44b46cb17c 100644 --- a/src/udev/net/link-config-gperf.gperf +++ b/src/udev/net/link-config-gperf.gperf @@ -57,6 +57,7 @@ Link.TCPSegmentationOffload, config_parse_tristate, Link.TCP6SegmentationOffload, config_parse_tristate, 0, offsetof(LinkConfig, features[NET_DEV_FEAT_TSO6]) Link.UDPSegmentationOffload, config_parse_warn_compat, DISABLED_LEGACY, 0 Link.GenericReceiveOffload, config_parse_tristate, 0, offsetof(LinkConfig, features[NET_DEV_FEAT_GRO]) +Link.GenericReceiveOffloadHardware, config_parse_tristate, 0, offsetof(LinkConfig, features[NET_DEV_FEAT_GRO_HW]) Link.LargeReceiveOffload, config_parse_tristate, 0, offsetof(LinkConfig, features[NET_DEV_FEAT_LRO]) Link.RxChannels, config_parse_ring_buffer_or_channel, 0, offsetof(LinkConfig, channels.rx) Link.TxChannels, config_parse_ring_buffer_or_channel, 0, offsetof(LinkConfig, channels.tx) diff --git a/test/fuzz/fuzz-link-parser/directives.link b/test/fuzz/fuzz-link-parser/directives.link index 5f232ce698..b5cffb1a27 100644 --- a/test/fuzz/fuzz-link-parser/directives.link +++ b/test/fuzz/fuzz-link-parser/directives.link @@ -36,6 +36,7 @@ TCPSegmentationOffload= TCP6SegmentationOffload= UDPSegmentationOffload= GenericReceiveOffload= +GenericReceiveOffloadHardware= LargeReceiveOffload= RxChannels= TxChannels=