!18 fix an issue about teamd is using 100% cpu usage(of 1 core)
From: @zhangruifang2020 Reviewed-by: @ziyangc Signed-off-by: @ziyangc
This commit is contained in:
commit
fb314a4394
@ -0,0 +1,54 @@
|
|||||||
|
From 61efd6de2fbb8ee077863ee5a355ac3dfd9365b9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Xin Long <lucien.xin@gmail.com>
|
||||||
|
Date: Tue, 1 Sep 2020 13:59:27 +0800
|
||||||
|
Subject: [PATCH] Revert "teamd: Disregard current state when considering port
|
||||||
|
enablement"
|
||||||
|
|
||||||
|
This reverts commit deadb5b715227429a1879b187f5906b39151eca9.
|
||||||
|
|
||||||
|
As Patrick noticed, with that commit, teamd_port_check_enable()
|
||||||
|
would set the team port to the new state unconditionally, which
|
||||||
|
triggers another change message from kernel to userspace, then
|
||||||
|
teamd_port_check_enable() is called again to set the team port
|
||||||
|
to the new state.
|
||||||
|
|
||||||
|
This would go around and around to update the team port state,
|
||||||
|
and even cause teamd to consume 100% cpu.
|
||||||
|
|
||||||
|
As the issue caused by that commit is serious, it has to be
|
||||||
|
reverted. As for the issued fixed by that commit, I would
|
||||||
|
propose a new fix later.
|
||||||
|
|
||||||
|
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
|
||||||
|
---
|
||||||
|
teamd/teamd_per_port.c | 8 ++++++--
|
||||||
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c
|
||||||
|
index 166da57..d429753 100644
|
||||||
|
--- a/teamd/teamd_per_port.c
|
||||||
|
+++ b/teamd/teamd_per_port.c
|
||||||
|
@@ -442,14 +442,18 @@ int teamd_port_check_enable(struct teamd_context *ctx,
|
||||||
|
bool should_enable, bool should_disable)
|
||||||
|
{
|
||||||
|
bool new_enabled_state;
|
||||||
|
+ bool curr_enabled_state;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
if (!teamd_port_present(ctx, tdport))
|
||||||
|
return 0;
|
||||||
|
+ err = teamd_port_enabled(ctx, tdport, &curr_enabled_state);
|
||||||
|
+ if (err)
|
||||||
|
+ return err;
|
||||||
|
|
||||||
|
- if (should_enable)
|
||||||
|
+ if (!curr_enabled_state && should_enable)
|
||||||
|
new_enabled_state = true;
|
||||||
|
- else if (should_disable)
|
||||||
|
+ else if (curr_enabled_state && should_disable)
|
||||||
|
new_enabled_state = false;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
@ -1,12 +1,13 @@
|
|||||||
Name: libteam
|
Name: libteam
|
||||||
Version: 1.31
|
Version: 1.31
|
||||||
Release: 2
|
Release: 3
|
||||||
Summary: User-space counterpart library for team network
|
Summary: User-space counterpart library for team network
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: http://www.libteam.org
|
URL: http://www.libteam.org
|
||||||
Source: http://www.libteam.org/files/libteam-%{version}.tar.gz
|
Source: http://www.libteam.org/files/libteam-%{version}.tar.gz
|
||||||
|
|
||||||
Patch0: libteam-fix-error-options-in-doc.patch
|
Patch0: libteam-fix-error-options-in-doc.patch
|
||||||
|
Patch1: backport-revert-teamd-Disregard-current-state-when-considerin.patch
|
||||||
|
|
||||||
BuildRequires: gcc jansson-devel libdaemon-devel libnl3-devel
|
BuildRequires: gcc jansson-devel libdaemon-devel libnl3-devel
|
||||||
BuildRequires: swig dbus-devel systemd doxygen
|
BuildRequires: swig dbus-devel systemd doxygen
|
||||||
@ -115,6 +116,9 @@ install -p -m 755 utils/bond2team $RPM_BUILD_ROOT%{_bindir}/bond2team
|
|||||||
%{_mandir}/man8/teamnl.8*
|
%{_mandir}/man8/teamnl.8*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Sep 21 2023 zhangruifang <zhangruifang1@h-partners.com> - 1.31-3
|
||||||
|
- fix an issue about teamd is using 100% cpu usage (of 1 core)
|
||||||
|
|
||||||
* Thu Sep 8 2022 yixiangzhike <yixiangzhike007@163.com> - 1.31-2
|
* Thu Sep 8 2022 yixiangzhike <yixiangzhike007@163.com> - 1.31-2
|
||||||
- fix error options in doc
|
- fix error options in doc
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user