Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2671052rdd; Fri, 12 Jan 2024 18:45:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjECoiYSZTc/PcTcUkl4YfLEYJbqT9oZEuYYKXcKionwTD7a1PzFdwc0KT++sGA1l49iJo X-Received: by 2002:a05:6a00:3c8f:b0:6da:c7ce:ef53 with SMTP id lm15-20020a056a003c8f00b006dac7ceef53mr2442198pfb.3.1705113944567; Fri, 12 Jan 2024 18:45:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705113944; cv=none; d=google.com; s=arc-20160816; b=fmliLaAhygB8z86hudjF7RllDYGil71ZG8rj5Psz186w8A0+SkY/tm3IUeMRr3Q49M PBzfHARsauoXJf63i4ZUsvHJ3uiEK+ddkZ7hu/q5bORJ8qP7M438VnN2TNJxicjgbP4U 3nwABzU/Dn6RstulfiWhvZ3OEbvo7aRr4bfY+UKJWHpzMd4A5wSdXw3tNEu5X91yOrBM qHV7RBHrtY5rmulIwP2C5It0GmNaExiHasJBkftaV8z41jDfO+px/NkuGOZkUO3yldy+ lGa4XNWU9/AN1L9Qqtocl0oEhzIGNE4GnLDFtLutfgejoO+tFaz5QhyD/O2+Tnkp3qS2 R76A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=e4kZL5MhkHSuCq4Bhd9iF8Z31801rAHJZp/VIaHUUdk=; fh=Vd2/uj3NdM43Tv5K+AmYgVeSTR+lw6PqCPTjkyfy9yc=; b=NxmwJHJrkwZoNhje1fYM7DHCejpRWdJfnvI0bjMAuBH0PPAhnva962XK3A7/L7ooZy S2GI3MWria5T6wU+G+AUGPzyeqbNLWKE7yBfEMG60jAsG+V9Vzc+vat/3MIn2zPFLuyR 9rsUfd3ayb1YLbnZVwA8keuGx+DWZDT7VNOFcLHegNuuw4EVX/0fd0anurs8Nubh3l7D wUid6RuU7nX/UTdRltWN8HuNU7n8geJ3kAMdRr9V61h10R+KuIP7yo77zyz+4pob+K6o y9F+jO43jD2bGa2MMurfmqqhoOiV05n5K0coKjXxu5oTX/ybJm6ClAe4y9k3Fpf7X7Ow 2qEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=feGcgba9; spf=pass (google.com: domain of linux-kernel+bounces-25180-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t19-20020a056a00139300b006d9bdc1f84fsi4547427pfg.34.2024.01.12.18.45.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 18:45:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25180-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=feGcgba9; spf=pass (google.com: domain of linux-kernel+bounces-25180-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B87BC282BDE for ; Sat, 13 Jan 2024 02:45:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9FA44CA68; Sat, 13 Jan 2024 02:44:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="feGcgba9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CFAC21C2E; Sat, 13 Jan 2024 02:44:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBF57C433F1; Sat, 13 Jan 2024 02:44:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705113898; bh=BzT25cXi1cMZyRyCto2mcPnNVmM/UVdj5o9CdlbbAbE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=feGcgba9BKLJGGc2npBabHiVmw5NHLR+0ul8vA9DpZsrY2ffhdB6AqWvuY8Po5jYs jT08umgtShrLTuyZvY7YHOJWb5si/wW6LrYy5/ZmTG+54gFnwn+GKvWXLxI9zjluYZ 1fbRkccoaRqv6oAetob/q3Jg+1wAEB8ABngOqL3AwtSVrW5AVem4nIacVNkNs8Gvek wztUGMGp7xeU9i+tW6u9cog9iysUb8+FPLeo0FcEMtCDBaMReJcBd4OdI6kYTXtbXr JZO5hUWIpg8IixFGnjoQaB5GNqBMchYcEJyh6oLGpUZpSLPQyXwVPP1+rXI+UBwihz Y3avb2F4/Zy2A== Date: Fri, 12 Jan 2024 18:44:56 -0800 From: Jakub Kicinski To: Marc Kleine-Budde Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , Herbert Xu , kernel@pengutronix.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: netdev_queue: netdev_txq_completed_mb(): fix wake condition Message-ID: <20240112184456.107a3756@kernel.org> In-Reply-To: <20240112-netdev_queue-v1-1-102c2d57e20a@pengutronix.de> References: <20240112-netdev_queue-v1-1-102c2d57e20a@pengutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 12 Jan 2024 17:13:14 +0100 Marc Kleine-Budde wrote: > netif_txq_try_stop() uses "get_desc >= start_thrs" as the check for > the call to netif_tx_start_queue(). > > Use ">=" i netdev_txq_completed_mb(), too. > > Fixes: c91c46de6bbc ("net: provide macros for commonly copied lockless queue stop/wake code") > Signed-off-by: Marc Kleine-Budde > --- > I'm currently converting a networking driver with a TX-FIFO depth of > 1 (CAN device with lots of errata :/) to the netdev_queue.h helpers > and stumbled over an off-by-one error on __netif_txq_completed_wake(). Makes sense, could be copy'n'paste from one of the drivers this is based on. A bit unsure if it deserves the Fixes tag and net as we don't know of any current user that would be suffering. start_thrs == ring size is a bit of an extreme use case indeed :) Either way: Acked-by: Jakub Kicinski