Message ID | 20221219125238.18152-1-andrei.otcheretianski@intel.com |
---|---|
State | Accepted |
Headers | show |
Series | [v2] P2P: Make P2P invitation flow less aggressive | expand |
On Mon, Dec 19, 2022 at 02:52:38PM +0200, Andrei Otcheretianski wrote: > Currently invitation request wait time is very long and not > needed for sending a single action frame only. > In order to not interfere with other channel activities, > decrease the wait time to to 150ms 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 100ms. This is too aggressive > and may result in missing beacon transmission and affecting GO activity > on its channel. Increase the timeout to 120ms, to allow enough time > for beacon transmission. Thanks, applied.
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index a5a11a8836..d036f56daa 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -4105,9 +4105,11 @@ static void p2p_timeout_invite(struct p2p_data *p2p) /* * Better remain on operating channel instead of listen channel * when running a group. + * Wait 120ms 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_set_timeout(p2p, 0, 100000); + p2p_set_timeout(p2p, 0, 120000); return; } p2p_listen_in_find(p2p, 0); diff --git a/src/p2p/p2p_invitation.c b/src/p2p/p2p_invitation.c index bca5b90963..36ae0259cf 100644 --- a/src/p2p/p2p_invitation.c +++ b/src/p2p/p2p_invitation.c @@ -598,9 +598,12 @@ int p2p_invite_send(struct p2p_data *p2p, struct p2p_device *dev, p2p->pending_action_state = P2P_PENDING_INVITATION_REQUEST; p2p->invite_peer = dev; dev->invitation_reqs++; + + /* In case of an active P2P GO use a shorter wait time */ if (p2p_send_action(p2p, freq, 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"); /* Use P2P find to recover and retry */ p2p_set_timeout(p2p, 0, 0);