From patchwork Wed Sep 4 15:47:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 1980911 X-Patchwork-Delegate: anthony.l.nguyen@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=B6OFKz2R; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WzRn236D9z1yg3 for ; Thu, 5 Sep 2024 01:51:34 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id BE87C608A4; Wed, 4 Sep 2024 15:51:31 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id r6U2wWxr9lxX; Wed, 4 Sep 2024 15:51:31 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E6B85608B9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1725465091; bh=5bAOZ1AoBLPiYZFb02Mf1BCk6Xy/P6qaYEz9Fbs90as=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=B6OFKz2R+qvUkUU1MtavYXfmAl0nnlulEGMc9xPHM8Kt5kdtA1e2eb+T1LBwyrofF qO6fAt9sCt2feFD8jieBb2chkFdoKLT0Ylnc3pHufnD90WbYv5R1j08YeZoTQW+qhj TeoaW63nwAocjz+KSSmLeTM3n7AvJoeRzrG0X22Clo+iIqMvdsASAskUVdWi1efFM/ vomindPwTWz/QHHxP4jQHjhPjctccWARM9vY/FnBH9EN/9xq79vFv19vA9X7q375Vh mp+snfgTEtdSM2yO565HSXXWUzliruinpwOj49VrFU1aIVOVVcQF7lF4uaDYDih8vj 2JpaSpaRSYqcw== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id E6B85608B9; Wed, 4 Sep 2024 15:51:30 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id AD3771BF40B for ; Wed, 4 Sep 2024 15:51:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8EC33608B7 for ; Wed, 4 Sep 2024 15:51:29 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id UPDSU0I_DE7q for ; Wed, 4 Sep 2024 15:51:29 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.11; helo=mgamail.intel.com; envelope-from=aleksander.lobakin@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org C0A13608AD DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org C0A13608AD Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by smtp3.osuosl.org (Postfix) with ESMTPS id C0A13608AD for ; Wed, 4 Sep 2024 15:51:28 +0000 (UTC) X-CSE-ConnectionGUID: G3U91tHLRxuIqgyHOSHbhA== X-CSE-MsgGUID: na+9wRP1QV62HwFqAOfREg== X-IronPort-AV: E=McAfee;i="6700,10204,11185"; a="34737149" X-IronPort-AV: E=Sophos;i="6.10,202,1719903600"; d="scan'208";a="34737149" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2024 08:51:28 -0700 X-CSE-ConnectionGUID: pxtbhhcRTP+9Q15MkLb2DA== X-CSE-MsgGUID: 7lnaK++/S6GXMqsvJ986HA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,202,1719903600"; d="scan'208";a="66041870" Received: from newjersey.igk.intel.com ([10.102.20.203]) by orviesa008.jf.intel.com with ESMTP; 04 Sep 2024 08:51:26 -0700 From: Alexander Lobakin To: intel-wired-lan@lists.osuosl.org Date: Wed, 4 Sep 2024 17:47:45 +0200 Message-ID: <20240904154748.2114199-4-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240904154748.2114199-1-aleksander.lobakin@intel.com> References: <20240904154748.2114199-1-aleksander.lobakin@intel.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725465088; x=1757001088; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jmwK4yTCSx8cWzeawW0xhX1HJ78yUrwNll7xu4Sspw4=; b=M+elsgxSiUSAbgDSsVscXnj39YDb2EWSQRAYT6QKD56cMmbR46FAB+3H 0qKpWLjS1H/o0EHrwICoPgSz/mAHRwbvhGHpHu8znj79+VD7mCjXIH3OP +WflPDFN6zjN7AwJ8UtGmr8fLIG4ieo1LETzZSofLlsCXJTWcOnbASGOF rMMCE2p1mHK2pYAheC+XEbO00LChQErPsHtisco90FCRegeIejWbM7zc6 MUBqMwRhQsSIxgTo/gxHxjeH6KKGrMO2vkldlP6qrXPDuVozSbO81wVZc 9guYULL/+mVnRVhnIEhzoq6WGo9R+CWbPC87g+Z6IQF7EqEKjBWyKHxPK g==; X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=M+elsgxS Subject: [Intel-wired-lan] [PATCH iwl-next v2 3/6] netdevice: add netdev_tx_reset_subqueue() shorthand X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Przemek Kitszel , Joshua Hay , linux-kernel@vger.kernel.org, Alexander Lobakin , Eric Dumazet , Michal Kubiak , Tony Nguyen , nex.sw.ncis.osdt.itp.upstreaming@intel.com, Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni , "David S. Miller" Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Add a shorthand similar to other net*_subqueue() helpers for resetting the queue by its index w/o obtaining &netdev_tx_queue beforehand manually. Reviewed-by: Przemek Kitszel Signed-off-by: Alexander Lobakin --- include/linux/netdevice.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 4d6fb0ccdea1..4f37b01b3d5a 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -3599,6 +3599,17 @@ static inline void netdev_tx_reset_queue(struct netdev_queue *q) #endif } +/** + * netdev_tx_reset_subqueue - reset the BQL stats and state of a netdev queue + * @dev: network device + * @qid: stack index of the queue to reset + */ +static inline void netdev_tx_reset_subqueue(const struct net_device *dev, + u32 qid) +{ + netdev_tx_reset_queue(netdev_get_tx_queue(dev, qid)); +} + /** * netdev_reset_queue - reset the packets and bytes count of a network device * @dev_queue: network device @@ -3608,7 +3619,7 @@ static inline void netdev_tx_reset_queue(struct netdev_queue *q) */ static inline void netdev_reset_queue(struct net_device *dev_queue) { - netdev_tx_reset_queue(netdev_get_tx_queue(dev_queue, 0)); + netdev_tx_reset_subqueue(dev_queue, 0); } /**