diff options
author | Susant Sahani <ssahani@users.noreply.github.com> | 2016-08-30 20:22:04 +0530 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-08-30 16:52:04 +0200 |
commit | 50725d10e3417fd357abe1df2f177b8458027ac7 (patch) | |
tree | 4f047ea153910172de4f2e782b4ad5ef6f2fd587 /src/udev/net/link-config.c | |
parent | a908cf0a126a332a209670ad5c769efa231fd002 (diff) |
link : add support to configure Offload features (#4017)
This patch supports these features to be on or off
Generic Segmentation Offload
TCP Segmentation Offload
UDP Segmentation Offload
fixes #432
Diffstat (limited to 'src/udev/net/link-config.c')
-rw-r--r-- | src/udev/net/link-config.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index c66504102f..eedd94e777 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -168,6 +168,8 @@ static int load_link(link_config_ctx *ctx, const char *filename) { link->wol = _WOL_INVALID; link->duplex = _DUP_INVALID; + memset(&link->features, -1, _NET_DEV_FEAT_MAX); + r = config_parse(NULL, filename, file, "Match\0Link\0Ethernet\0", config_item_perf_lookup, link_config_gperf_lookup, @@ -397,6 +399,10 @@ int link_config_apply(link_config_ctx *ctx, link_config *config, log_warning_errno(r, "Could not set WakeOnLan of %s to %s: %m", old_name, wol_to_string(config->wol)); + r = ethtool_set_features(&ctx->ethtool_fd, old_name, config->features); + if (r < 0) + log_warning_errno(r, "Could not set offload features of %s: %m", old_name); + ifindex = udev_device_get_ifindex(device); if (ifindex <= 0) { log_warning("Could not find ifindex"); |