Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wireless: T6425: Fixing VHT beamforming for 802.11ac #3576

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

alainlamar
Copy link
Contributor

Change Summary

  • VHT beamforming support was broken which was fixed.
  • Smoketests were added to detect new bugs on VHT beamforming.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

wireless

Proposed changes

This bugfix addresses errors in the data/templates/wifi/hostapd.conf.j2 template file which prevented correct generation of /run/hostapd/wlanX.conf when VHT beamforming was configured. There was also no smoketest yet to detect such an error. Two tests have been added to this PR to check for correct generation of /run/hostapd/wlanX.conf when VHT beamforming is configured.

How to test

  1. Configure a WiFi interface wlanX using the config below.
  2. Commit your changes.
  • When using mac80211_hwsim, prepare to see an error because simulated WiFi NICs do not support VHT beamforming.
  1. Check /run/hostapd/wlanX.conf
  • Verify this line: vht_capab=[MAX-MPDU-11454][MAX-A-MPDU-LEN-EXP-3][MU-BEAMFORMER][SU-BEAMFORMEE][SU-BEAMFORMER][BF-ANTENNA-2][SOUNDING-DIMENSION-2].
  • Alternatively use the smoketest /usr/libexec/vyos/tests/smoke/cli/test_interfaces_wireless.py.

show interfaces wireless wlanX:

 address 10.255.5.254/24
 capabilities {
     ht {
         channel-set-width ht20
         channel-set-width ht40+
         channel-set-width ht40-
         dsss-cck-40
         short-gi 20
         short-gi 40
     }
     vht {
         antenna-count 3
         beamform multi-user-beamformer
         beamform single-user-beamformee
         beamform single-user-beamformer
         center-channel-freq {
             freq-1 42
         }
         channel-set-width 1
         max-mpdu 11454
         max-mpdu-exp 3
     }
 }
 channel 36
 country-code de
 description "5GHz 802.11ac"
 mode ac
 security {
     wpa {
         mode wpa2
         passphrase secretpassphrase123
     }
 }
 ssid 80211ac-5GHz
 type access-point

Smoketest result

vyos@vyos:~$ /usr/libexec/vyos/tests/smoke/cli/test_interfaces_wireless.py
test_add_multiple_ip_addresses (__main__.WirelessInterfaceTest.test_add_multiple_ip_addresses) ... ok
test_add_single_ip_address (__main__.WirelessInterfaceTest.test_add_single_ip_address) ... ok
test_dhcp_client_options (__main__.WirelessInterfaceTest.test_dhcp_client_options) ... ok
test_dhcp_disable_interface (__main__.WirelessInterfaceTest.test_dhcp_disable_interface) ... ok
test_dhcp_vrf (__main__.WirelessInterfaceTest.test_dhcp_vrf) ... ok
test_dhcpv6_client_options (__main__.WirelessInterfaceTest.test_dhcpv6_client_options) ... ok
test_dhcpv6_vrf (__main__.WirelessInterfaceTest.test_dhcpv6_vrf) ... ok
test_dhcpv6pd_auto_sla_id (__main__.WirelessInterfaceTest.test_dhcpv6pd_auto_sla_id) ... ok
test_dhcpv6pd_manual_sla_id (__main__.WirelessInterfaceTest.test_dhcpv6pd_manual_sla_id) ... ok
test_interface_description (__main__.WirelessInterfaceTest.test_interface_description) ... ok
test_interface_disable (__main__.WirelessInterfaceTest.test_interface_disable) ... ok
test_interface_ip_options (__main__.WirelessInterfaceTest.test_interface_ip_options) ... ok
test_interface_ipv6_options (__main__.WirelessInterfaceTest.test_interface_ipv6_options) ... skipped 'not supported'
test_interface_mtu (__main__.WirelessInterfaceTest.test_interface_mtu) ... skipped 'not supported'
test_ipv6_link_local_address (__main__.WirelessInterfaceTest.test_ipv6_link_local_address) ... skipped 'not supported'
test_mtu_1200_no_ipv6_interface (__main__.WirelessInterfaceTest.test_mtu_1200_no_ipv6_interface) ... skipped 'not supported'
test_span_mirror (__main__.WirelessInterfaceTest.test_span_mirror) ... skipped 'not supported'
test_vif_8021q_interfaces (__main__.WirelessInterfaceTest.test_vif_8021q_interfaces) ... skipped 'not supported'
test_vif_8021q_lower_up_down (__main__.WirelessInterfaceTest.test_vif_8021q_lower_up_down) ... skipped 'not supported'
test_vif_8021q_mtu_limits (__main__.WirelessInterfaceTest.test_vif_8021q_mtu_limits) ... skipped 'not supported'
test_vif_8021q_qos_change (__main__.WirelessInterfaceTest.test_vif_8021q_qos_change) ... skipped 'not supported'
test_vif_s_8021ad_vlan_interfaces (__main__.WirelessInterfaceTest.test_vif_s_8021ad_vlan_interfaces) ... ok
test_vif_s_protocol_change (__main__.WirelessInterfaceTest.test_vif_s_protocol_change) ... ok
test_wireless_access_point_bridge (__main__.WirelessInterfaceTest.test_wireless_access_point_bridge) ... ok
test_wireless_add_single_ip_address (__main__.WirelessInterfaceTest.test_wireless_add_single_ip_address) ... ok
test_wireless_hostapd_config (__main__.WirelessInterfaceTest.test_wireless_hostapd_config) ... ok
test_wireless_hostapd_vht_mu_beamformer_config (__main__.WirelessInterfaceTest.test_wireless_hostapd_vht_mu_beamformer_config) ... ok
test_wireless_hostapd_vht_su_beamformer_config (__main__.WirelessInterfaceTest.test_wireless_hostapd_vht_su_beamformer_config) ... ok
test_wireless_hostapd_wpa_config (__main__.WirelessInterfaceTest.test_wireless_hostapd_wpa_config) ... ok
test_wireless_security_station_address (__main__.WirelessInterfaceTest.test_wireless_security_station_address) ... FAIL

======================================================================
FAIL: test_wireless_security_station_address (__main__.WirelessInterfaceTest.test_wireless_security_station_address)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/libexec/vyos/tests/smoke/cli/test_interfaces_wireless.py", line 434, in test_wireless_security_station_address
    self.assertTrue(process_named_running('hostapd'))
AssertionError: None is not true

----------------------------------------------------------------------
Ran 30 tests in 184.864s

FAILED (failures=1, skipped=9)

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@alainlamar
Copy link
Contributor Author

The smoketest test_wireless_security_station_address is still failing randomly.

I debugged this by making the test write away the generated configuration files just before the failing self.assertTrue(process_named_running('hostapd')). Then, I ran the tests as often until test_wireless_security_station_address failed. I reviewed all three files, copied /tmp/wlan0_station_accept.conf and /tmp/wlan0_station_deny.conf back to /run/hostapd/ and manually started hostapd which worked.

Debugging /usr/libexec/vyos/tests/smoke/cli/test_interfaces_wireless.py:

433         import shutil
434         shutil.copyfile('/run/hostapd/wlan0_station_accept.conf', '/tmp/wlan0_station_accept.conf')
435         shutil.copyfile('/run/hostapd/wlan0_station_deny.conf', '/tmp/wlan0_station_deny.conf')
436         shutil.copyfile('/run/hostapd/wlan0.conf', '/tmp/wlan0-smoketest.conf')
437         # Check for running process
438         self.assertTrue(process_named_running('hostapd'))

Manual run of hostapd:

vyos@vyos:~$ sudo /usr/sbin/hostapd -P /run/hostapd/wlan0.pid /tmp/wlan0-smoketest.conf 
wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
ACS: Automatic channel selection started, this may take a bit
wlan0: interface state COUNTRY_UPDATE->ACS
wlan0: ACS-STARTED 
wlan0: ACS-COMPLETED freq=2412 channel=1
wlan0: interface state ACS->ENABLED
wlan0: AP-ENABLED 

@c-po Do you have an idea how to fix this random failing?

@c-po
Copy link
Member

c-po commented Jun 15, 2024

The smoketest test_wireless_security_station_address is still failing randomly.
...
@c-po Do you have an idea how to fix this random failing?

See Slack conversation

alainlamar and others added 3 commits June 18, 2024 16:56
Commit 9e22ab6 ("wireless: T6318: move country-code to a system wide
configuration") removed the per wifi interface setting for a country-code. This
commit adjust the smoketests to the new design.
Copy link

👍
No issues in PR Title / Commit Title

@c-po c-po merged commit 7de082d into vyos:current Jun 18, 2024
8 checks passed
@c-po
Copy link
Member

c-po commented Jul 22, 2024

@Mergifyio backport circinus sagitta

Copy link
Contributor

mergify bot commented Jul 22, 2024

backport circinus sagitta

✅ Backports have been created

c-po added a commit that referenced this pull request Jul 22, 2024
wireless: T6425: Fixing VHT beamforming for 802.11ac (backport #3576)
sever-sever pushed a commit that referenced this pull request Jul 23, 2024
…#3849)

* wireless: T6425: Fix broken VHT beamforming

(cherry picked from commit f75f0f9)

* wireless: T6425: Add smoketests for VHT beamforming

(cherry picked from commit 578fbe0)

* wireless: T6425: adjust to latest country-code changes

Commit 9e22ab6 ("wireless: T6318: move country-code to a system wide
configuration") removed the per wifi interface setting for a country-code. This
commit adjust the smoketests to the new design.

(cherry picked from commit 312273c)

---------

Co-authored-by: Alain Lamar <alain_lamar@yahoo.de>
Co-authored-by: Christian Breunig <christian@breunig.cc>
@alainlamar alainlamar deleted the T6425 branch September 4, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants