P2P: Make invitation flow less aggressive

Currently invitation request wait time is very long and not needed for
sending a single Action frame only. To not interfere with other parallel
channel activities, decrease the wait time to to 150 ms in case of an
active P2P GO on the system.

In addition, if a P2P GO tries to invite a client that doesn't respond,
it will attempt to invite again after 100 ms. This is too aggressive and
may result in missing beacon transmission and affecting GO activity on
its operating channel. Increase the timeout to 120 ms, to allow enough
time for beacon transmission.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
Ayala Beker 2022-12-19 14:52:38 +02:00 committed by Jouni Malinen
parent f4a7e2a07c
commit 691f729d5d
2 changed files with 9 additions and 2 deletions

View file

@ -4105,9 +4105,11 @@ static void p2p_timeout_invite(struct p2p_data *p2p)
/* /*
* Better remain on operating channel instead of listen channel * Better remain on operating channel instead of listen channel
* when running a group. * when running a group.
* Wait 120 ms to let the P2P GO to send its beacon on the
* intended TBTT.
*/ */
p2p_dbg(p2p, "Inviting in active GO role - wait on operating channel"); p2p_dbg(p2p, "Inviting in active GO role - wait on operating channel");
p2p_set_timeout(p2p, 0, 100000); p2p_set_timeout(p2p, 0, 120000);
return; return;
} }
p2p_listen_in_find(p2p, 0); p2p_listen_in_find(p2p, 0);

View file

@ -598,9 +598,14 @@ int p2p_invite_send(struct p2p_data *p2p, struct p2p_device *dev,
p2p->pending_action_state = P2P_PENDING_INVITATION_REQUEST; p2p->pending_action_state = P2P_PENDING_INVITATION_REQUEST;
p2p->invite_peer = dev; p2p->invite_peer = dev;
dev->invitation_reqs++; dev->invitation_reqs++;
/* In case of an active P2P GO use a shorter wait time to avoid
* issues if not sending out multiple consecutive Beacon frames. */
if (p2p_send_action(p2p, freq, dev->info.p2p_device_addr, if (p2p_send_action(p2p, freq, dev->info.p2p_device_addr,
p2p->cfg->dev_addr, dev->info.p2p_device_addr, p2p->cfg->dev_addr, dev->info.p2p_device_addr,
wpabuf_head(req), wpabuf_len(req), 500) < 0) { wpabuf_head(req), wpabuf_len(req),
p2p->inv_role == P2P_INVITE_ROLE_ACTIVE_GO ?
150 : 500) < 0) {
p2p_dbg(p2p, "Failed to send Action frame"); p2p_dbg(p2p, "Failed to send Action frame");
/* Use P2P find to recover and retry */ /* Use P2P find to recover and retry */
p2p_set_timeout(p2p, 0, 0); p2p_set_timeout(p2p, 0, 0);