Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1228703pxb; Fri, 21 Jan 2022 12:49:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeVgO5YjZMY2MCSnp56tNq0KfaZc8WSnGsWJYisXTG0LPlpXgCwk7AshVcwVXKUF56f6nG X-Received: by 2002:a17:90b:1e0c:: with SMTP id pg12mr2431202pjb.1.1642798185936; Fri, 21 Jan 2022 12:49:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642798185; cv=none; d=google.com; s=arc-20160816; b=Cvow9DrvZNQma1MGRpR3CapFQZPnb+sYKIXkdJcAA7BXBuyIqbwSL/d0zSuJS+8rEP 72Ki2ELfCtnsdX2p2VWgvy2oYA/Y1pbiGOR9x+EY6KVKusd4TLgBy3S1SPbKdqaK5Poc 2F0+tPWVmvqjJUGFKX419UwG7gclitl6ZBGAKxfPxLHOKJydL6up4j6MPNDw/k2Henh4 4Uo54mGs7yuu2jB8qtCpqtsE0JsDf9foAPUjGGEgmt3vGbA2dLGz/PnPOawEsLvmJ8vg pm/LmCby+nJRxO8h7ESPuiJ242yEKQJqWK7GlKaITyKfvl0gp0kfYLDZ9Htlu6NOGv+6 2YiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=i9PglnOxdTEkSFKAPT7vQozsj5fcN/zFkz42uf+ZuBE=; b=R0wOMIGUnlMbYZKd2Q/no4nh2rBwtfHOmZdyvfrWEaYYUaNMF/NOKDlcjfnnHmSKKs I0N/yXi1VaoWgUthQSayH9i+9X0CWUJx4YqEo/vwdl+9JXvD0ZkXIPtgNzY9dASgRp+O DfhGxK/I6/1tuK3E/919dRUweTKEPcA7szPH7vipJ3tbSGpLESOmYvExmy34fnpvSbzr WzQr1DdvKO5gP3xJA1WzPcN+kgO3QfxLcK0bofuolKZDBOoiGWyF1I/ItG+TY0H8Kwaa GUO+OW3g4oDmVCyrjg0OiX2ViS9/cD8OP+4DfBuSFm5Yi2F3fQaxegojhlFPJtOlNwCb 2Ozw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m20si6792454pfo.299.2022.01.21.12.49.37; Fri, 21 Jan 2022 12:49:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357900AbiATAhJ (ORCPT + 70 others); Wed, 19 Jan 2022 19:37:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357894AbiATAhE (ORCPT ); Wed, 19 Jan 2022 19:37:04 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F1FBC06173F; Wed, 19 Jan 2022 16:37:03 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 7619EC0004; Thu, 20 Jan 2022 00:37:00 +0000 (UTC) From: Miquel Raynal To: Alexander Aring , Stefan Schmidt , linux-wpan@vger.kernel.org Cc: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, Xue Liu , Marcel Holtmann , Harry Morris , David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Thomas Petazzoni , Miquel Raynal Subject: [wpan-next 8/9] net: mac802154: Explain the use of ieee802154_wake/stop_queue() Date: Thu, 20 Jan 2022 01:36:44 +0100 Message-Id: <20220120003645.308498-9-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220120003645.308498-1-miquel.raynal@bootlin.com> References: <20220120003645.308498-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org It is not straightforward to the newcomer that a single skb can be sent at a time and that the internal process is to stop the queue when processing a frame before re-enabling it. Make this clear by documenting the ieee802154_wake/stop_queue() helpers. Signed-off-by: Miquel Raynal --- include/net/mac802154.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/net/mac802154.h b/include/net/mac802154.h index d524ffb9eb25..94b2e3008e77 100644 --- a/include/net/mac802154.h +++ b/include/net/mac802154.h @@ -464,6 +464,12 @@ void ieee802154_rx_irqsafe(struct ieee802154_hw *hw, struct sk_buff *skb, * ieee802154_wake_queue - wake ieee802154 queue * @hw: pointer as obtained from ieee802154_alloc_hw(). * + * Tranceivers have either one transmit framebuffer or one framebuffer for both + * transmitting and receiving. Hence, the core only handles one frame at a time + * for each phy, which means we had to stop the queue to avoid new skb to come + * during the transmission. The queue then needs to be woken up after the + * operation. + * * Drivers should use this function instead of netif_wake_queue. */ void ieee802154_wake_queue(struct ieee802154_hw *hw); @@ -472,6 +478,12 @@ void ieee802154_wake_queue(struct ieee802154_hw *hw); * ieee802154_stop_queue - stop ieee802154 queue * @hw: pointer as obtained from ieee802154_alloc_hw(). * + * Tranceivers have either one transmit framebuffer or one framebuffer for both + * transmitting and receiving. Hence, the core only handles one frame at a time + * for each phy, which means we need to tell upper layers to stop giving us new + * skbs while we are busy with the transmitted one. The queue must then be + * stopped before transmitting. + * * Drivers should use this function instead of netif_stop_queue. */ void ieee802154_stop_queue(struct ieee802154_hw *hw); -- 2.27.0