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

Fix/dpp wpa msg fail #78

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fengming-ye
Copy link
Contributor

ae768f8
[noup] zephyr: remove zephyr wpas monitor socket pair

The socket pair will no longer be used as we will directly filter
and handle msg in wpa_msg_cb for zephyr.

The handler path is short and quick. So it won't hold hostap task.
Saves 4K RAM space and hostap task loops for receiving msg.

ced4ae5
[noup] zephyr: remove zephyr hostapd monitor socket pair

The socket pair will no longer be used as we will directly filter
and handle msg in wpa_msg_cb for zephyr.

The handler path is short and quick. So it won't hold hostap task.
Saves 4K RAM space and hostap task loops for receiving msg.

d0790ee
[noup] zephyr: remove zephyr wpa_msg socket send

Background:
In DPP hostapd will put more than 1K bytes text in multiple
wpa_msg calls in one loop. This will drain hostapd monitor
socket pair and fail. Thus DPP connection will fail.

The monitor socket pair of wpa_supplicant and hostapd are not like
ctrl_iface socket pair, which are used for sending command to
hostap from other tasks. The monitor socket pair is used by wpa_msg
to send messages to attatched ctrl_iface monitors. But in zephyr case,
the monitor is hostap task itself.
This means hostap task is both the sender and receiver task.
So it writes all the wpa_msg text into FIFO and read it in next loop.
So there is risk of draining socket pair FIFO and missing msg.
And the reading socket loop can be omitted by directly handling msg
in wpa_msg_cb.

Linux uses monitor socket pair because hostap is a process and wpa_msg
does cross-process communication.
But zephyr hostap is used as module in the same binary with
zephyr kernel.
So the usage is different and we don't need to use socket pair to
notify ctrl_iface monitors.
As long as we don't do time-consuming process in zephyr_wpa_msg_cb,
it won't affect hostap task.
So the zephyr_wpa_msg_cb will only filter and restore interesting logs,
or raise mgmt events to wifi l2 mgmt task.

Fix:
Remove socket send flow in wpa_msg.
Directly filter and handle text in zephyr_wpa_msg_cb, coding in zephyr
repo.

Background:
In DPP hostapd will put more than 1K bytes text in multiple
wpa_msg calls in one loop. This will drain hostapd monitor
socket pair and fail. Thus DPP connection will fail.

The monitor socket pair of wpa_supplicant and hostapd are not like
ctrl_iface socket pair, which are used for sending command to
hostap from other tasks. The monitor socket pair is used by wpa_msg
to send messages to attatched ctrl_iface monitors. But in zephyr case,
the monitor is hostap task itself.
This means hostap task is both the sender and receiver task.
So it writes all the wpa_msg text into FIFO and read it in next loop.
So there is risk of draining socket pair FIFO and missing msg.
And the reading socket loop can be omitted by directly handling msg
in wpa_msg_cb.

Linux uses monitor socket pair because hostap is a process and wpa_msg
does cross-process communication.
But zephyr hostap is used as module in the same binary with
zephyr kernel.
So the usage is different and we don't need to use socket pair to
notify ctrl_iface monitors.
As long as we don't do time-consuming process in zephyr_wpa_msg_cb,
it won't affect hostap task.
So the zephyr_wpa_msg_cb will only filter and restore interesting logs,
or raise mgmt events to wifi l2 mgmt task.

Fix:
Remove socket send flow in wpa_msg.
Directly filter and handle text in zephyr_wpa_msg_cb, coding in zephyr
repo.

Signed-off-by: Fengming Ye <[email protected]>
The socket pair will no longer be used as we will directly filter
and handle msg in wpa_msg_cb for zephyr.

The handler path is short and quick. So it won't hold hostap task.
Saves 4K RAM space and hostap task loops for receiving msg.

Signed-off-by: Fengming Ye <[email protected]>
The socket pair will no longer be used as we will directly filter
and handle msg in wpa_msg_cb for zephyr.

The handler path is short and quick. So it won't hold hostap task.
Saves 4K RAM space and hostap task loops for receiving msg.

Signed-off-by: Fengming Ye <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant