Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2974114pxb; Mon, 17 Jan 2022 09:16:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJGkRFPH5GqNmjZ1uZ4g7wynkLzgBjhstx2uAuqzTvbj5QEyfq5olWxXEMbO2qLGO3yrLn X-Received: by 2002:a63:8441:: with SMTP id k62mr8731300pgd.64.1642439764866; Mon, 17 Jan 2022 09:16:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642439764; cv=none; d=google.com; s=arc-20160816; b=s8UojHk02oPfwNuLt4PYS+cR8/NNgiM5y4s5Y+mIVR/MUQ56527XARGzrvdbLVu96O tMf7rzBsm0i4tliRvXUYkihi37BVOzbRP/8Rtrq6rf6tDAQeZ11HrlsgsvJCcao0BiYu FlSCgY3YuFrGW4B687vHkHZB6CXSMIZCe51xrhIOMJNdd6+8o9Miy515AaOibhCR8KyJ wS6Xxyd+F4GogDWxBrOAbpTkM+9vOngDyhhQ0awthcNKuH2HKyNkXbH4k4Zq41ndvYgZ lmqzWjgs9KoCNMMgJPrQBVaMn09z+z9dKvxhsjabVJl+fP/k+Cefdp2b80ZEZKCl5d/a Wb9g== 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=ax5kgahNw81rtFfF3FllPsDzE2vkHhmNPT1hcIoERScg0t6RKX/m7/tTxTj1NCcuBP 6wjWWkANmqW/R06ndPbNbuZpjvJLStw1cZQepBHxGcQLYsf4JJu383L7GUUBJwgRYp98 1ESdzXCogbKSqnmxuej+WHcA1ogJKBGGvgVMyfdGGrLn0e8ZDEyltWN/z8NvS249s7+F HNwaJd+grFpixKaufaNQLQxLfVpmU6Sd9AW76pDCl84NUN6x2ssAFTjxxkBPCUwxhvw6 Ya+dYXSz2XyXM232+zauSU7lX/pYM8j2NEg0s7UwGJlZYHUW+/64UzZJ7gefpJ+k02y0 l8Ng== 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 q9si12059717pgj.820.2022.01.17.09.15.55; Mon, 17 Jan 2022 09:16:04 -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 S236735AbiAQLzc (ORCPT + 70 others); Mon, 17 Jan 2022 06:55:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239359AbiAQLzR (ORCPT ); Mon, 17 Jan 2022 06:55:17 -0500 Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [IPv6:2001:4b98:dc4:8::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3B37C06173E; Mon, 17 Jan 2022 03:55:16 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id C0C91200008; Mon, 17 Jan 2022 11:55:13 +0000 (UTC) From: Miquel Raynal To: Alexander Aring , Stefan Schmidt , linux-wpan@vger.kernel.org Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Michael Hennerich , Jakub Kicinski , Varka Bhadram , Xue Liu , Alan Ott , Thomas Petazzoni , Miquel Raynal Subject: [PATCH v3 16/41] net: mac802154: Explain the use of ieee802154_wake/stop_queue() Date: Mon, 17 Jan 2022 12:54:15 +0100 Message-Id: <20220117115440.60296-17-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220117115440.60296-1-miquel.raynal@bootlin.com> References: <20220117115440.60296-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