mirror of
https://github.com/systemd/systemd
synced 2025-09-23 13:54:45 +02:00
Compare commits
No commits in common. "f46ba93944aac3f05211e0d630cdf84955eba2d8" and "f20078df0b568cf365eea8278e98170e59ce2b2d" have entirely different histories.
f46ba93944
...
f20078df0b
@ -691,29 +691,13 @@
|
|||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>RxBufferSize=</varname></term>
|
<term><varname>RxBufferSize=</varname></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Takes an integer. Specifies the maximum number of pending packets in the NIC receive buffer.
|
<para>Takes a integer. Specifies the NIC receive ring buffer size. When unset, the kernel's default will be used.</para>
|
||||||
When unset, the kernel's default will be used.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>RxMiniBufferSize=</varname></term>
|
|
||||||
<listitem>
|
|
||||||
<para>Takes an integer. Specifies the maximum number of pending packets in the NIC mini receive buffer.
|
|
||||||
When unset, the kernel's default will be used.</para>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
<varlistentry>
|
|
||||||
<term><varname>RxJumboBufferSize=</varname></term>
|
|
||||||
<listitem>
|
|
||||||
<para>Takes an integer. Specifies the maximum number of pending packets in the NIC jumbo receive buffer.
|
|
||||||
When unset, the kernel's default will be used.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>TxBufferSize=</varname></term>
|
<term><varname>TxBufferSize=</varname></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Takes an integer. Specifies the maximum number of pending packets in the NIC transmit buffer.
|
<para>Takes a integer. Specifies the NIC transmit ring buffer size. When unset, the kernel's default will be used.</para>
|
||||||
When unset, the kernel's default will be used.</para>
|
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
@ -244,16 +244,10 @@ int efi_set_variable_string(sd_id128_t vendor, const char *name, const char *v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool is_efi_boot(void) {
|
bool is_efi_boot(void) {
|
||||||
static int cache = -1;
|
if (detect_container() > 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (cache < 0) {
|
return access("/sys/firmware/efi/", F_OK) >= 0;
|
||||||
if (detect_container() > 0)
|
|
||||||
cache = false;
|
|
||||||
else
|
|
||||||
cache = access("/sys/firmware/efi/", F_OK) >= 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return cache;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int read_flag(const char *varname) {
|
static int read_flag(const char *varname) {
|
||||||
@ -277,21 +271,11 @@ static int read_flag(const char *varname) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool is_efi_secure_boot(void) {
|
bool is_efi_secure_boot(void) {
|
||||||
static int cache = -1;
|
return read_flag("SecureBoot") > 0;
|
||||||
|
|
||||||
if (cache < 0)
|
|
||||||
cache = read_flag("SecureBoot");
|
|
||||||
|
|
||||||
return cache > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_efi_secure_boot_setup_mode(void) {
|
bool is_efi_secure_boot_setup_mode(void) {
|
||||||
static int cache = -1;
|
return read_flag("SetupMode") > 0;
|
||||||
|
|
||||||
if (cache < 0)
|
|
||||||
cache = read_flag("SetupMode");
|
|
||||||
|
|
||||||
return cache > 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int systemd_efi_options_variable(char **line) {
|
int systemd_efi_options_variable(char **line) {
|
||||||
|
@ -431,24 +431,18 @@ int ethtool_set_nic_buffer_size(int *ethtool_fd, const char *ifname, netdev_ring
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
if (ring->rx_pending_set && ecmd.rx_pending != ring->rx_pending) {
|
if (ring->rx_pending_set) {
|
||||||
ecmd.rx_pending = ring->rx_pending;
|
if (ecmd.rx_pending != ring->rx_pending) {
|
||||||
need_update = true;
|
ecmd.rx_pending = ring->rx_pending;
|
||||||
|
need_update = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ring->rx_mini_pending_set && ecmd.rx_mini_pending != ring->rx_mini_pending) {
|
if (ring->tx_pending_set) {
|
||||||
ecmd.rx_mini_pending = ring->rx_mini_pending;
|
if (ecmd.tx_pending != ring->tx_pending) {
|
||||||
need_update = true;
|
ecmd.tx_pending = ring->tx_pending;
|
||||||
}
|
need_update = true;
|
||||||
|
}
|
||||||
if (ring->rx_jumbo_pending_set && ecmd.rx_jumbo_pending != ring->rx_jumbo_pending) {
|
|
||||||
ecmd.rx_jumbo_pending = ring->rx_jumbo_pending;
|
|
||||||
need_update = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ring->tx_pending_set && ecmd.tx_pending != ring->tx_pending) {
|
|
||||||
ecmd.tx_pending = ring->tx_pending;
|
|
||||||
need_update = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_update) {
|
if (need_update) {
|
||||||
@ -1042,12 +1036,6 @@ int config_parse_nic_buffer_size(const char *unit,
|
|||||||
if (streq(lvalue, "RxBufferSize")) {
|
if (streq(lvalue, "RxBufferSize")) {
|
||||||
ring->rx_pending = k;
|
ring->rx_pending = k;
|
||||||
ring->rx_pending_set = true;
|
ring->rx_pending_set = true;
|
||||||
} else if (streq(lvalue, "RxMiniBufferSize")) {
|
|
||||||
ring->rx_mini_pending = k;
|
|
||||||
ring->rx_mini_pending_set = true;
|
|
||||||
} else if (streq(lvalue, "RxJumboBufferSize")) {
|
|
||||||
ring->rx_jumbo_pending = k;
|
|
||||||
ring->rx_jumbo_pending_set = true;
|
|
||||||
} else if (streq(lvalue, "TxBufferSize")) {
|
} else if (streq(lvalue, "TxBufferSize")) {
|
||||||
ring->tx_pending = k;
|
ring->tx_pending = k;
|
||||||
ring->tx_pending_set = true;
|
ring->tx_pending_set = true;
|
||||||
|
@ -84,13 +84,9 @@ typedef struct netdev_channels {
|
|||||||
|
|
||||||
typedef struct netdev_ring_param {
|
typedef struct netdev_ring_param {
|
||||||
uint32_t rx_pending;
|
uint32_t rx_pending;
|
||||||
uint32_t rx_mini_pending;
|
|
||||||
uint32_t rx_jumbo_pending;
|
|
||||||
uint32_t tx_pending;
|
uint32_t tx_pending;
|
||||||
|
|
||||||
bool rx_pending_set;
|
bool rx_pending_set;
|
||||||
bool rx_mini_pending_set;
|
|
||||||
bool rx_jumbo_pending_set;
|
|
||||||
bool tx_pending_set;
|
bool tx_pending_set;
|
||||||
} netdev_ring_param;
|
} netdev_ring_param;
|
||||||
|
|
||||||
|
@ -59,8 +59,6 @@ Link.OtherChannels, config_parse_channel, 0,
|
|||||||
Link.CombinedChannels, config_parse_channel, 0, offsetof(link_config, channels)
|
Link.CombinedChannels, config_parse_channel, 0, offsetof(link_config, channels)
|
||||||
Link.Advertise, config_parse_advertise, 0, offsetof(link_config, advertise)
|
Link.Advertise, config_parse_advertise, 0, offsetof(link_config, advertise)
|
||||||
Link.RxBufferSize, config_parse_nic_buffer_size, 0, offsetof(link_config, ring)
|
Link.RxBufferSize, config_parse_nic_buffer_size, 0, offsetof(link_config, ring)
|
||||||
Link.RxMiniBufferSize, config_parse_nic_buffer_size, 0, offsetof(link_config, ring)
|
|
||||||
Link.RxJumboBufferSize, config_parse_nic_buffer_size, 0, offsetof(link_config, ring)
|
|
||||||
Link.TxBufferSize, config_parse_nic_buffer_size, 0, offsetof(link_config, ring)
|
Link.TxBufferSize, config_parse_nic_buffer_size, 0, offsetof(link_config, ring)
|
||||||
Link.RxFlowControl, config_parse_tristate, 0, offsetof(link_config, rx_flow_control)
|
Link.RxFlowControl, config_parse_tristate, 0, offsetof(link_config, rx_flow_control)
|
||||||
Link.TxFlowControl, config_parse_tristate, 0, offsetof(link_config, tx_flow_control)
|
Link.TxFlowControl, config_parse_tristate, 0, offsetof(link_config, tx_flow_control)
|
||||||
|
@ -407,7 +407,7 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
|
|||||||
log_warning_errno(r, "Could not set channels of %s: %m", old_name);
|
log_warning_errno(r, "Could not set channels of %s: %m", old_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config->ring.rx_pending_set || config->ring.rx_mini_pending_set || config->ring.rx_jumbo_pending_set || config->ring.tx_pending_set) {
|
if (config->ring.rx_pending_set || config->ring.tx_pending_set) {
|
||||||
r = ethtool_set_nic_buffer_size(&ctx->ethtool_fd, old_name, &config->ring);
|
r = ethtool_set_nic_buffer_size(&ctx->ethtool_fd, old_name, &config->ring);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
log_warning_errno(r, "Could not set ring buffer of %s: %m", old_name);
|
log_warning_errno(r, "Could not set ring buffer of %s: %m", old_name);
|
||||||
|
@ -40,8 +40,6 @@ OtherChannels=
|
|||||||
CombinedChannels=
|
CombinedChannels=
|
||||||
Advertise=
|
Advertise=
|
||||||
RxBufferSize=
|
RxBufferSize=
|
||||||
RxMiniBufferSize=
|
|
||||||
RxJumboBufferSize=
|
|
||||||
TxBufferSize=
|
TxBufferSize=
|
||||||
RxFlowControl=
|
RxFlowControl=
|
||||||
TxFlowControl=
|
TxFlowControl=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user