Bug 1257195
| Summary: | teamd fails to respond on aarch64 | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Vitezslav Humpa <vhumpa> |
| Component: | libteam | Assignee: | Marcelo Ricardo Leitner <mleitner> |
| Status: | CLOSED ERRATA | QA Contact: | Amit Supugade <asupugad> |
| Severity: | high | Docs Contact: | |
| Priority: | urgent | ||
| Version: | 7.2 | CC: | asupugad, jklimes, kzhang, lrintel, mleitner, network-qe, vbenes, vhumpa, zhchen |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | aarch64 | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | 1.17-2.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-11-19 03:56:41 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Vitezslav Humpa
2015-08-26 13:01:28 UTC
Yes Vitezslav, please share an access to such system when possible. stracing teamdctl command from comment #0, I get: socket(PF_LOCAL, SOCK_SEQPACKET, 0) = 3 connect(3, {sa_family=AF_LOCAL, sun_path="/var/run/teamd/team0.sock"}, 27) = 0 sendto(3, "REQUEST\nConfigDump\n", 19, MSG_NOSIGNAL, NULL, 0) = 19 pselect6(4, [3], NULL, NULL, {0, 5000000000}, 0) = -1 EINVAL (Invalid argument) write(2, "teamdctl_connect failed (Invalid"..., 43teamdctl_connect failed (Invalid argument) The timeout parameter is invalid, though accepted on other arches. pselect6 uses sec+nanosec resolution. Libteam uses select() flavor (which is converted by glibc later) but which uses sec+microsec. But: libteamdctl/teamdctl_private.h #define TEAMDCTL_REPLY_TIMEOUT 5000 /* ms */ libteamdctl/cli_usock.c #define WAIT_USEC (TEAMDCTL_REPLY_TIMEOUT * 1000) static int cli_usock_wait_recv(int sock) { fd_set rfds; int fdmax; int ret; struct timeval tv; tv.tv_sec = 0; tv.tv_usec = WAIT_USEC; FD_ZERO(&rfds); FD_SET(sock, &rfds); fdmax = sock + 1; ret = select(fdmax, &rfds, NULL, NULL, &tv); That causes tv.tv_usec to be 5*10^6 (or 5s), which is not supposed to happen. Please rebuild the .src.rpm from https://brewweb.devel.redhat.com/taskinfo?taskID=9752664 and try again. Thanks! It has this patch: commit 381983987d7dd01b7e7b12c676fb8f33694f7c36 Author: Marcelo Ricardo Leitner <mleitner> Date: Wed Aug 26 16:23:01 2015 -0300 libteamdctl: fix timeval value for select timeval.tv_usec shouldn't be bigger than 10^6, as then it overlaps .tv_sec. aarch64 currently rejects such value with EINVAL. The fix is to normalize the fields regarding their resolutions. Reported-by: Vitezslav Humpa <vhumpa> Signed-off-by: Marcelo Ricardo Leitner <mleitner> diff --git a/libteamdctl/cli_usock.c b/libteamdctl/cli_usock.c index 0136d6909ea6..0dc97ae53f89 100644 --- a/libteamdctl/cli_usock.c +++ b/libteamdctl/cli_usock.c @@ -79,7 +79,8 @@ static int cli_usock_send(int sock, char *msg) return 0; } -#define WAIT_USEC (TEAMDCTL_REPLY_TIMEOUT * 1000) +#define WAIT_SEC (TEAMDCTL_REPLY_TIMEOUT / 1000) +#define WAIT_USEC (TEAMDCTL_REPLY_TIMEOUT % 1000 * 1000) static int cli_usock_wait_recv(int sock) { @@ -88,7 +89,7 @@ static int cli_usock_wait_recv(int sock) int ret; struct timeval tv; - tv.tv_sec = 0; + tv.tv_sec = WAIT_SEC; tv.tv_usec = WAIT_USEC; FD_ZERO(&rfds); FD_SET(sock, &rfds); I've rebuilt the SRPM on aarch64, and tested the c#0 scenarios + plus some extra usecases via NetworkManager. Works as expected. I have also scheduled a full set of jobs on aarch64, x86_64, s390x and ppc to provide more regression testing. Awesome, thanks. Regression tests on the side of NetworkManager also passed on all archs.
[root@amd-seattle-01 ~]# rpm -q teamd libteam
teamd-1.17-2.el7.aarch64
libteam-1.17-2.el7.aarch64
[root@amd-seattle-01 ~]# teamd -d -t team0
[ 925.872809] team0: Mode changed to "roundrobin"
[root@amd-seattle-01 ~]# teamdctl team0 state
setup:
runner: roundrobin
[root@amd-seattle-01 ~]# ip link set eth0 down
[ 1308.984465] amd-xgbe AMDI8001:00 eth0: Link is Down
[root@amd-seattle-01 ~]# teamdctl team0 port add eth0
[ 1311.014700] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 1311.020610] team0: Port device eth0 added
[root@amd-seattle-01 ~]# [ 1312.012750] amd-xgbe AMDI8001:00 eth0: Link is Up - 1Gbps/Full - flow control off
[ 1312.020232] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[root@amd-seattle-01 ~]# ip link set team0 up
[root@amd-seattle-01 ~]#
[root@amd-seattle-01 ~]# teamdctl team0 state
setup:
runner: roundrobin
ports:
eth0
link watches:
link summary: up
instance[link_watch_0]:
name: ethtool
link: up
down count: 0
[root@amd-seattle-01 ~]#
[root@amd-seattle-01 ~]# teamd -k -t team0
[ 1346.038355] amd-xgbe AMDI8001:00 eth0: Link is Down
[ 1346.044510] team0: Port device eth0 removed
[root@amd-seattle-01 ~]#
[root@amd-seattle-01 ~]# nmcli con add type team
[ 1362.223111] IPv6: ADDRCONF(NETDEV_UP): nm-team: link is not ready
[ 1362.229341] IPv6: ADDRCONF(NETDEV_UP): nm-team: link is not ready
[ 1362.244508] IPv6: ADDRCONF(NETDEV_UP): nm-team: link is not ready
[ 1362.259672] nm-team: Mode changed to "roundrobin"
Connection 'team' (4154f9c0-baf8-44ed-b180-e71056a49f3d) successfully added.
[root@amd-seattle-01 ~]#
[root@amd-seattle-01 ~]# nmcli connection show
NAME UUID TYPE DEVICE
eth0 269932e1-75f3-49d9-9f54-b1ec371eb9f2 802-3-ethernet eth0
eth1 11278af7-6733-47c5-9a59-04dccb84e9ea 802-3-ethernet --
team 4154f9c0-baf8-44ed-b180-e71056a49f3d team --
[root@amd-seattle-01 ~]#
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-2176.html |