From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6392DC4332F for ; Tue, 18 Jan 2022 23:17:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350244AbiARXRM (ORCPT ); Tue, 18 Jan 2022 18:17:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350210AbiARXRM (ORCPT ); Tue, 18 Jan 2022 18:17:12 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E94BCC061574; Tue, 18 Jan 2022 15:17:11 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id 25-20020a05600c231900b003497473a9c4so9725748wmo.5; Tue, 18 Jan 2022 15:17:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hpNABAszGuVpxLc3lpQ79Hz8gFpkuzCxa0RSxtlG1RI=; b=BRDNqNxZHOXG+8Jt349mcRICKlSguBVuby+UM69nKn+t+QlSDIi0xTcFkc+DFhzX/v 8roefkeaDTpQOW5qvWEkmU2uXDtfmI+lAzWztLwXi+M7elCLe4AZ/0yKTVeL+YXVnTYP xv+dB6BI2Tn6eXNGOCx+eIogqGd2qgW1P9iuzulZVUOcDiMqqkDyjZu7MTJXnesLnDzH sXPw0HmZC4NLlwV2gPkhSWXcwi5AbPeOoKXVIZG/6xVECU/tvJSvXkxiwumF6TzMvNSn UmTPqHLxLCwcnoB4bCJTCu58hdqvdKgRZB5Eq8S01lYMG2Jdj9huNjo+6nJU+YV5yviE h16Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hpNABAszGuVpxLc3lpQ79Hz8gFpkuzCxa0RSxtlG1RI=; b=xcKT1eGgmmmnRxhWelEga6zhJmmNd7apUnzPxfXzTs8sU+5EgW+9S/2+UXGZSBL/44 +5WTJMsQcgejeKW9nph7b3dQi4XO4ZBjl87Ux3BYStoPIL2KScU4cf2UAivHL3MSY4wL bYzjq33SJi2t43s5Lql98985NdECzr3oAeeEMRDLyi8BboPwQPLdsaRIxMIOEZAYFbeF sIRtTSUG7Wl63x3G+Li9urvzRt6kEBCeD/BKykEvDllziugfmhnUY3JyVrh7t0zEvD+E AsYGRT4zIT0puv5In3ck464ifQp/0RTyPaJNheiWwtO4/cbPc7XdiNArOnFe1XLoLFlX yC6A== X-Gm-Message-State: AOAM530Q2ZUuu3LafysxaubLnwtq7TBm2rEmV4wKgcfksOzJ8oxeTuro vnYTQVCmm1BBaZ1eaagTk41R9cPssfbhLHk3DXc= X-Google-Smtp-Source: ABdhPJzlelPa9D9XssWdoFH+QStXJsK6EOXHLzDiIHOmXJ/Jy+KMDXjAe4ukSDLgVMib63OKAI8GBWzORyOrUEMo1s0= X-Received: by 2002:adf:d1c7:: with SMTP id b7mr20769142wrd.81.1642547830541; Tue, 18 Jan 2022 15:17:10 -0800 (PST) MIME-Version: 1.0 References: <20220117115440.60296-1-miquel.raynal@bootlin.com> <20220117115440.60296-28-miquel.raynal@bootlin.com> <20220118191429.19ea3c7d@xps13> In-Reply-To: <20220118191429.19ea3c7d@xps13> From: Alexander Aring Date: Tue, 18 Jan 2022 18:16:59 -0500 Message-ID: Subject: Re: [PATCH v3 27/41] net: mac802154: Introduce a tx queue flushing mechanism To: Miquel Raynal Cc: Stefan Schmidt , linux-wpan - ML , "open list:NETWORKING [GENERAL]" , "linux-wireless@vger.kernel.org Wireless" , David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Michael Hennerich , Jakub Kicinski , Varka Bhadram , Xue Liu , Alan Ott , Thomas Petazzoni Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Hi, On Tue, 18 Jan 2022 at 13:14, Miquel Raynal wrote: > > Hi Alexander, > > alex.aring@gmail.com wrote on Mon, 17 Jan 2022 17:43:49 -0500: > > > Hi, > > > > On Mon, 17 Jan 2022 at 06:55, Miquel Raynal wrote: > > ... > > > > > > /* stop hardware - this must stop RX */ > > > diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h > > > index 0291e49058f2..37d5438fdb3f 100644 > > > --- a/net/mac802154/ieee802154_i.h > > > +++ b/net/mac802154/ieee802154_i.h > > > @@ -122,6 +122,7 @@ extern struct ieee802154_mlme_ops mac802154_mlme_wpan; > > > > > > void ieee802154_rx(struct ieee802154_local *local, struct sk_buff *skb); > > > void ieee802154_xmit_sync_worker(struct work_struct *work); > > > +void ieee802154_sync_tx(struct ieee802154_local *local); > > > netdev_tx_t > > > ieee802154_monitor_start_xmit(struct sk_buff *skb, struct net_device *dev); > > > netdev_tx_t > > > diff --git a/net/mac802154/tx.c b/net/mac802154/tx.c > > > index de5ecda80472..d1fd2cc67cbe 100644 > > > --- a/net/mac802154/tx.c > > > +++ b/net/mac802154/tx.c > > > @@ -48,6 +48,7 @@ void ieee802154_xmit_sync_worker(struct work_struct *work) > > > > > > kfree_skb(skb); > > > atomic_dec(&local->phy->ongoing_txs); > > > + wake_up(&local->phy->sync_txq); > > > > if (atomic_dec_and_test(&hw->phy->ongoing_txs)) > > wake_up(&hw->phy->sync_txq); > > As we test this condition in the waiting path I assumed it was fine to > do it this way, but the additional check does not hurt, so I'll add it. it's just a nitpick... to avoid scheduling and this triggers a checking if the condition is true in cases we know it can't.... although we can talk about this because ongoing_txs should never be higher than 1... so any atomic_dec() should make the condition true... - Alex