From patchwork Wed Jul 1 15:07:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 1320614 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=silabs.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-silabs-onmicrosoft-com header.b=PVHp4wgR; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49xl501Yznz9sTg for ; Thu, 2 Jul 2020 01:09:40 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731972AbgGAPJc (ORCPT ); Wed, 1 Jul 2020 11:09:32 -0400 Received: from mail-bn8nam12on2056.outbound.protection.outlook.com ([40.107.237.56]:52640 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731843AbgGAPIa (ORCPT ); Wed, 1 Jul 2020 11:08:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oWXfQ+dyPq6nn/84lC1n6QxQKNwxYE13n7NDKySWMsPjp6Hp56JeMa9/SzPi+9fkXrrraxE7EfO2h0zodh/bK0zHau9+PQJatyRXqGXCuSGYl6nkcORQ5izTxh1ISH0ulNL+jEtlDANhnrfRCj6RGL2/JLY89hTzh17WODaJa+F/wwGxmb9jWveFGJNPJyct/+1xnDe9yLcAPva6t5MtBw5ITIANrmuaNwq2HYoINxF1ilc0/1JUNFQNzi1uDvC8VXQ74nX/aaozj3y98LJb0Ve1caCRKX8R9wdGDYHfnFLO4aNOREv18NHllfJ2UOffsU/KSdi2V9xTdS2EpyC02Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7pEYsHPpbXvzL6FnSTWAELx9kwwDtV4QGWMWXcbdw48=; b=StAJwQcIJcD7YCLfo/Lek+xTyl9S3nrE/AbvcLCmjFs1SedMGtRCn1egCaOXJEdsnkMycNMdMtqG3rJP7c6ATqCoUpuXFJyI2NsfbrmE16UvzvGOlzdqBMtHOe92oTPc81XZvcdvQkDp4C9KLOWANiluTcisq3jwQsR35iaoGSftECtJY6i1QYgzlK7ZTTyhduMe+V2qWV6BuHW6d9xi4vkIhcwJV4I3+sJMmIi6hm0z7FQbm9+hwgnMeVna+X3KzDLhkRTRrWmSheKwLtlajDUi6auOAFH+x/jd16uZ00BVrzsiNOdFAf+bQvvM6g21ZOlTfuF6kDF0qfX6FEliwA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7pEYsHPpbXvzL6FnSTWAELx9kwwDtV4QGWMWXcbdw48=; b=PVHp4wgR6YqF5eTaaU8kOUfT/s91JSfpMaUnhQIZGJepTHpwiMKDmT74VZ/c+wL/1b8aYJmbusyXxbsQ7ufBFkGoMKxqq0XgPeDQ696X42RW4mbMiUXZTETqImQ9iPpxd0DYDhCJBakSxeIOGlr1++VJQEftjD/BXoNVgInNquc= Authentication-Results: driverdev.osuosl.org; dkim=none (message not signed) header.d=none;driverdev.osuosl.org; dmarc=none action=none header.from=silabs.com; Received: from SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) by SA0PR11MB4736.namprd11.prod.outlook.com (2603:10b6:806:9f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.22; Wed, 1 Jul 2020 15:08:16 +0000 Received: from SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336]) by SN6PR11MB2718.namprd11.prod.outlook.com ([fe80::c504:2d66:a8f7:2336%7]) with mapi id 15.20.3131.033; Wed, 1 Jul 2020 15:08:16 +0000 From: Jerome Pouiller To: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= Subject: [PATCH 08/13] staging: wfx: drop counter of buffered frames Date: Wed, 1 Jul 2020 17:07:02 +0200 Message-Id: <20200701150707.222985-9-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200701150707.222985-1-Jerome.Pouiller@silabs.com> References: <20200701150707.222985-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: DM5PR07CA0143.namprd07.prod.outlook.com (2603:10b6:3:13e::33) To SN6PR11MB2718.namprd11.prod.outlook.com (2603:10b6:805:63::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:544b:f17b:7ae8:fb7) by DM5PR07CA0143.namprd07.prod.outlook.com (2603:10b6:3:13e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.21 via Frontend Transport; Wed, 1 Jul 2020 15:08:15 +0000 X-Mailer: git-send-email 2.27.0 X-Originating-IP: [2a01:e35:2435:66a0:544b:f17b:7ae8:fb7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7457a744-0560-4351-37d2-08d81dd0950f X-MS-TrafficTypeDiagnostic: SA0PR11MB4736: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4VkvSWqgCkqm0A7Cfp8oUU2xEfnB60kihPgG47viZsCo9Cr/a1xUglJ3ATaXl5BdTv39CWIoCY008FuhOa60qpXZIpwFyw7MFNZnOS8A0YbbXeZAKqDtnuo2WWyOx5+YH05Fgn0eA8hVgw1klfjq+NiaK+aWFoW5XjwseAq6+IJtgiexlwyccAcTBlezpwEzJ3dY4PF4QUdeKGGCjUYkApAmmRsC7BWZvX12ppQsXzUPCUDA1fcXconjHtH/t7ksQ9zmQ2NrvYjiP24fm0Rwt5Ql6sHZYaP0/w/JgMz/0e0J9D52jYz+vChR1wjNbxyuvd4Gc3mZFf+02YR1xoo5Xg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB2718.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(39850400004)(366004)(346002)(376002)(396003)(136003)(5660300002)(6486002)(86362001)(6666004)(66574015)(36756003)(2906002)(186003)(83380400001)(16526019)(8936002)(66556008)(66476007)(107886003)(4326008)(8676002)(2616005)(1076003)(478600001)(316002)(54906003)(66946007)(52116002)(7696005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: iPiUrPr6yGm9wUEriqgzw6oo2GK5LNkdgQiS0qXkwkXnWZzqrvBij6IPM+4Q+3LW5wOJib6+ZzbStkyb3J3Dpw8OOIqhYJaBgb8gPynRdh6qUNUiY6wrpvul3GYPdcX0Ry/KPbtRTTBLRyaYRheWz3e/M/0cwHXqt1ZCs8H7g2Ef1FFS8HdB+u2nRbAeidTCXdv6Bn6w1BntoL1j08Y33ix1UTwbHabPK11jCCKFvdB86zSytvopxTbTMvLZFOjPiW7ayYx6H/nck5rtifh4dWityRtuOcQ0i6AwPnt8stvSIPrSlOkuabCc9Rt0vGH5kxH6fbXqNF8U4d77JNhlM2wcZ1fCM3Dr7hiPG2LX7Fp3K2FY9QkvVE6CE5lMpWf2/ZA8ntqG23g7iAOkgZshQbziVmmeNS9PbMTWHbAlGczDXLEDmlj5vsaj9uR5QucqdbUxPQtgtfspngd5poq4szr1cxKWENQNjnqvAtZ+moOEkKrTSsYS39dCwpgd1uIFjC9x2AKuOhujwGO0MpUetR/A9NrW3ybUvRecCFS8inY= X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7457a744-0560-4351-37d2-08d81dd0950f X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2718.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 15:08:16.7109 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AVi/vUHFoqoOYGRj5HNMF5P6uVT9lI8YlAOcP/vG7RfoLGxuTlPSP5/rO22waW9k7d8pjwRWQeq+VW5i2jJg2g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4736 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Since the driver does not call ieee80211_sta_set_buffered() anymore, it is no more necessary to maintain a counter of buffered frames for each stations. This change allows to simplify the processing in multiple places in the driver. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 50 ----------------------------------- drivers/staging/wfx/data_tx.h | 1 - drivers/staging/wfx/sta.c | 8 ------ drivers/staging/wfx/sta.h | 3 --- 4 files changed, 62 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 3244a768345c5..5c744d9c8c114 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -213,22 +213,6 @@ static bool ieee80211_is_action_back(struct ieee80211_hdr *hdr) return true; } -static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, - struct wfx_tx_priv *tx_priv, - struct ieee80211_sta *sta) -{ - struct wfx_sta_priv *sta_priv; - int tid = ieee80211_get_tid(hdr); - - if (sta) { - tx_priv->has_sta = true; - sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; - spin_lock_bh(&sta_priv->lock); - sta_priv->buffered[tid]++; - spin_unlock_bh(&sta_priv->lock); - } -} - static u8 wfx_tx_get_link_id(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct ieee80211_hdr *hdr) { @@ -406,7 +390,6 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, req->tx_flags.retry_policy_index = wfx_tx_get_rate_id(wvif, tx_info); // Auxiliary operations - wfx_tx_manage_pm(wvif, hdr, tx_priv, sta); wfx_tx_queues_put(wvif, skb); if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) schedule_work(&wvif->update_tim_work); @@ -449,35 +432,6 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, ieee80211_tx_status_irqsafe(wdev->hw, skb); } -static struct ieee80211_hdr *wfx_skb_hdr80211(struct sk_buff *skb) -{ - struct hif_msg *hif = (struct hif_msg *)skb->data; - struct hif_req_tx *req = (struct hif_req_tx *)hif->body; - - return (struct ieee80211_hdr *)(req->frame + req->data_flags.fc_offset); -} - -static void wfx_tx_update_sta(struct wfx_vif *wvif, struct ieee80211_hdr *hdr) -{ - int tid = ieee80211_get_tid(hdr); - struct wfx_sta_priv *sta_priv; - struct ieee80211_sta *sta; - - rcu_read_lock(); // protect sta - sta = ieee80211_find_sta(wvif->vif, hdr->addr1); - if (sta) { - sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; - spin_lock_bh(&sta_priv->lock); - WARN(!sta_priv->buffered[tid], "inconsistent notification"); - sta_priv->buffered[tid]--; - spin_unlock_bh(&sta_priv->lock); - } else { - dev_dbg(wvif->wdev->dev, "%s: sta does not exist anymore\n", - __func__); - } - rcu_read_unlock(); -} - static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb) { struct hif_msg *hif = (struct hif_msg *)skb->data; @@ -553,8 +507,6 @@ void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg) // You can touch to tx_priv, but don't touch to tx_info->status. wfx_tx_fill_rates(wdev, tx_info, arg); - if (tx_priv->has_sta) - wfx_tx_update_sta(wvif, wfx_skb_hdr80211(skb)); skb_trim(skb, skb->len - wfx_tx_get_icv_len(tx_priv->hw_key)); // From now, you can touch to tx_info->status, but do not touch to @@ -634,8 +586,6 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, while ((skb = skb_dequeue(&dropped)) != NULL) { hif = (struct hif_msg *)skb->data; wvif = wdev_to_wvif(wdev, hif->interface); - if (wfx_skb_tx_priv(skb)->has_sta) - wfx_tx_update_sta(wvif, wfx_skb_hdr80211(skb)); ieee80211_tx_info_clear_status(IEEE80211_SKB_CB(skb)); wfx_skb_dtor(wvif, skb); } diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index b1727ddecd5e2..cff7b9ff99a99 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -36,7 +36,6 @@ struct tx_policy_cache { struct wfx_tx_priv { ktime_t xmit_timestamp; struct ieee80211_key_conf *hw_key; - bool has_sta; } __packed; void wfx_tx_policy_init(struct wfx_vif *wvif); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 85d4bc2949882..2c0ab51fc92da 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -430,7 +430,6 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; - spin_lock_init(&sta_priv->lock); sta_priv->vif_id = wvif->id; // In station mode, the firmware interprets new link-id as a TDLS peer. @@ -450,14 +449,7 @@ int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, { struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv; struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; - int i; - for (i = 0; i < ARRAY_SIZE(sta_priv->buffered); i++) - if (sta_priv->buffered[i]) - // Not an error if paired with trace in - // wfx_tx_update_sta() - dev_dbg(wvif->wdev->dev, "release station while %d pending frame on queue %d", - sta_priv->buffered[i], i); // See note in wfx_sta_add() if (!sta_priv->link_id) return 0; diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index 8a20ad9ae017e..43808cef4785c 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -16,9 +16,6 @@ struct wfx_vif; struct wfx_sta_priv { int link_id; int vif_id; - int buffered[IEEE80211_NUM_TIDS]; - // Ensure atomicity of "buffered" and calls to ieee80211_sta_set_buffered() - spinlock_t lock; }; // mac80211 interface