From patchwork Sat Dec 18 23:54:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Mosberger-Tang X-Patchwork-Id: 12686515 X-Patchwork-Delegate: kvalo@adurom.com 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 D85A3C433F5 for ; Sat, 18 Dec 2021 23:54:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234979AbhLRXyR (ORCPT ); Sat, 18 Dec 2021 18:54:17 -0500 Received: from o1.ptr2625.egauge.net ([167.89.112.53]:25300 "EHLO o1.ptr2625.egauge.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232124AbhLRXyR (ORCPT ); Sat, 18 Dec 2021 18:54:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=egauge.net; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type; s=sgd; bh=v7mhVC8oOz6jVz3FqzbpHDEQb0xvpcFgFAT/KNJ3tFk=; b=WJFXWzdfsC+OIXaa1TNfd8VY4OQ2FWZf1DjV8liOWlGms/iixnxWf2IYxLyoeTwTp+3O 9ArahNQ+sZXvIjuDpwp2BK77RAnPBOtAh4Q8iYeR0wjBle+ocyLm3rbmSQ8i3zvyd3x8DN t6UiHLThfQyfXQUnnLyfrMR/5AZlk9ohYmgOWXoCCm3P/h5gmEvPsWmIZ99IZo1B+Vcv4Z PPwrz+2enC0XolwrrurT6wMwHAFks0NgwNgrJlc+gr08rGd4CDHrDaHTtzO+5iecG6B3rI +tKFvlelVI7ACUX6HIPNYljIHcr4f5ZeZw2M9MBgAgq52dYHBFF2u9GC/R1B2d9g== Received: by filterdrecv-64fcb979b9-5m6bg with SMTP id filterdrecv-64fcb979b9-5m6bg-1-61BE74A8-15 2021-12-18 23:54:16.521131114 +0000 UTC m=+8294248.488193823 Received: from pearl.egauge.net (unknown) by geopod-ismtpd-5-0 (SG) with ESMTP id 9_004Y47RlWVNmE_OdvBYw Sat, 18 Dec 2021 23:54:16.323 +0000 (UTC) Received: by pearl.egauge.net (Postfix, from userid 1000) id 89CAD700694; Sat, 18 Dec 2021 16:54:15 -0700 (MST) From: David Mosberger-Tang Subject: [PATCH 03/23] wilc1000: move receive-queue stats from txq to wilc structure Date: Sat, 18 Dec 2021 23:54:16 +0000 (UTC) Message-Id: <20211218235404.3963475-4-davidm@egauge.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211218235404.3963475-1-davidm@egauge.net> References: <20211218235404.3963475-1-davidm@egauge.net> MIME-Version: 1.0 X-SG-EID: +kMxBqj35EdRUKoy8diX1j4AXmPtd302oan+iXZuF8m2Nw4HRW2irNspffT/khET6RJF6+Prbl0h/EtF1rRLvOefZa1KROfX6WNE6WJTSIBXCw4Y8gXfoILR78bvyRBoeZwMCihyeVhcXVgjU00tWHB+j8HM7ZkWNzKPPFf4W9KOn+57a+34yRWUsFRi7ZwnyRcMIEw/21aLUvpLOBi69LuA3FqVKyB9uoUyNq1n1fhpC6YhgPjp0alCtp5REcFYi5u1/XnjkyV5Z0OmNk/S6A== To: Ajay Singh Cc: Claudiu Beznea , Kalle Valo , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, David Mosberger-Tang X-Entity-ID: Xg4JGAcGrJFIz2kDG9eoaQ== Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is in preparation of switching the transmit queue to struct sk_buffs. There is no functional change other than moving the location of the structure. Signed-off-by: David Mosberger-Tang --- .../net/wireless/microchip/wilc1000/netdev.h | 1 + .../net/wireless/microchip/wilc1000/wlan.c | 28 +++++++++---------- .../net/wireless/microchip/wilc1000/wlan.h | 1 - 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/microchip/wilc1000/netdev.h b/drivers/net/wireless/microchip/wilc1000/netdev.h index 65cf296a8689e..ce79bdcc28000 100644 --- a/drivers/net/wireless/microchip/wilc1000/netdev.h +++ b/drivers/net/wireless/microchip/wilc1000/netdev.h @@ -254,6 +254,7 @@ struct wilc { struct txq_handle txq[NQUEUES]; int txq_entries; + struct txq_fw_recv_queue_stat fw[NQUEUES]; struct wilc_tx_queue_status tx_q_limit; struct rxq_entry_t rxq_head; diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c index fafeabe2537a3..2d103131b2e93 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.c +++ b/drivers/net/wireless/microchip/wilc1000/wlan.c @@ -373,32 +373,32 @@ static inline int ac_balance(struct wilc *wl, u8 *ratio) return -EINVAL; for (i = 0; i < NQUEUES; i++) - if (wl->txq[i].fw.count > max_count) - max_count = wl->txq[i].fw.count; + if (wl->fw[i].count > max_count) + max_count = wl->fw[i].count; for (i = 0; i < NQUEUES; i++) - ratio[i] = max_count - wl->txq[i].fw.count; + ratio[i] = max_count - wl->fw[i].count; return 0; } static inline void ac_update_fw_ac_pkt_info(struct wilc *wl, u32 reg) { - wl->txq[AC_BK_Q].fw.count = FIELD_GET(BK_AC_COUNT_FIELD, reg); - wl->txq[AC_BE_Q].fw.count = FIELD_GET(BE_AC_COUNT_FIELD, reg); - wl->txq[AC_VI_Q].fw.count = FIELD_GET(VI_AC_COUNT_FIELD, reg); - wl->txq[AC_VO_Q].fw.count = FIELD_GET(VO_AC_COUNT_FIELD, reg); - - wl->txq[AC_BK_Q].fw.acm = FIELD_GET(BK_AC_ACM_STAT_FIELD, reg); - wl->txq[AC_BE_Q].fw.acm = FIELD_GET(BE_AC_ACM_STAT_FIELD, reg); - wl->txq[AC_VI_Q].fw.acm = FIELD_GET(VI_AC_ACM_STAT_FIELD, reg); - wl->txq[AC_VO_Q].fw.acm = FIELD_GET(VO_AC_ACM_STAT_FIELD, reg); + wl->fw[AC_BK_Q].count = FIELD_GET(BK_AC_COUNT_FIELD, reg); + wl->fw[AC_BE_Q].count = FIELD_GET(BE_AC_COUNT_FIELD, reg); + wl->fw[AC_VI_Q].count = FIELD_GET(VI_AC_COUNT_FIELD, reg); + wl->fw[AC_VO_Q].count = FIELD_GET(VO_AC_COUNT_FIELD, reg); + + wl->fw[AC_BK_Q].acm = FIELD_GET(BK_AC_ACM_STAT_FIELD, reg); + wl->fw[AC_BE_Q].acm = FIELD_GET(BE_AC_ACM_STAT_FIELD, reg); + wl->fw[AC_VI_Q].acm = FIELD_GET(VI_AC_ACM_STAT_FIELD, reg); + wl->fw[AC_VO_Q].acm = FIELD_GET(VO_AC_ACM_STAT_FIELD, reg); } static inline u8 ac_change(struct wilc *wilc, u8 *ac) { do { - if (wilc->txq[*ac].fw.acm == 0) + if (wilc->fw[*ac].acm == 0) return 0; (*ac)++; } while (*ac < NQUEUES); @@ -920,7 +920,7 @@ int wilc_wlan_handle_txq(struct wilc *wilc, u32 *txq_count) kfree(tqe); } while (--entries); for (i = 0; i < NQUEUES; i++) - wilc->txq[i].fw.count += ac_pkt_num_to_chip[i]; + wilc->fw[i].count += ac_pkt_num_to_chip[i]; acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP); diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.h b/drivers/net/wireless/microchip/wilc1000/wlan.h index eb7978166d73e..9b33262909e2f 100644 --- a/drivers/net/wireless/microchip/wilc1000/wlan.h +++ b/drivers/net/wireless/microchip/wilc1000/wlan.h @@ -341,7 +341,6 @@ struct txq_fw_recv_queue_stat { struct txq_handle { struct txq_entry_t txq_head; u16 count; - struct txq_fw_recv_queue_stat fw; }; struct rxq_entry_t {