Summary: | wpa_supplicant(8): CPU% is high and can't associate with wireless network | ||
---|---|---|---|
Product: | Base System | Reporter: | shu <ankohuu> |
Component: | kern | Assignee: | Cy Schubert <cy> |
Status: | Closed FIXED | ||
Severity: | Affects Many People | CC: | cy, david, dhw, lwhsu |
Priority: | --- | ||
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
shu
2021-01-20 04:41:49 UTC
I have this symptom as well, and note that issuing "service netif restart wlan0" (manually) after wpa_supplicant' CPU utilization goes high appears to allow wlan0 (iwn(4), in my case) to work. Do you or anyone subscribed to this PR have wlan0 as a member of a lagg, e.g. lagg0? I do not (have wlan0 as a member of a LAGG). (I tried it for a while a couple of years ago, with em0, but the wireless & wired networks (at work) were quite separate, so I'd lose connections to other machines, which is a lot of what I do with the laptop. So I stopped trying to use LAGG.) I note, too, that I actually normally run stable/12 on this laptop, and do not see the problem while doing that. It's only when I boot to head (as I track both stable/12 and head daily) that I see the issue. For reference, here are the last couple of uname strings for stable/12: FreeBSD g1-55.catwhisker.org 12.2-STABLE FreeBSD 12.2-STABLE #934 stable/12-c243240-g369a4023e67: Tue Jan 19 03:33:41 PST 2021 root@g1-55.catwhisker.org:/common/S1/obj/usr/src/amd64.amd64/sys/CANARY amd64 1202505 1202505 FreeBSD g1-55.catwhisker.org 12.2-STABLE FreeBSD 12.2-STABLE #935 stable/12-c243244-g7033fd68f7e: Wed Jan 20 03:34:45 PST 2021 root@g1-55.catwhisker.org:/common/S1/obj/usr/src/amd64.amd64/sys/CANARY amd64 1202505 1202505 and head: FreeBSD localhost 13.0-ALPHA1 FreeBSD 13.0-ALPHA1 #127 main-c256109-gc987d6a67766-dirty: Tue Jan 19 05:05:12 PST 2021 root@g1-55.catwhisker.org:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY amd64 1300136 1300136 FreeBSD g1-55.catwhisker.org 13.0-ALPHA1 FreeBSD 13.0-ALPHA1 #128 bc7ee8e5bc55-dirty: Wed Jan 20 04:42:20 PST 2021 root@localhost:/common/S4/obj/usr/src/amd64.amd64/sys/CANARY amd64 1300136 1300136 I was only able to reproduce the problem when wlan0 was a member of lagg0. However the patch does fix that issue. Looks good. I'll commit it and create a pull request to our upstream hostap. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=d70886d063166786ded0007af8cdcbf57b7b4827 commit d70886d063166786ded0007af8cdcbf57b7b4827 Author: Cy Schubert <cy@FreeBSD.org> AuthorDate: 2021-01-20 15:20:22 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2021-01-20 15:45:18 +0000 wpa_supplicant uses PF_ROUTE to return the routing table in order to determine the length of the routing table buffer. As of 81728a538d24 wpa_supplicant is started before the routing table has been populated resulting in the length of zero to be returned. This causes wpa_supplicant to loop endlessly. (The workaround is to kill and restart wpa_supplicant as by the time it is restarted the routing table is populated.) (Personally, I was not able to reproduce this unless wlan0 was a member of lagg0. However, others experienced this problem on standalone wlan0.) PR: 252844 Submitted by: shu <ankohuu _ outlook.com> Reported by: shu <ankohuu _ outlook.com> Reviewed by: cy X-MFC with: 81728a538d24f483d0986850fa3f51d5d84d8f26 Differential Revision: https://reviews.freebsd.org/D28249 contrib/wpa/src/drivers/driver_bsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Committed. Thanks. A commit references this bug: Author: cy Date: Wed Jan 20 17:14:17 UTC 2021 New revision: 562150 URL: https://svnweb.freebsd.org/changeset/ports/562150 Log: This is the ports version of src commit d70886d063166786ded0007af8cdcbf57b7b4827. wpa_supplicant uses PF_ROUTE to return the routing table in order to determine the length of the routing table buffer. As of 81728a538d24 wpa_supplicant is started before the routing table has been populated resulting in the length of zero to be returned. This causes wpa_supplicant to loop endlessly. (The workaround is to kill and restart wpa_supplicant as by the time it is restarted the routing table is populated.) (Personally, I was not able to reproduce this unless wlan0 was a member of lagg0. However, others experienced this problem on standalone wlan0.) PR: 252844 Submitted by: shu <ankohuu _ outlook.com> Reported by: shu <ankohuu _ outlook.com> Reviewed by: cy Differential Revision: https://reviews.freebsd.org/D28249 Changes: head/net/hostapd/Makefile head/net/hostapd/files/patch-src_drivers_driver__bsd.c head/security/wpa_supplicant/Makefile head/security/wpa_supplicant/files/patch-src_drivers_driver__bsd.c |