From patchwork Sun Jan 1 12:59:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 1720584 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=) 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 4NlK0G4QBxz23db for ; Mon, 2 Jan 2023 00:02:20 +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=0BE0Wlkz4lZldL80x4VMdYGjSwJjaDxykTsqKjs0nM4=; b=FT8Y3oMtG7Bo3f Eu5Ko/o+ho7RS5LC2R9zpiZBWEote4uI3lGgGMsr4NtLH5et01cHfB5Kg+wS68xc4gv69hhzP30Cd UhLmvT2F5GsnPFezC3w9TQ53MgBiQxKIV6yBaxvxv058Zq5R3SWrxBHuTq/luPsq/SSbS7IxOfmVk eJe66PNNQ8NYMji08IvewG/ud0PG0Bz6w6jjRoCi3TPls70gXREbiaHyKjQUbsm3oiINY/R2jKg9w vdOqxt2p6WPKEKNgaHVow71xTIxOiGmNED0gkrRlLxLdU3aUSoCKyuxYJk56waBYJMmDaoo+yhzBb fVtBf9gcbvQdY/GJNvMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pBxwz-0015C6-I3; Sun, 01 Jan 2023 13:00:29 +0000 Received: from mga18.intel.com ([134.134.136.126]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pBxwt-00150r-Rr for hostap@lists.infradead.org; Sun, 01 Jan 2023 13:00:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672578023; x=1704114023; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=hJwMYlGrhG1Xv2vbYl99nY3b+cWG6PuFSTbTqeopTDs=; b=OR6OfiaQRvjYOoYKY++sb8nmLSy16daQkY5kVFe98Xi4gvUXacXhIPf4 Rr2HMx/whEcm5PGUK5wey05JrFtSI5UbnJcBJU8IZm9YcmXOkoAjKGKhK Q1rH00wcHaq2iZVA8cC3RHGRXsburx0e0868Y3RCVVk+bM8grZ32QBZVh A2BNZZ8Z/5SL+ekI1I2tnRhsI+MH2Y6uS+betLgi16pBDbsS9BmzZeAkQ Um+5e2eLn7nqOzaxawyH7ttauH5lSebgxDmo8Uq8riy9gij0kRN+cvdcG IXSr/NZF2IEGYMdoxHIXVoUKmgCNKmIM51GCwEOC2e/IGlhjj3sWd9ldO g==; X-IronPort-AV: E=McAfee;i="6500,9779,10577"; a="304893378" X-IronPort-AV: E=Sophos;i="5.96,292,1665471600"; d="scan'208";a="304893378" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jan 2023 05:00:01 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10577"; a="796650566" X-IronPort-AV: E=Sophos;i="5.96,292,1665471600"; d="scan'208";a="796650566" Received: from aotchere-desk.jer.intel.com ([10.13.17.53]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jan 2023 04:59:59 -0800 From: Andrei Otcheretianski To: hostap@lists.infradead.org Cc: Ilan Peer , Andrei Otcheretianski Subject: [PATCH] nl80211: Do not clear send_frame_cookie on TX wait expiration Date: Sun, 1 Jan 2023 14:59:49 +0200 Message-Id: <20230101125949.283037-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-20230101_050024_076703_05BBD1BC X-CRM114-Status: GOOD ( 15.42 ) X-Spam-Score: -0.4 (/) 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: Ilan Peer With mac80211 based drivers the NL80211_CMD_FRAME_WAIT_CANCEL can be notified to user space while the driver is still handling the frame. In such cases, when the driver is done handling the frame it w [...] Content analysis details: (-0.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 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: Ilan Peer With mac80211 based drivers the NL80211_CMD_FRAME_WAIT_CANCEL can be notified to user space while the driver is still handling the frame. In such cases, when the driver is done handling the frame it would indicate the frame handling status to mac80211, which would trigger NL80211_CMD_FRAME_TX_STATUS notification to user space. However, the nl80211 driver logic handling for NL80211_CMD_FRAME_WAIT_CANCEL clears the send_frame_cookie, so when the NL80211_CMD_FRAME_TX_STATUS arrives it is being ignored. As a result, wpa_supplicant flows, e.g., P2P GoN confirm transmission etc., are stuck (since Tx wait expiration is not handled by the wpa_supplicant other than in the context of DPP). Fix this issue by not clearing the send_frame_cookie as part of the NL80211_CMD_FRAME_WAIT_CANCEL handling. Signed-off-by: Ilan Peer Signed-off-by: Andrei Otcheretianski --- src/drivers/driver_nl80211_event.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index 29613161b9..c958eb66cc 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -3347,9 +3347,12 @@ static void nl80211_frame_wait_cancel(struct wpa_driver_nl80211_data *drv, (long long unsigned int) cookie, match ? " (match)" : "", drv->send_frame_cookie == cookie ? " (match-saved)" : ""); - if (drv->send_frame_cookie == cookie) - drv->send_frame_cookie = (u64) -1; - if (!match) + + /* + * In case that the cookie matches the saved frame cookie the driver is + * expected to indicate TX status + */ + if (!match || drv->send_frame_cookie == cookie) return; if (i < drv->num_send_frame_cookies - 1)