Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15:Update
libteam
teamd-config-update-local-prio-to-kernel.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File teamd-config-update-local-prio-to-kernel.patch of Package libteam
From 656db4394c33bccc6a5ed31fe1d719cc07d0b6da Mon Sep 17 00:00:00 2001 From: Hangbin Liu <liuhangbin@gmail.com> Date: Mon, 7 Jan 2019 15:58:49 +0800 Subject: [PATCH] teamd: config: update local prio to kernel Team port's priority will affect the active port selection. Update the local config is not enough. We also need to update kernel configs. Reported-by: Liang Li <liali@redhat.com> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> --- teamd/teamd_config.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/teamd/teamd_config.c b/teamd/teamd_config.c index 94158ce..69b25de 100644 --- a/teamd/teamd_config.c +++ b/teamd/teamd_config.c @@ -155,6 +155,31 @@ errout: return err; } +static int teamd_config_port_set(struct teamd_context *ctx, const char *port_name, + json_t *port_obj) +{ + struct teamd_port *tdport; + json_t *config; + int tmp, err; + + tdport = teamd_get_port_by_ifname(ctx, port_name); + if (!tdport) + return -ENODEV; + + config = json_object_get(port_obj, "prio"); + if (json_is_integer(config)) { + tmp = json_integer_value(config); + err = team_set_port_priority(ctx->th, tdport->ifindex, tmp); + if (err) { + teamd_log_err("%s: Failed to set \"priority\".", + tdport->ifname); + return err; + } + } + + return 0; +} + int teamd_config_port_update(struct teamd_context *ctx, const char *port_name, const char *json_port_cfg_str) { @@ -184,6 +209,13 @@ int teamd_config_port_update(struct teamd_context *ctx, const char *port_name, if (err) teamd_log_err("%s: Failed to update existing config " "port object", port_name); + else { + err = teamd_config_port_set(ctx, port_name, port_new_obj); + if (err) + teamd_log_err("%s: Failed to update config to kernel", + port_name); + } + new_port_decref: json_decref(port_new_obj); return err; -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor