From patchwork Mon Dec 19 12:52:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1717340 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=ItDsFNPx; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=Oi0VBOJD; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NbKQQ4ftdz1ydb for ; Mon, 19 Dec 2022 23:53:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8QDKgBrh0F2mADvuJ95+aNis9BVM+edqxBhYMzjQgyw=; b=ItDsFNPxbmh2J1 grTNINL7Cyps3Fu0m4ofMiNlmd7evI3FRov9VKTqRqMI8NS8MvW2xWmRYtYK3hZSo4TuHnGT8sXMn NFNN4AAh509M2y6l8yisoh/XeD5kzReCYDkG3dxkvSugDwBZ+5+ih1YzDBl0yQ8cfh9HeCYAkLy4H f8lJZgNuuLjAGyro6+fc9aokUkF+s6xb0AW8pZ9gYcb0Tv2sdfhFxj4HhIK2QeeRSvkt7iYdZ1C/O pETfbyJK/WAuSVVIJakoyLrNN15EEoCBznfn9H8pJzkbaDAbLT0LKYncwixX+G4ab1VUTi/3MsWWY wYtNiGcf+NPk+lgpoajg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Fdf-00DOoL-FB; Mon, 19 Dec 2022 12:53:03 +0000 Received: from mga05.intel.com ([192.55.52.43]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Fdb-00DOhn-Bp for hostap@lists.infradead.org; Mon, 19 Dec 2022 12:53:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671454379; x=1702990379; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=JxMM5okq1b6FzTM+++YjfiNTRXAaxELiWMjT+FoQp6k=; b=Oi0VBOJDG0EKSHZm0IBDyQk6CsjQ3EVQii+I9VbdlWktw3MTyZL8zsQK FVEC7NLuL6zgmtLR3lkUYHoD4Nh2jn8zpRqqjhgFurzP1PTNqmyRjeFEF CCWdVS+YneBvkuSng7yvpFbynTghpmZ99kPowalKLdeG1GHNdHXsH16q8 5tqNmNJrjh/8XKXiPT5xiTseIlgV0ICqL9gG7RYXxyI+c99P3Io6DyLgp iYcDTVvKOZV9BBHXkSuAO+mE9wKNBnpK8YwZhvLntBhpgcqMr9kpiFGZi jUeyVhI8PH4VKxJTxD8w3+9s+9puuvupkC4PuKsNSakVMRBX8GNDFsa6g Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="405592944" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="405592944" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:52:55 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="600673421" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="600673421" Received: from yyoseph-mobl1.ger.corp.intel.com (HELO aotchere-desk.intel.com) ([10.255.198.218]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:52:54 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Ayala Beker , Andrei Otcheretianski Subject: [PATCH v2] P2P: Make P2P invitation flow less aggressive Date: Mon, 19 Dec 2022 14:52:38 +0200 Message-Id: <20221219125238.18152-1-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_045259_447627_68CD5FEB X-CRM114-Status: GOOD ( 12.73 ) X-Spam-Score: -2.7 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Ayala Beker 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 i [...] Content analysis details: (-2.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [192.55.52.43 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.2 DKIMWL_WL_HIGH DKIMwl.org - High trust sender X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Ayala Beker 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. Signed-off-by: Ayala Beker Signed-off-by: Andrei Otcheretianski --- src/p2p/p2p.c | 4 +++- src/p2p/p2p_invitation.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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);