Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1291598rwn; Thu, 15 Sep 2022 13:23:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM48O97tiZvyZEKwo9XanaB4LZ46pe0hKjm1Dm5dtYiTkEEbV+IIg3Cdfe1pxVO8EeysLAVA X-Received: by 2002:a05:6402:198:b0:442:da5a:6716 with SMTP id r24-20020a056402019800b00442da5a6716mr1322650edv.5.1663273432085; Thu, 15 Sep 2022 13:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663273432; cv=none; d=google.com; s=arc-20160816; b=hr9QpzVEhvLVTAPCcx2YrLAsYSMcffPzBpq3aZhe7YyZ5Z4jwnyWQJfeso72nsLxLU NwhAE52QXFGpTwmuSUHWUfoDu9y80ECzwY/SrgRRkcm3OURpgozQG/rxIs/fFf9EDHQB Fbat+nWq1vAV8g3Ulb8qGe/VrYD15RFdcVM/f9ERkwqIia0m7HNB4RLR/fhDcEs9pN+d 3D7TYaIxTpi2mGG3iZHG2j1wUvV6J7eA3J+pUFf+DsLZ1+Mj/aMSrj4cmBzCX5MlgXU9 LF8lgidupDMHX68t5Eae7/AMuI2ZgM+DcoENfDQCV0wRUZXf4l8T++uIHZcvqobEX4QC 3npw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:dkim-signature:message-id; bh=Y+2cLtkR0GEwsc7Vp+HRX6sMW8EJnZZ0sZC2zPWsmGs=; b=ECtFMwRUTnu4NBoICryWMLCra5Dzyh/xFNkXRA1E/Vk1Szv4bT5FXfV5dI/C8+gBs0 Obe0yR1so5ZIZtAAMV5s4mtKE3cSadvF79vprgUU2TIVKlT+jFnr1T6tZ87oa17VdaAs DZvsXhICADaiR9krBAcpYetmXXvba+IcqDsq4nwPBw0OGc+UljX7zCeZJv4pJhs4fk7h Im14A2iAJPlfkYoCkAQ4zNKwoGTXou26ZU9j40bgui2cWRyAKk4L+B6JwjN2dI24c60W gRw0w9Ta/L8YcUxxzM6Y9BH3KuCT4uu3q8yhLjU/cFVXatIWS/J15vUWyBRRFV3Ud/Pb r/6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wetzel-home.de header.s=wetzel-home header.b=Xvd2fGvK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wetzel-home.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l21-20020a170906795500b0077cecf89064si6492139ejo.512.2022.09.15.13.23.30; Thu, 15 Sep 2022 13:23:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wetzel-home.de header.s=wetzel-home header.b=Xvd2fGvK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wetzel-home.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229539AbiIOT7i (ORCPT + 64 others); Thu, 15 Sep 2022 15:59:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbiIOT7d (ORCPT ); Thu, 15 Sep 2022 15:59:33 -0400 Received: from ns2.wdyn.eu (ns2.wdyn.eu [IPv6:2a03:4000:40:5b2::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3952E2BC0 for ; Thu, 15 Sep 2022 12:59:31 -0700 (PDT) Message-ID: <9e36f219-14a6-8960-a5fd-cb9f708237ed@wetzel-home.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wetzel-home.de; s=wetzel-home; t=1663271968; bh=3oa5pKx1ERRbpxo+mvIkSRt+ZadthXn0ikneQ88LL2I=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=Xvd2fGvKi5TpzoqBAum5JX9t2ECCZUIvqyH8KZco9WVdbfMEgyeSvfo7AjMUqvra3 PAJBRJ4eE2sY1VfsIh3DCumVsnXvRk/pCkjCDETm9cosZ4vEo1xru1zPDR610hGK/Z 7mJA3EVFxscaumezAgCQ1bCK5YNKErz6QNnSu58s= Date: Thu, 15 Sep 2022 21:59:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH] mac80211: Ensure vif queues are operational after start Content-Language: en-US To: Felix Fietkau , linux-wireless@vger.kernel.org Cc: Johannes Berg References: <20220915130946.302803-1-alexander@wetzel-home.de> <26e9ae91-8e13-df45-815c-cb45c1911032@nbd.name> From: Alexander Wetzel In-Reply-To: <26e9ae91-8e13-df45-815c-cb45c1911032@nbd.name> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 15.09.22 18:18, Felix Fietkau wrote: > > On 15.09.22 15:09, Alexander Wetzel wrote: >> Make sure local->queue_stop_reasons and vif.txqs_stopped stay in sync. >> >> When a new vif is created the queues may end up in an inconsistent state >> and be inoperable: >> Communication not using iTXQ will work, allowing to e.g. complete the >> association. But the 4-way handshake will time out. The sta will not >> send out any skbs queued in iTXQs. >> >> All normal attempts to start the queues will fail when reaching this >> state. >> local->queue_stop_reasons will have marked all queues as operational but >> vif.txqs_stopped will still be set, creating an inconsistent internal >> state. >> >> In reality this seems to be race between the mac80211 function >> ieee80211_do_open() setting SDATA_STATE_RUNNING and the >> wake_txqs_tasklet: >> Depending on the driver and the timing the queues may end up to be >> operational or not. >> >> Cc: stable@vger.kernel.org >> Fixes: f856373e2f31 ("wifi: mac80211: do not wake queues on a vif that >> is being stopped") >> Signed-off-by: Alexander Wetzel > > Acked-by: Felix Fietkau > I've got some doubts that my fix is correct... While it fixes the problem in my tests it looks like we'll need another queue restart to get the queues working again. After all IEEE80211_TXQ_STOP_NETIF_TX will not be cleared when it has been set by __ieee80211_stop_queue(). I'll update the patch and skip setting vif.txqs_stopped when SDATA_STATE_RUNNING is not set. Not having IEEE80211_TXQ_STOP_NETIF_TX set looks harmless, having it set when it should less problematic... Alexander