From patchwork Wed Apr 1 11:03:34 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: 1265123 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=Qk9w0KfN; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjyM52znz9sRf for ; Wed, 1 Apr 2020 22:04:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732250AbgDALEl (ORCPT ); Wed, 1 Apr 2020 07:04:41 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731343AbgDALEk (ORCPT ); Wed, 1 Apr 2020 07:04:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EVNBIsIgCpFXJvz39yXlQFDEOwgCdWYMUYaEPzP2He08nig8W5cqN3Tfmhdz/GgrPTTwB8Pv/RiDnfqgHjNgXf+FdfRBcpv3N2hQYJJQq/nSJ+4v/0T5MsV5/LL+zz+9YCgrsKonCEgRuatcpOIxgAqP075AGJBkuAcBJoFmbOjkxTwRi5/ZlTS0wJEvrRF+rmIzk2mYEZ+ZskA9MpAbkBK0Ie8/IOKvBT0z+hRhagwamWXBciOEF58ijKmsMuufW/lxb63bDtP9qVjgw7Qa+pzevIxOieyoniH5rwZxrUo1gXU5r7cTN/mgX18mMOptmq4o5nIo+ljleJfWMUuX0A== 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=XKWHCiXwAVePoLiZHsmPvjQy5vpTGJ11DHBgMJItd0c=; b=XzjLdNefl9o5Y+ZaINRsMd9gEe1JszsuyY5KED7uKkQzMdhNRBAcNR9eKVl4A1ZOKhoTHZK3XcuCdpBDLWyd/LbZ03yMNSbBpuYJWj1e+SNX/n3cBCbS506Vh4Sajo16IhA+hhU6MqtlU7IfiP+5FZOAPBn15FF4AQCDOToQYQ1D6k+oyQgqdJSDHP0XIqpXKX/GaNwYJvvDQal3Sp/we20hNvD7LdvnldDgYRp9Qoac80OuWPUPhUHeFmy5bpW5NBHA5YoovQHaANnAtKrNQ8C0O5BZItYlTFPpzf05VyYg6G+SEQQ6i6PwN4WiGcH9duuNDBFgEPL1PAvRtVYC/g== 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=XKWHCiXwAVePoLiZHsmPvjQy5vpTGJ11DHBgMJItd0c=; b=Qk9w0KfNZV78dgOt9ib6x085BGggFk8FnE/maihvhhxAcLE8Q2WdinY0H/5WXmcCJo1d6BJg0JJf+CxhMKt9MHAq0uGIyiFBfwkMhWZA8JSJCskAhTfEgI/W+ZO/SJPoHB25EZlvaNokL3jpE5dY4SyP93arI6zXSXX5p43UvJ0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:22 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:22 +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 01/32] staging: wfx: add sanity checks to hif_join() Date: Wed, 1 Apr 2020 13:03:34 +0200 Message-Id: <20200401110405.80282-2-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:20 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 667618a1-ec55-4c5e-2991-08d7d62c6e98 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:419; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(4744005)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /wMH3dPz/F6D+1K5xR75GLLj2MI/qljaPv7Dy5aTzBmNYvZKKh6aPM11C+OFwi6WDtrCJVEK5Hu+mzaZ3iXx7HUCWu6lYptTiSiEoKt2OOq436BtVhk3mfK54feMWc5xEsj6HXqC8462oX8dxEGqmfOY1Oig4WUrpICHQ+3mT/eATvufGdnG8zl/6X6sA5Dvm/5uktNIYnI5csnYEjCxxBN0LVp6IsEJO6NHZQRKaXKPVF+ueisEwhhf8fqYGMBZ2Y3a293AUGoFCpmP0ofRLGoHPG6LOqLVs/92ZaCHNXE9E7m0qR5TDeifa6QQPzY65zGPYkwaGbJUFefb+mWlWh+jeTcuiR7mR1xMNSSn0x1+55aw4L3gIo5yXgLlY4LTcWcK2XG0hbVaMxR+ftLwdhltYWpq4fsC6abSuCg0j1bEuz0JRvOOas9kk8uNzq3H X-MS-Exchange-AntiSpam-MessageData: vi4fU7z6gvScGST45SvgmnP4uZdVW/CEBptYDPo64VZLRhDw6cu/iYyqCB+LbeTTshzOx8qBEYB26sbLWIRCvA5y6NZY3aiyXpHfhLnu8N6xOdKwv1KSVJGM9BN5ve5kzcGra15N/D4pofrbxzo58Hz4whgvdoBdzxacr/3Gg7Cucw34D4NGmIdOR585+jWL9Dj618zaoReBQ/7rew8rzw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 667618a1-ec55-4c5e-2991-08d7d62c6e98 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:22.1333 (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: KHekGTLPM8El+ZNhoSiVTDx9fNKWqgJDxcrrwqJGXm69s+e3xO2BAMWPgpJTKvRhg7/16IMYuPwHJSTZ0jUF4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Add a few check on start of hif_join(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 77bca43aca42..445906035e9d 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -297,6 +297,8 @@ int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, struct hif_req_join *body = wfx_alloc_hif(sizeof(*body), &hif); WARN_ON(!conf->basic_rates); + WARN_ON(sizeof(body->ssid) < ssidlen); + WARN(!conf->ibss_joined && !ssidlen, "joining an unknown BSS"); body->infrastructure_bss_mode = !conf->ibss_joined; body->short_preamble = conf->use_short_preamble; if (channel && channel->flags & IEEE80211_CHAN_NO_IR) From patchwork Wed Apr 1 11:03:35 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: 1265124 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=c7MOUuXf; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjyR5yDXz9sRf for ; Wed, 1 Apr 2020 22:04:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732273AbgDALEq (ORCPT ); Wed, 1 Apr 2020 07:04:46 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732006AbgDALEm (ORCPT ); Wed, 1 Apr 2020 07:04:42 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hg8qBwBTc1cAkmcmuKTtaz6nesFi3aAqY4HRF4FXLUZs6mQyr1rhnWAZrF+TRag3Ko8P3a1TeQh60BaXwinRaQrUq0nokFNUVGAJD5b618QmM4CULnMYSXHlNEGwmAYU0jUMVnqjjG09wenExR30wV6bCMcdg+ytpfkGMnTADoe2NavDjRezljI4pnCrOWRdgvq1FXmscNpKTXGUAsuVdehWGZURMKt/+UD/hAvuLGAgmf0Gh5rkAjjQIJnDkaZnfbGzbQ3Vp3yleqjlxgNXShTxZaBgtYJYB1vQCij1fHDebJa73tqzbP773KSIEQPrkhmVuQ1JgHv7Z3LI/rFSyw== 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=fGM4LaUSzkuToWuyg8sMCdYGN32WYJxK4Mm/t0pV04M=; b=PhCBuTuQc7xGXzOkGh9jBohIFrImsX7K+gkLZIJorIgajuE3jDj7ff95dWCeCjpJXZn+XvfI+6xQFgKhl+f+DWMwdnbbik9+JB7vthHhUMTWwc2c0B0cUurXSVmO36hTW7EYesoZDUMzxY3byA2Ifn2+squgQue1sKLqFwzW5B8hXBNYlOBRsdqJMOyMwQr8zzjZScgDl4l10ikx8Qcl6dgV9VP/1rYy2irgl6f84PHN7BDtRRJYQwo7bsdcBor27iBR/wMnphVGllaO2NGnRnBTg+e9/0+i346Mh0262BOJGOU+o7rpVb0BYKYP2OpZEy0RpU4YNQvCWvMpWx5zZg== 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=fGM4LaUSzkuToWuyg8sMCdYGN32WYJxK4Mm/t0pV04M=; b=c7MOUuXf1OA0Hlg4SI8AiorhmGrDQ6TfGDW4UnD/xsIqjtEGuM5oPHjJwtxy4cgfcpOikRhXDBKCPBZkakZt/vNpWB8uCzoEEghhfrGtyYGNpGfnIWD5xeSRpCcfdiRvq4l0S2qcBN/EZAE/T1tk4QMyRvs7u9dC35HMsVRdE34= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:24 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:24 +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 02/32] staging: wfx: do not stop mac80211 queueing during tx_policy upload Date: Wed, 1 Apr 2020 13:03:35 +0200 Message-Id: <20200401110405.80282-3-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:22 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7cbcb3bf-019b-461b-4a1e-08d7d62c6fe6 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YLOTzXVBTgigxc+OSBOA2VrCqEVsYglHdCb3CT02YkokFpBuDWPkxqmnu7Rt3kwXKB2NqM0h9bzKXM39EOvLJxfO+ppH8BJedjARqlyARGXn57EWbMPKX3wjf5mQC34acEktjjIIbct8soYzglvLg5Rjpq3afDiW02K/k/Mp8UvFhgVXB2gl7HavBroI/rtEyf72xzh6PxEQ89t7slstpTh/m7T+a7CwopO8c+Burj/RkbktJ5WHJkjuSqCJF0YHzsnSahS5ZAFz9dyXTnUuUQ76U6rYCx8hZt4sr9wzA9X3KI0ji9k1crB3j8dWkmC9Zc41iSqpIMApVahRmNh6oDfxyFQkiyAjCI2b5B/fxmJ7rKEqG5ZehaQW2C7I1QJtJSPB4WCE9MCpDTuN5DdJ1t040cWs2B+8Ey8uDlUIPH9kHXgjnlrv0mgGQtgC9hfw X-MS-Exchange-AntiSpam-MessageData: EeBVRa+tU8VKDBSXqi1Wi2J4b2+lfI93NywDoOg6qHeFI6fFwB8yKiCGDBazNGuXmJW00X3u9gnoyYoQsEouBjVDjGXzF1p8H+9Aey3weIkuv9tUdB7mtVC92J8pEtygnE5naGi0DrBU4Neki07+/elpuksGtyIlbH0vRsNMupTwSKVYRXRefmegHeUf7EC26RclwMhcVmoR0DpkwoOL/g== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7cbcb3bf-019b-461b-4a1e-08d7d62c6fe6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:24.2401 (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: sjTAoAcXVPHktbHSsst/XcRONJHO6OOrGGVPu/YRfKXQGWMnplVAz8V6fM1TRE8kiLT+sEJNb78cY/4xaljMaA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller When a new tx_policy has to be uploaded, it is necessary to avoid any race between the frame and the policy. So, the driver stops the tx queue during tx_policy upload. However, it is not necessary to stop mac80211 queuing. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 42183c70d4df..7a7c2518f6cf 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -244,9 +244,7 @@ void wfx_tx_policy_upload_work(struct work_struct *work) container_of(work, struct wfx_vif, tx_policy_upload_work); wfx_tx_policy_upload(wvif); - wfx_tx_unlock(wvif->wdev); - wfx_tx_queues_unlock(wvif->wdev); } void wfx_tx_policy_init(struct wfx_vif *wvif) @@ -379,15 +377,9 @@ static u8 wfx_tx_get_rate_id(struct wfx_vif *wvif, dev_warn(wvif->wdev->dev, "unable to get a valid Tx policy"); if (tx_policy_renew) { - /* FIXME: It's not so optimal to stop TX queues every now and - * then. Better to reimplement task scheduling with a counter. - */ wfx_tx_lock(wvif->wdev); - wfx_tx_queues_lock(wvif->wdev); - if (!schedule_work(&wvif->tx_policy_upload_work)) { - wfx_tx_queues_unlock(wvif->wdev); + if (!schedule_work(&wvif->tx_policy_upload_work)) wfx_tx_unlock(wvif->wdev); - } } return rate_id; } From patchwork Wed Apr 1 11:03:36 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: 1265155 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=Tz5G7Bia; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk2V3Bwyz9sTF for ; Wed, 1 Apr 2020 22:08:18 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732294AbgDALEw (ORCPT ); Wed, 1 Apr 2020 07:04:52 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731343AbgDALEu (ORCPT ); Wed, 1 Apr 2020 07:04:50 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ezgj0X5ANhfgCwKx0tPEZPLj3zPO3qbcOkXD1ZqpNZcNKAHZnVZgBkEHB6Co/PyNsgVx7h3S/UeyGhEMYMO92DKO/vg5Y6517LXDyxZb3QkIyKQ51cpb84xIL98MEud//6IZzgRnAPKWYGty9HRybHOlj6FWhSwIdTibba467maoMFfypUgIvf4K+GoI/o0+PjT7bsSrY0iN62e7IfF9IOIHiqYfil4Mddo29oMc3daRkA1Q1uqv7GP/dXn5eIlPWynYTy3OdYWbCXXG0NC7Q4rL9YlTsxGGKaUlGMCGLdbUH8gjUvCBJzMLyfVl05mVVIGKRvzVe8mhaqZAxf3aDA== 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=DWgc3yIgT0IVMqNtnriEBLSEOQ8hIKhrblewei6Q9IQ=; b=XDKno/hUHHaeBD5BQfvJtVojFwQ3FKrVXgP6x+lHhp4fFAidOWUTAD/TAgl961o5rAeOPx76WtLrfvTtWxNcgbKSIAX2HwJSK2qgXzm2iEz6oXGqAIloRPzcPe6+MipiE2mJxF2MtPOv9bh8kmW5E97z3GMZmgR7gG3beO5+T2pPHGi+Q5qnb/n5V3Sg/L57l4eXwOLMyDCofnrunoZLpgLB+aFMAS98egXxBL4h47ITzJaB/Kr6gJ2kdkLIeP6iFpKhak9rv18MPKxYcEe8cG7F63KtS0gIsma90Kp9+5474Y5Tqal1pHHa9a6XXcF5voKMT59w+19M5BILwBqMDw== 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=DWgc3yIgT0IVMqNtnriEBLSEOQ8hIKhrblewei6Q9IQ=; b=Tz5G7BiaxIHSJ8pia+v14JwZWvfw2oS/Y8mWGTXpyEc3DWqK6V+3F0a9LW9DRBpgtq3uw3TwMb1cF7BTANO8Eeo3ixV8V6L8w7gOQIw2KB2Bi/+qHgnL+pxmsgiBO1VZbU/rAsBoFfYgIZ/EmPC3CPGdHtJDb+QvRvf18yGphoo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:26 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:26 +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 03/32] staging: wfx: take advantage of ieee80211_{stop/start}_queues Date: Wed, 1 Apr 2020 13:03:36 +0200 Message-Id: <20200401110405.80282-4-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:24 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 265bff3f-e095-4528-7de8-08d7d62c711a X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:334; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V77DDpPb5NcZZWoZRwVQvj/jjZpF+Wi8gH89uidbUpSXBYIWNc6tg2lsUrvVayqMdgRwIenGWAWrkjKD8BMHc3Jtl1jV7jY+lOLSu68Ps0qQmkOdXDbuupvZt3XWC3fziDw6GkYeaa5fEaoshEm45LIToESljkU7f/iaGUuAIUTM2XNVMAVdSPqtIYL9nQYigap/NMjCPN9gnN3eSFFIWX87OX4AW1ymRkEJgT/o2Ae3oK+VInygdQPABDf021u+x4A4q07MuvdpxJNN62zRn1bSEpoQLNpa2Skmzm9qFkrfFJD3wYb8W45uPCblPXkGkXSV66E0oNkA7KDIVS0VDHOqs9epTJqD8YkVXkuwvhyev/slsFbyQCZNIUc4joxiKzKs2dciCoG+ryqx9AT3qfl0LTOKpOWEl1z2jGNjgnBJ1nkXawC/lOAt+a0tTtji X-MS-Exchange-AntiSpam-MessageData: Iyz3vNLgDmF+Q1qT2A45+P3e2wr8+RBFM/CXF7sLig3SwIV95zWQ9Nf6rtRAPn//SbzTh9BGG+sM7SsCx8S7NTgSDcNr3yDiUXLDZP+wPb4D29LhYWXEKJlLtd3za68L/SXYHgjgKXQesu/COpqcjZm9XiN02JU0Eaqz3b1/QrVz8nd/x8RdS+O9CwbOwALI3W4H1mYXJKqwYW6qWoeEAg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 265bff3f-e095-4528-7de8-08d7d62c711a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:26.2839 (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: r/4orkbGu00YpjLEkadQaMn8ppx4Jb0FG36LWZMH5ERN8uaQh5RLsESxEY/n3VAl7z3c6lhqpF0XYvzmMCpYhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Instead of maintaining stop status for each queue, we can just maintain a global status for all queues. In add, wfx_tx_queues_{lock/unlock} are only used when no more tx_policies are available. Therefore, the counter of recursive locks ("tx_locked_cnt") is useless. So, wfx_tx_queues_{lock/unlock} can be replaced by ieee80211_{stop/start}_queues. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 12 ++++-------- drivers/staging/wfx/queue.c | 29 ----------------------------- drivers/staging/wfx/queue.h | 3 --- 3 files changed, 4 insertions(+), 40 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 7a7c2518f6cf..889ebc2f5d83 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -189,10 +189,8 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif, idx = entry - cache->cache; } wfx_tx_policy_use(cache, &cache->cache[idx]); - if (list_empty(&cache->free)) { - /* Lock TX queues. */ - wfx_tx_queues_lock(wvif->wdev); - } + if (list_empty(&cache->free)) + ieee80211_stop_queues(wvif->wdev->hw); spin_unlock_bh(&cache->lock); return idx; } @@ -207,10 +205,8 @@ static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx) spin_lock_bh(&cache->lock); locked = list_empty(&cache->free); usage = wfx_tx_policy_release(cache, &cache->cache[idx]); - if (locked && !usage) { - /* Unlock TX queues. */ - wfx_tx_queues_unlock(wvif->wdev); - } + if (locked && !usage) + ieee80211_wake_queues(wvif->wdev->hw); spin_unlock_bh(&cache->lock); } diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 39d9127ce4b9..e3aa1e346c70 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -55,35 +55,6 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev) wfx_tx_flush(wdev); } -void wfx_tx_queues_lock(struct wfx_dev *wdev) -{ - int i; - struct wfx_queue *queue; - - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - queue = &wdev->tx_queue[i]; - spin_lock_bh(&queue->queue.lock); - if (queue->tx_locked_cnt++ == 0) - ieee80211_stop_queue(wdev->hw, queue->queue_id); - spin_unlock_bh(&queue->queue.lock); - } -} - -void wfx_tx_queues_unlock(struct wfx_dev *wdev) -{ - int i; - struct wfx_queue *queue; - - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - queue = &wdev->tx_queue[i]; - spin_lock_bh(&queue->queue.lock); - WARN(!queue->tx_locked_cnt, "queue already unlocked"); - if (--queue->tx_locked_cnt == 0) - ieee80211_wake_queue(wdev->hw, queue->queue_id); - spin_unlock_bh(&queue->queue.lock); - } -} - /* If successful, LOCKS the TX queue! */ void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif) { diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 90bb060d1204..88ee2bf56d11 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -23,7 +23,6 @@ struct wfx_vif; struct wfx_queue { struct sk_buff_head queue; - int tx_locked_cnt; int link_map_cache[WFX_LINK_ID_MAX]; u8 queue_id; }; @@ -41,8 +40,6 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev); void wfx_tx_queues_init(struct wfx_dev *wdev); void wfx_tx_queues_deinit(struct wfx_dev *wdev); -void wfx_tx_queues_lock(struct wfx_dev *wdev); -void wfx_tx_queues_unlock(struct wfx_dev *wdev); void wfx_tx_queues_clear(struct wfx_dev *wdev); bool wfx_tx_queues_is_empty(struct wfx_dev *wdev); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); From patchwork Wed Apr 1 11:03:37 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: 1265125 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=d4WcK8K9; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjyc6TXCz9sRf for ; Wed, 1 Apr 2020 22:04:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732321AbgDALEz (ORCPT ); Wed, 1 Apr 2020 07:04:55 -0400 Received: from mail-eopbgr750040.outbound.protection.outlook.com ([40.107.75.40]:63459 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732286AbgDALEw (ORCPT ); Wed, 1 Apr 2020 07:04:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VOFEOEjVD+QWLRay/yiAxhJvmhKuQCICWdl0aISmrDOqiliTGVfTI9RKhe35ofL2jaWu0/S6OnADSwFlL+HhklZ6zea3jJu3xMdRK5ym7ATul4b6LBPSv8/HHB8k1IJGRjhhXqf0FqYejHDyFeIUpgP1RAJ7AOJ8jqPykNxGQEB+allRj1BtcE/4RuRUFOdwbur/GDpgH7DIrvXSJ3AhjyMbQWVZhD4JxA1dgb1sWV3HZURW15puFpau3eM1dbP+eMjIA/39BCHnW3DMoqTa4YbEUPMPa8ei5OhMWV7PraKHESZhwKIMjybKtgbvSxM1xSMUYI/ngtUaTB2Z6X0f+g== 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=VCPfkgAy3PBH9pmlJ2GN6+ehAcOpqsxtHV6Sw/Zy33U=; b=jWF0xycvMpj5TQwVUq0+p8snX8SjyuJbaEw+JWSysrQ1Y1+iYBy+zotWiU79noQzMGTg7gwIt3QP3xi7CvYrkPGnF+HICvlkwBWw27xGliM6VswGSoaJTmDZEr/D8f6zLH3Yluc2Ogc1VEg8cKsexIgVH5xJghj+tiOaIFqk2qOy1RlZW70R+z3DTUNSHo06p2JUDA+cs61Ttwe0dHOFRUfOQfGn0yYv/EHIGQrfqiapWunh7Tw92szgl2syyd5i8NCzT9kBhKxCqVzEsS49jNLQk/CuJgQ3SUgBSgBdWHO1y1/mx7svGfn5cw9xICvEuLuv4nQ5xDthXRJAbmcsSA== 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=VCPfkgAy3PBH9pmlJ2GN6+ehAcOpqsxtHV6Sw/Zy33U=; b=d4WcK8K9Mno8uQsFQdWNlY8wMiZu/CdTvAAYfUlPJjqQWqquhLh6a38/ecA65oavCchAE+Af6KYzOZ3xmwBkkSPmXSG4926sTce702YWG1D9GwGAwX/GPekhbbsL1dRli2sPvqtdLEQlqHI/OWLZXhp8EvYYxya8nMKtgMq4oIo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:28 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:28 +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 04/32] staging: wfx: remove "burst" mechanism Date: Wed, 1 Apr 2020 13:03:37 +0200 Message-Id: <20200401110405.80282-5-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:26 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4ff242e7-ae5e-4d69-5e79-08d7d62c7259 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +AY4YG2a8dOuFd4ioDfku/EX98dB6qTeLmwCmln+/BGpR6opoIjHeO9leB7MOj2gtTEavd5tXLhDxdNAAonQRClgFJ9FWYyh7QoNGzC969Y+SxYvpGllFpaAf7BmZY+s3Mg+es8okbx4FjXHjwd28TW2InndHzNduQmkMShjJ8KtwOnFSigzVNfa8kSEl8ptxeMRrOh96f2nGfSfPKfTQekesfcmT9ZhLtIZWBQYXZd65qXjRFz3r1kdFDPSVQ2KMQTEUoUoBva/f+qxpGZ/nN+gzj/zsFIu0NSU9h1dpaGWGr6FDwnzI8rSpPJD3la5mzCOWre9vbI4BTnx+n0AKfjeBqp/EROaGH2++AcFMmu/Dc/fpx3hhPiN/if6q/Yp0YGFPFT089VSdIAurr1zFkjWSjMbNy9oJXNNilQHbAkK40swxjFO/GAh64ES6xhf X-MS-Exchange-AntiSpam-MessageData: xXe0dl6NfpvRM9BLYGog+973QAiCd7yl19sl2HLy5bsGC2cie/GAxzb1CdhlTbTe4u7qAd+32QCpTJX/XhiiTnp4lA7rIB3QoHVME6FoMHaihHkKtq4YzJ1Tqojp36oII4ZMK7Bv9VmtbzJnCOLazATkuaSLZs3NZ6J9Xah+xnvWnYWlAiR9NpyGmMZW+E1gSBC6s/05Dz9c4j3rJfFiWw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ff242e7-ae5e-4d69-5e79-08d7d62c7259 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:28.4317 (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: D0yk9RTittMVyxHYxdafRTCt6xcfC3Z9XSoNm6X4Be1n+NZ8eDZ9ZEKLaWX4W81nOKhbayuNO90KDjbFqgGwgA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller In the old days, the driver tried to reorder frames in order to send frames from the same queue grouped to the firmware. However, the firmware is able to do the job internally for a long time. There is no reasons to keep this mechanism. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 23 ----------------------- drivers/staging/wfx/sta.c | 2 -- drivers/staging/wfx/wfx.h | 1 - 3 files changed, 26 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index e3aa1e346c70..712ac783514b 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -363,8 +363,6 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask, int *total) { - static const int urgent = BIT(WFX_LINK_ID_AFTER_DTIM) | - BIT(WFX_LINK_ID_UAPSD); const struct ieee80211_tx_queue_params *edca; unsigned int score, best = -1; int winner = -1; @@ -389,14 +387,6 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, } } - /* override winner if bursting */ - if (winner >= 0 && wvif->wdev->tx_burst_idx >= 0 && - winner != wvif->wdev->tx_burst_idx && - !wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[winner], - tx_allowed_mask & urgent) && - wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[wvif->wdev->tx_burst_idx], tx_allowed_mask)) - winner = wvif->wdev->tx_burst_idx; - return winner; } @@ -454,7 +444,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) u32 vif_tx_allowed_mask = 0; struct wfx_vif *wvif; int not_found; - int burst; int i; if (atomic_read(&wdev->tx_lock)) @@ -518,18 +507,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) if (hif_handle_tx_data(wvif, skb, queue)) continue; /* Handled by WSM */ - /* allow bursting if txop is set */ - if (wvif->edca_params[queue_num].txop) - burst = wfx_tx_queue_get_num_queued(queue, tx_allowed_mask) + 1; - else - burst = 1; - - /* store index of bursting queue */ - if (burst > 1) - wdev->tx_burst_idx = queue_num; - else - wdev->tx_burst_idx = -1; - return hif; } } diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 9d430346a58b..a275330f5518 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -531,7 +531,6 @@ static void wfx_do_join(struct wfx_vif *wvif) wfx_set_mfp(wvif, bss); - wvif->wdev->tx_burst_idx = -1; ret = hif_join(wvif, conf, wvif->channel, ssid, ssidlen); if (ret) { ieee80211_connection_loss(wvif->vif); @@ -624,7 +623,6 @@ static int wfx_start_ap(struct wfx_vif *wvif) int ret; wvif->beacon_int = wvif->vif->bss_conf.beacon_int; - wvif->wdev->tx_burst_idx = -1; ret = hif_start(wvif, &wvif->vif->bss_conf, wvif->channel); if (ret) return ret; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 8b85bb1abb9c..116f456a5da2 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -51,7 +51,6 @@ struct wfx_dev { struct wfx_hif_cmd hif_cmd; struct wfx_queue tx_queue[4]; struct wfx_queue_stats tx_queue_stats; - int tx_burst_idx; atomic_t tx_lock; atomic_t packet_id; From patchwork Wed Apr 1 11:03:38 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: 1265126 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=WSt+Ctn8; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjyh0c2hz9sRf for ; Wed, 1 Apr 2020 22:05:00 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732330AbgDALE5 (ORCPT ); Wed, 1 Apr 2020 07:04:57 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732006AbgDALEw (ORCPT ); Wed, 1 Apr 2020 07:04:52 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LV+GGhhN1PfZQVyarp2rAuF2N0/5pyOdkXKcasWfDZI0NrqUI1eskowd/IwqtdW6l5kkCZukkC0+HjBYpaXb2Ax3Z/W4aWqKhKr37/dYj1GP2RVBa4UALOsHNVYo6OPAhHLS7O1lyAlkMzBpV9Dg0Y11U68nK66OOwcm9nIhN2WO0tTyQAlCdlxhN3UMErzGEc+ncyi4wb0L6Fakp2p3J8J+dVXfPYUQ7htVK15d2Emyy8P6wyzb7Iu4ONnehO7Psh4GxKGFEQIUVgKg3jQMvyWx7uy06wPs0bMb+0ppWWD2OiD3kYCoEskZ3EPezkt/mGEubiRppov4GINyXUnzfA== 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=xwzLi39Wa5dbbIqW+KIiPUyRPUxGUWTSuGfHKr1JGww=; b=BQ+gH+GiyEWrasPSNZnALUzI9TrPyyXoe08bPypf/4cTheRVbC3d3YBO5v1GwNZ+KGr4wiAlGcZf5y+9lfi1aZwXnylGDgON3ZKUH+l1NCytEl5DzpMVgQa4BE6YNnsv3mC0Ey0i+GvoOsk/ii3wmr80c9oQWgJ8l2HTjQbAYBCiH/nyL8KMVTf3+CpMKf8fAjjz6jN0woM70obxNFwL1ES+aJCU7VcZcOsY1RDoj560s+WstPUYm1ae+oa2vE+7H/gle496yvJTGgkHI3hUdVuECoeG9gNfLSi2DGc73I8jKT7xRA3/ETTnwFgRLqiZEg0SaYu3ezHYYat6aYZT7w== 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=xwzLi39Wa5dbbIqW+KIiPUyRPUxGUWTSuGfHKr1JGww=; b=WSt+Ctn8mdWM5BsemkEDUyUzbswdAFV2OaPc/yRs/i3Y3MIpF5I8L5wD07P2Ef4AY61NwfIoHUDXkQ3pzW4QHU2n7oywMeNBc76HbpfNRHSW8DEq7MkPmGL7fg+zYcPA/aGIZPorJUf3TqLEXxpyBPw81K5PoU0wht2LoOPK9/Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:30 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:30 +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 05/32] staging: wfx: uniformize queue_id retrieval Date: Wed, 1 Apr 2020 13:03:38 +0200 Message-Id: <20200401110405.80282-6-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:28 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd866c81-bd41-4c12-7423-08d7d62c7389 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VBwNRmTRajLY+BRz45GtG05M22OMZYBifqWQr9itaZYIK1DDVjkcXP14FHMJ+DCfd7/dN8VDkIjdTsxaFfmlwa+oVq/1KmuGgiUb4hps4qwzk8bZ4UcCnRTrif0WGagW1djejUTP6zDnfqKYGt6Yx9/esetp6t0bKOdTGJZ6UkIDs4celrcUEdO+6RfbhaWo2Xu+Q9iBj7/oHvxB8o4Jih+Ltisq2ymkuKjG4jcxADfZeK5rVtrnhJxU3WF75kxGkSuODbS1+F915VupWt5Dvfz8xX7cMv+V/LQ66lPuu92//65bO8IGQChh4fQxDlRhOb1LBreS5x4v9hg5ixi1+ja2BCmAWLYPJdXj3NG8DGrICCZ3bxboPfdcOxK5WBopWgs2/FBPb8FBohiCx1gX8jEssIYYpFn9G30CbTLU6uKCUORFmPUBWBegUyMx8Zq9 X-MS-Exchange-AntiSpam-MessageData: y8f3sTb/7OndmjxeMPrechCp6v96URdKMCmH47vvOKFiBaTT0cq0J+71P+nSSSULzh75W9gS7LXzK8j5T3Zpbl4hBxOniYUG1edAYEWJlj4kU5HEiWRLiTU+ryOSmQH19mK/3mGt1uSGDde+AwDLwAk9FNYJodjJYfAyfgpu4PsLkFhhApZHstDCLq5ThyOBPoCAJj4xaconXTwoJdt4Kg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd866c81-bd41-4c12-7423-08d7d62c7389 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:30.4316 (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: NJIgiSsRErFSIoUlGcfFJ/gbyj8S5HpuOog6O864WCKjICJlOKOZyyv+OP4uaF/7yCG7In5ks3briHD2DHoVuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller tx_info->hw_queue contains "vif.hw_queue[skb_get_queue_mapping(skb)]". For now, it is equivalent of "skb_get_queue_mapping(skb)". However, it is not the same semantic. In wfx_tx_inner(), we want to get the mac80211 queue index, not the hardware queue index. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 889ebc2f5d83..8e4c3e1aadfd 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -417,7 +417,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; - int queue_id = tx_info->hw_queue; + int queue_id = skb_get_queue_mapping(skb); size_t offset = (size_t)skb->data & 3; int wmsg_len = sizeof(struct hif_msg) + sizeof(struct hif_req_tx) + offset; From patchwork Wed Apr 1 11:03:39 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: 1265154 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=fiaS0vLE; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk2Q513hz9sTF for ; Wed, 1 Apr 2020 22:08:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732767AbgDALIK (ORCPT ); Wed, 1 Apr 2020 07:08:10 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732299AbgDALEx (ORCPT ); Wed, 1 Apr 2020 07:04:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pk/2UwYSZf0B50QLgcFDU0VB/yRWHdyhG4+uJenrjkaOsuXMZ8AtCSQg3OYOIvEBCe7vVePE35QFXB15uFCfc1AiV2+eDSox8W5+laAMZZbm+k95mgADI2oQJU04u3embjJ2k5ac9P/hdbo0syFg+iWr+3eu9Qh/ReELxGi0F2NvraS51mugW4ShHL0/dzyOOmzY8RL46QO8Mv2YFb7jx1nj7z5/21JnypqeCeI5xEQLVdnOaDJebdpFmV0BSSMY6rvdVfTjJhiMteI7vBnd9WAf3bk49TCnGveBGEorbtr+fAId+nTiHO6suLjkZPbeJIM0Y/mVOm+squc3b4s1kw== 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=elWr9kqCLKIQtMXJG2yerf++exc0/sxLlm3itODnK0Q=; b=DMWbS7RN5I2X/Lv/v6tHn5HbbKjYWMXTyi9ZQrdATmcdzsxbqjgP4TE4kqEYJF6Iqyg5WWIboayJE0zeg3KETHXiDHQXZE5NvhOPAo/LAsKfgV9b8xUerDK0PDUkrIJchLNMyGYJXhMcFuKI9Vh0qfJrqrzUc8bCnX8nBdzweyvo4k7xKAjZEn3GSppexxbrc/TldQDVV6Ce26Ab8qXe49eqie/uU2Auv0j98FIkGGkpAJ6Yi7k9gpHmmMWQ+5R+1BOPaVjhxgTWEOFwyNKk9MipKpsknCIFPvbTEDVPtx2HDN+UcrqHMVP48If3KxdB/ruugMXEDHPyjgG9sB0LVA== 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=elWr9kqCLKIQtMXJG2yerf++exc0/sxLlm3itODnK0Q=; b=fiaS0vLEt0Y77Ublwuc63p1Wv5lwA9QLjSpseagDXy1btpNYjMvqLh72E9X8+3lVkiJwGYWgP+Ier0oj+L/wZmmG8BZiJ+R+OlAvUqYq7n6P7BydhezDcLl7I/yxHtPdjyDO+htE2vXTgxR9Xp7f7E1TMAkn9eHuDaLA9FklF9A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:32 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:32 +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 06/32] staging: wfx: drop useless queue_id field Date: Wed, 1 Apr 2020 13:03:39 +0200 Message-Id: <20200401110405.80282-7-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:30 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8cb5b941-49c3-45f5-a747-08d7d62c74c6 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:517; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FjUcVrc19b77UE/LiC27DwDMgUwvkJbR+aRlrppbIQWcwLFhBWuaaUA1RkuvGH69gAHm7gDeuHBBEeNLQfJybiMimVOvP2U6d+PZ4frMwvto3CT50JxQNGAMSxngPKg3fOmwpghaYDjnrzMuJTgnoPiCFJxvnwoCkCk+o40exdj8KZFVi99L2X8jDqOzCARVb4fGvxsjzovj7v5CYNzKSpMMsZSXihQ/9YZMgOSPgichLuBmJ38DMwWvUavcPMDWjrRC2IlzwltgwZPD+c+mG9UYFTWmMLEEMDrvNjmrYr5vuvpYDoYhyfEvYr1EhWgym3iMEinPWDdkRyOcoV2iT+WeNDb354AXmPlu8gfhtQ1jl4E6PyQEsUofVJzU+3f99VZ4eoHSCTgptB73wq8/eRpSNT1743ieSAHpHbKF4gJzclQItXNmk3faQtTUE+dK X-MS-Exchange-AntiSpam-MessageData: 1fVJeU1LCqREDUVC00LynFiDFG/9UjDT2vtZteXmP4A8ahTBmJ9cLlfAoRclG5MpXYi3CKxytpP66u94/lg9UhJxACE+EmVEv/Dl69W5tLktn+C/SkWIEPR+c8YVIEmUk94lq3cyq2HXVuk5DkS+6rFrOBE0VO/nEctfBs5u7A2Fxf0yqpdrXTy/E9eRq+g2JFXAESEUAE7M8RxNMtW9+g== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cb5b941-49c3-45f5-a747-08d7d62c74c6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:32.4984 (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: tLrsWnjKSwbpKVtnFYVZgJqRtpll81G5EzGF0ybC0YPNksrA6tFN4GZ2c3wQYeoJclR86mwwOmFXlTV2Y0oNSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The field queue_id is no more used. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 4 +--- drivers/staging/wfx/queue.h | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 712ac783514b..1df3b6f28c67 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -134,10 +134,8 @@ void wfx_tx_queues_init(struct wfx_dev *wdev) skb_queue_head_init(&wdev->tx_queue_stats.pending); init_waitqueue_head(&wdev->tx_queue_stats.wait_link_id_empty); - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - wdev->tx_queue[i].queue_id = i; + for (i = 0; i < IEEE80211_NUM_ACS; ++i) skb_queue_head_init(&wdev->tx_queue[i].queue); - } } void wfx_tx_queues_deinit(struct wfx_dev *wdev) diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 88ee2bf56d11..2284fa64b625 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -24,7 +24,6 @@ struct wfx_vif; struct wfx_queue { struct sk_buff_head queue; int link_map_cache[WFX_LINK_ID_MAX]; - u8 queue_id; }; struct wfx_queue_stats { From patchwork Wed Apr 1 11:03:40 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: 1265153 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=fLmgbxpW; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk2H6k8hz9sTF for ; Wed, 1 Apr 2020 22:08:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732256AbgDALIB (ORCPT ); Wed, 1 Apr 2020 07:08:01 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731343AbgDALEy (ORCPT ); Wed, 1 Apr 2020 07:04:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fCuts7Esk0QK6OgjulZiff6pUJKK1lPwEuM3w4JCULnsdquImgSwe2DsPvGw9dWMjjWGRVg0b8mNagzX/kB3gDFthE9Jg8nXaRIlu7keIC92YtKVWJ2Z8YVLIwsDJf4nxQOT3tnoBx3cdjgiMiaOsPp8gKVLta0npp/fiXPjoghNNiEb9TV8DuOAes01k7KIuDlvuWfeDb72o2QBvosfUL7eAezamqszig0itNbTzz7sBPlom/zY9iJr15Z3sSdidsd0/lcxvaBqPtiHCREsM3J4YizVf1AFTnA3j8Gd7u6YQxS74DcQQKl8ozfKRgG3+A0TXGpRc7tYUHIIzPCZ3g== 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=nJVaYPTTz7XNAS584fc+n8puN+xxXPzKeuB+iorTlwI=; b=Vdvnv6hN53CptSc2KF/vWbnwPcEdOnopYwxh0ILizoeiXPksZ2r8CXioG2gNUtwr/e2e1+3gQNCDUx5I3P3W3U0bxUUldoj8LoJ++cMhXhBCvmaHm8ukzA02y4emMp9lTeoe8ORZf1jd/A6nmf3boTIJbsCv3YBffYS0SbFQkd+Y5/n6g9rCOTENzNemqkDXrt41MN9aRDOMY3qxpe26RbLKEHIMwlcn2G8N3I6V6Sr9vWtbbfNMyqD58mocY0h5CAH5d6ztW6yjH5UaBnbTji2vnGM3KUeCWkbnLO0ZaZrAnI5rw4ub73yXbgY4csTqRm6elEO+cjAM80c9ekFHBw== 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=nJVaYPTTz7XNAS584fc+n8puN+xxXPzKeuB+iorTlwI=; b=fLmgbxpWRCdzzeind+o5O1/nOc1CbKvcWlYAHWC8FHwYPgR85+CQKxofLq7fAZmj4pGd7gqO0jzGkCJ3q3hxYS7oejp8r0pKAiuqmDV5ExsapkNO2TTxvE3SsRHt37R3q/BvZp/vSmOQK8VGXDJyzEOE0DgExd4lEO1oeNKYzzg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:34 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:34 +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 07/32] staging: wfx: avoid useless wake_up Date: Wed, 1 Apr 2020 13:03:40 +0200 Message-Id: <20200401110405.80282-8-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:32 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd05c000-c114-4b59-c9c5-08d7d62c75f9 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ArJAtIy7VHKDp5zet8JMwOH8u2u+JpDDqI/50b3sihKxYgcP9P4P6ThARsT6+z6Y+ykTEZxS93WwOl7SlEtP/4SbXsppay1vRj02VtSLPKoe7JDj91TPNZGeuer2YUM009O2lbnlBPKOHRk9OzalFmiZD+AzWTG6j4MrwghH7mjV2kCHVUTiWjJyqqQ6s7kubJkmJcLFagcbDZt35GCAi2jWyLHlfbEk70T2N0E2srw3Wg1uoMITtitYDaUmtIx04C7CIpnXp1EkSdu5jWbr4vvt4v9kmJ+PtOUBrSuu6j3ElTBJgZrMWEVLB1gt2xYA5coQUzmHMcYMyVPCoteZD5mfZz+qUJW6Eae+f3ykEAcnYyhY+fHX5GNtu78KB0dhe3IHtDXA14kcRyppSwY5uZr7R4lsNUQWnr2PhODnG2399ncV9YTbVoxLH/+gMDz7 X-MS-Exchange-AntiSpam-MessageData: g1IjWURb5emZg+p3tiR/ohcb12FoQXZJbHQGAIL9hYASgGujiQt4jd+/C2EvsLUBrh3QQhFvwWJ09NK9+JESvmse4u9PnoL63vZULMHhg4udiXmvVf0jACx3Cj39+TxQ8U89Y+TTfsISAQoL5c0PHEdsgZg1rzX0fZKY5QCRAtXztSwxvLogdLVDgkOEaBxuggoD1vNQCmk6rCFo4bZEbQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd05c000-c114-4b59-c9c5-08d7d62c75f9 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:34.4832 (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: 8dO0XJOUY5b9hNgQBqrK1+bUCAxko2ihiR+vleUnYxBuvz2V0kxt3LSVQpthu/tNkXrbQGhsPwd8lyBWiJ/rvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller __wfx_flush() wait for all queues to be empty. In current code, wait_link_id_empty is wake up each time there is no more data for a station. We can simplify the processing and avoid some wake-up by raising this event only when the queue is empty. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 1df3b6f28c67..2553f77522d9 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -190,7 +190,6 @@ static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, struct sk_buff *item; struct wfx_queue_stats *stats = &wdev->tx_queue_stats; struct wfx_tx_priv *tx_priv; - bool wakeup_stats = false; spin_lock_bh(&queue->queue.lock); skb_queue_walk(&queue->queue, item) { @@ -208,12 +207,11 @@ static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, spin_lock_nested(&stats->pending.lock, 1); __skb_queue_tail(&stats->pending, skb); - if (!--stats->link_map_cache[tx_priv->link_id]) - wakeup_stats = true; + --stats->link_map_cache[tx_priv->link_id]; spin_unlock(&stats->pending.lock); } spin_unlock_bh(&queue->queue.lock); - if (wakeup_stats) + if (skb_queue_empty(&queue->queue)) wake_up(&stats->wait_link_id_empty); return skb; } From patchwork Wed Apr 1 11:03:41 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: 1265152 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=TSzlJPgT; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk226tWKz9sT6 for ; Wed, 1 Apr 2020 22:07:54 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732615AbgDALHw (ORCPT ); Wed, 1 Apr 2020 07:07:52 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732312AbgDALEz (ORCPT ); Wed, 1 Apr 2020 07:04:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AVxqCNBlB0I8Pcq4tmBXgOUuuEWsInjRfMH/UdAyEnUmXYSX1XLaoSPk6aUfPoOmPFqM5JzW7mR3SZ7WUji2YJm/c10SbeiTjLt2dIOGGaHyBE3E1DGrzAkNbcW20nSLJNlt7ccpd/Ky8y2Hgl3n6ur6C6OAdcN0WDM+Glg77MiQJRRKeIWKz3xM2lzO5vmcaGbMRlgS2F6IS0pvqf75IkCIFOt1ATQZEsszTqOZeWK+cWlryDCMwPNIjp4vlDa/dqVoDRo+29yo9W5xTXel9C2yDA2/Q6h2Snbziu//MK0gA7CY/G/IB0tytIWohlAusiJVWPYqBELGjDUK0zut5g== 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=Ixh1kI1Qt5S2Eb+CPATQzrHK332RntXNptR9YznsozY=; b=HQM2AMzCl2XTn3EEl8sOhUgWWD01rhARF4Bpoxiggj6uhtT57qwLu759R+IwMSUyJO92IYd7iIcfolIn6HRZ8094oKYXIVnQkraOUWPzMeYk+MQXc7MpA7SAhRWY1jwF1R0Vcout8kx/Y7b1q87PhQzUBaMdBAPfLnVPUHs30IuHLmyzXiaRP2rtah2QjfwFICgPGGZDB3Z/2VeNq1TBB5r3T8Pmr0mMoW9M3JdG0SBAjmnB7iDok3XHyzKRS72N1orTwxE5Hd5tF++n/B742gZDoGkMG2ICm5ZZGTZ19SntVumGUurPdSKybCUDmeG9PeYKqTYxapV/AdKWnaYuug== 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=Ixh1kI1Qt5S2Eb+CPATQzrHK332RntXNptR9YznsozY=; b=TSzlJPgTZ7w9XMBwS2lLw+soowe8HXWRb6J3CiRIG+Hg8C49fWlNePomosDZ4ISRx4kVWqwlv4lQ/ct0qE1NITBDvCQomS0sgzw7lrUJKhsoEeXwuzRFvujxMpIdgjPxYxEw3LSM/szt98ORgvSEvj6fejejxQzVFFNIZtQdrZo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:36 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:36 +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/32] staging: wfx: simplify hif_handle_tx_data() Date: Wed, 1 Apr 2020 13:03:41 +0200 Message-Id: <20200401110405.80282-9-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:34 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ebcc93b-d074-446a-d67e-08d7d62c772d X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4hp4Kt/JEx7J1c18Z1udEV141S4a1O84JN6cYovakw+E1NDq8V+OI2hVeQ975qTCum45wGxT3R8KxwGNDHpWLBKWlhIL4gJLjrMO84PmxawjVtehcKWUkKUI2T3zp/JHWO6z6KAjFvS0LpMIT9lgyJZ8wUfWUZ4r/vKQ/diq97q/iZo7jzKtUcnudubdaTIWiT70IhMNdzmp9ucg28QlP5fI2/2A0tqwQQYl+m0vuUg5KnH4kJa3atob8Q1XisXx+CoSxBmFEzgTcL4FiDm4eP81x20gXnvOCFPCauKTFHMADh8PoLbcLBI1E0GxL2Aw3q6n0odvuHRPO6qS+6WBKf9McSi2HI831hNzShZnoKgRlOOphuYTjBwBT0Q0o87m9FN1yHr0kLsmPqI4ecNrjU82WEO0kDHopwns4Jntwy5SAmz0/rkGVEsIGw8MuZ5X X-MS-Exchange-AntiSpam-MessageData: gv7ksC2TDwtcWJ9daevmbuJkZg6g0VnZ7v6tHGvbsT1AmwO9aJB9n0jBvVdBmc3v7569SInypzY2u5jqhnWT34yT+/zc74FxPMCTjoHiS6T5UQid0XAlE8mNisTsZlrZ6H+7QZ7o+aMnLtroF2j2A9qwfywHaw7bvygHw06ilnSi1XEAXTvkPBVWmRNjzE5PtiKtCVnOcDo1o8rvgMEQYQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ebcc93b-d074-446a-d67e-08d7d62c772d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:36.5210 (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: pl2jMYeIPnlCPCtKJIwj/rOaHclvqIqB9r3IAT9s90e1J5ZFbLATsjs2El3hk5J6x0qFPexL7BUNUFnCBK50cQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The last argument of hif_handle_tx_data() was now unused. In add, hif_handle_tx_data() has nothing to do with HIF layer and should be renamed. Finally, it not convenient to pass a wfx_vif as parameter. It is easier to let hif_handle_tx_data() find the interface itself. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 2553f77522d9..8647731e02c0 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -319,13 +319,17 @@ bool wfx_tx_queues_is_empty(struct wfx_dev *wdev) return ret; } -static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, - struct wfx_queue *queue) +static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) { struct hif_req_tx *req = wfx_skb_txreq(skb); struct ieee80211_key_conf *hw_key = wfx_skb_tx_priv(skb)->hw_key; struct ieee80211_hdr *frame = (struct ieee80211_hdr *)(req->frame + req->data_flags.fc_offset); + struct wfx_vif *wvif = + wdev_to_wvif(wdev, ((struct hif_msg *)skb->data)->interface); + + if (!wvif) + return false; // FIXME: mac80211 is smart enough to handle BSS loss. Driver should not // try to do anything about that. @@ -344,12 +348,12 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, hw_key && hw_key->keyidx != wvif->wep_default_key_id && (hw_key->cipher == WLAN_CIPHER_SUITE_WEP40 || hw_key->cipher == WLAN_CIPHER_SUITE_WEP104)) { - wfx_tx_lock(wvif->wdev); + wfx_tx_lock(wdev); WARN_ON(wvif->wep_pending_skb); wvif->wep_default_key_id = hw_key->keyidx; wvif->wep_pending_skb = skb; if (!schedule_work(&wvif->wep_key_work)) - wfx_tx_unlock(wvif->wdev); + wfx_tx_unlock(wdev); return true; } else { return false; @@ -496,13 +500,10 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) skb = wfx_tx_queue_get(wdev, queue, tx_allowed_mask); if (!skb) continue; - hif = (struct hif_msg *)skb->data; - wvif = wdev_to_wvif(wdev, hif->interface); - WARN_ON(!wvif); - if (hif_handle_tx_data(wvif, skb, queue)) + if (wfx_handle_tx_data(wdev, skb)) continue; /* Handled by WSM */ - return hif; + return (struct hif_msg *)skb->data; } } From patchwork Wed Apr 1 11:03:42 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: 1265146 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=JkRezrZF; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk1J5wThz9sT2 for ; Wed, 1 Apr 2020 22:07:16 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732376AbgDALFF (ORCPT ); Wed, 1 Apr 2020 07:05:05 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732336AbgDALE7 (ORCPT ); Wed, 1 Apr 2020 07:04:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EXpNqxVZ36DKGXSO4zUy6HJII2UTmqpgYtmHHc5vF2vzycgIxxIG84xLs+Y7r00fn/ttXekr/HZEsnRo4S0xALBpdqxrMZeLGcldpT+iO/JBhXSjuEnWkVZsOmKUWBaORAmAox3Kh4j7scLPXjsAXHBTLGFdAI5rPMV1rY7XUkIx44OtKHtxKEwUVsalYjcEOpN97DiNUXmwVMYiUrCmyS9rlRg5FQnA7eMtcJTrDZYryulAx3o+s1g9d9HLiZDkbwVwlfm4dgoU7Sx8D3JdZQ5BcssuRSp6r+sVG1PaBhiWVC3ok5W2sPnsKLI5FLWrtkn36m4vlbA2CPU4JLqWvg== 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=x+eX5nf2XUfm/gzl2JO527/3MkvsW0eUhq6lGEQMTLQ=; b=EOWq9n8zYJ0n/2PtF7llRg38kqrDT8fDWto1smtC8JCdDWBjL6nvkIrl5iIjBcsjqPswyBj+QNv/UNcDq4Pn8R4XGEkzLAMmTQV6JxerbkBEPuo78I6T7jg6r+nAvS2IOiPHTaDEh91yUDXqzArCLWO/vM/k3t3x9WYMRxwXvsa3HKTHqaqxhlpKlROV1QGeBE+xSSUMfGEorJTLpMO4s6M68lL4c5X/zefUUFyfLHtcyYvUFO4TYl6cfo+HjGEvEOUXWOB/lBbldklpZwFQKAvSOaO+JqvcT+A0nW4t7/UTwLao194IJMfxwYSrZMgo4xgMX42yyJRdpVPP0kdUVQ== 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=x+eX5nf2XUfm/gzl2JO527/3MkvsW0eUhq6lGEQMTLQ=; b=JkRezrZFi0T8U20gHfu3OTHCwWTrS4U5vU34154jj/XLcdpl7iUw0MlPnwXyuDGnKsHvGYRiHhh6dCkR2jUXTc5tR8xEOCVSg64aoT77p0qtsWhaeAHBAfz7Xz05O8wnCLg4ldL6sigZCGSsw2JCRNEXSYQlJ1Wx1WxWSmczPi4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:38 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:38 +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 09/32] staging: wfx: simplify wfx_tx_queues_empty() Date: Wed, 1 Apr 2020 13:03:42 +0200 Message-Id: <20200401110405.80282-10-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:36 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89ec6921-7e35-4b4b-8487-08d7d62c7857 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iN0tFBjk/Ff/Imcr0m8ioARP9oqpF6JFePGGsJw137nnI1zrjx/QZXKbBToEQVUTYlbTplRnGiAoS3eimYyo8VHEQmnan7z6jcP3NLhdSXBWZKNUBqpzBgjq407Ig2NVwY6yU5PJklidHvZj3T3UrK5SwrKwHLnG8uxXO+ZySBykEzh7DdqZTfLu8p271TvTrlnF4E+dlbGyirFG15b6i0WZfBvJA+oUeK0fxnYREZ7hmz6ZTDrVVH/8R/i69+HBzxBS3QDcMk06yK9hKeM112AVH/G06Hq3VCGCRCQgyKlsaHDvxC/0DTNGFLVt6zoNplXmel3E4nfq7OVv3oeSzq3PeSJuHCZ6EqUyVNVGRUPXlpikagxJB65MMxdpqKQPByyHy6zmuRkNFi3e6AyY8MVxit460ulNyP4d1a1vwtcB4ZXvfhoY43XxD3LuiwMK X-MS-Exchange-AntiSpam-MessageData: 0tl48AQxG9HbRamJmOO/lLtYySxapJK/1fijyp7SPfELAmCbtWzansTV+lE9fuTO+iopeaRQuXYVnr8weWz0T087TgFhsuSz5a6qIaLcdUpJT1BMevKa4VKl+w0RJN5E/JK5WHJ/Bsk5o2vf5vyid6nnRVGyH9TMEerLuOA+ZIrRWK0uTo9gtvY39emfFtfGFXa8Gxx2KDfssFDLmIEbXg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89ec6921-7e35-4b4b-8487-08d7d62c7857 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:38.5489 (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: XRa6XDyMQlaqq1PJxZMRF1c43d6kAHeNYaneluqMTnLz+IKj2Bq03MKJ5VRQ2g1+UDg9JCXezqw0ADHXMiWxQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Thanks to skb_queue_empty_lockless(), it is not necessary to acquire the spin_lock before to check if the queue is empty. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 16 +++++----------- drivers/staging/wfx/queue.h | 2 +- drivers/staging/wfx/sta.c | 4 ++-- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 8647731e02c0..09f823929fb6 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -303,20 +303,14 @@ unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, return ktime_us_delta(now, tx_priv->xmit_timestamp); } -bool wfx_tx_queues_is_empty(struct wfx_dev *wdev) +bool wfx_tx_queues_empty(struct wfx_dev *wdev) { int i; - struct sk_buff_head *queue; - bool ret = true; - for (i = 0; i < IEEE80211_NUM_ACS; i++) { - queue = &wdev->tx_queue[i].queue; - spin_lock_bh(&queue->lock); - if (!skb_queue_empty(queue)) - ret = false; - spin_unlock_bh(&queue->lock); - } - return ret; + for (i = 0; i < IEEE80211_NUM_ACS; i++) + if (!skb_queue_empty_lockless(&wdev->tx_queue[i].queue)) + return false; + return true; } static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 2284fa64b625..5a5aa38dbb2f 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -40,7 +40,7 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev); void wfx_tx_queues_init(struct wfx_dev *wdev); void wfx_tx_queues_deinit(struct wfx_dev *wdev); void wfx_tx_queues_clear(struct wfx_dev *wdev); -bool wfx_tx_queues_is_empty(struct wfx_dev *wdev); +bool wfx_tx_queues_empty(struct wfx_dev *wdev); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index a275330f5518..be493b5f2b5d 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -325,11 +325,11 @@ static int __wfx_flush(struct wfx_dev *wdev, bool drop) if (drop) wfx_tx_queues_clear(wdev); if (wait_event_timeout(wdev->tx_queue_stats.wait_link_id_empty, - wfx_tx_queues_is_empty(wdev), + wfx_tx_queues_empty(wdev), 2 * HZ) <= 0) return -ETIMEDOUT; wfx_tx_flush(wdev); - if (wfx_tx_queues_is_empty(wdev)) + if (wfx_tx_queues_empty(wdev)) return 0; dev_warn(wdev->dev, "frames queued while flushing tx queues"); } From patchwork Wed Apr 1 11:03:43 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: 1265149 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=hOTvwm/W; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk1h0BYTz9sSr for ; Wed, 1 Apr 2020 22:07:36 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732358AbgDALFD (ORCPT ); Wed, 1 Apr 2020 07:05:03 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732335AbgDALE7 (ORCPT ); Wed, 1 Apr 2020 07:04:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oWEweFxP8RflJJVWA1cp8SZjkDPllXFmen0QHeZGAfTm2wVXL0Ckm2wRu8EUKV8ftuGfgYrY15DaLeImd2CmhdCvx+YhDVigux4zVOlHTqfltCt2G1zsCch5Hl/FG75r2xlncGNag+z9HT6hXtXl1BfBn7z2rijYX+RSPNGH2XbnaiHN1BD6X6yNxkHAH8F+tC33L/GRVQpaX0WF4cXR6+1Lswu7tUlfJbCrXsss7SNkYh4LgPBO9mojVkoCzPS8T/X5IsjpEbB9ML220jK3DHzc2gG3Pe/YRibRTTs8yQCqY6fmeRp5NPEiSpbYHJW5kz/cWGvXrYms/4pAkEyjqQ== 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=+PagPWzCkbCX2OEL2UTnVfEMuWRkvSgV+q27nmCjK0c=; b=OsIfBnr343ELacbhqr3VyvOfhgL5gYSZhfOYIG7JWC9NLxH/pl6ItuQtj/vRm04Kooosxl9HXpa0Y8I1vBkomQg4MAtjmDj/9mfWFM1FHK7X8h7HlIX+NsbAbn21JJgzhLAaMHq/nYRkhotIJn1neJabS/I/CZl+KIql21vBmWL3Ra1cQ/OFaU1mYczpAjkBfilgaRqfoHMgAxYbmBBTTNE2g06tA9J4DdPEiSXQyAKbBDI5d9y40geTxbpR8GCqTwIa0FqGS6LMu2zO78ntIfHSkRVbngiIcPYxTLmNQ1uh/Lw40Un4U4G29/8ClVv5PihuQAs1LvFNFXrVW5btOQ== 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=+PagPWzCkbCX2OEL2UTnVfEMuWRkvSgV+q27nmCjK0c=; b=hOTvwm/WTOu87pcv63FAM2QqgmQ/eKLvSxzMyEnJpvK+QC3C8TCUM4RWMO4TQOv3geOcLqr57/feQx4w0kIadDDTnoXZfMGzjTNJbMF2/pXFnG+UrLxCtOZj+mClG7Wbe0LCn3gQ3Ts9SbgMm1CCaAAp4y9RuPOFOFZAEEeQsiQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:40 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:40 +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 10/32] staging: wfx: drop unused argument in wfx_get_prio_queue() Date: Wed, 1 Apr 2020 13:03:43 +0200 Message-Id: <20200401110405.80282-11-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:38 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 618bdf62-16e4-4f0a-8cc6-08d7d62c798d X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:350; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xEuvXvVE/+Tz0lLp94EZRk9RJ679sjNbPKe0K9WGp7V+tMx6vTBe449RoqgBTnmUoym/imY633wE+JFFtqaNZLtpf9r5MXImWvDpd7+IdVNag/4vP9uVtTOt7t5rbluJdTUhCwy10oiFB/bqtZX7pcjJgwXTfCe1l1T7zF9QZNp6xZYXQQwzDGETVFkYUULVdmbzQHFJAzKD7ISaEOEdJgcETpJW7/awRiq5ExCtoMMlXzNeZz9NNjj0eMvFs7H2JAYkdxadfvN4Wi5LqmSqeEzN/zddlsEemxYWUVAbxJMMfXjytT5Mw3rwuXjnsfQX0aEBOq3sC+IUHnJ6BIJjPyGdyTCnE8Q3BN46PdqQA2gTIuaBF9oYoKuM+mCeHz7BWTWJ/Y1gEQK1xUcQEnOEdPLMYCJ9qLh5ilVk8Anv4rTNwcztjZM2e511PwLao/D0 X-MS-Exchange-AntiSpam-MessageData: 0eyCTxWLkrtAZYOo7FMivaaYEsNs1FDNk9ibxdJIHxLMoiMXIn557iBQh9cfNrHeX0BhjfspPeqbTKwqeEkIH9+xCgT0RNt8b+aRIsmQJAap9zbVNmn3iL/+LasBPMyp1x93ULCMa7w3sOKw97jzyABq5vFbuWVwPq/pIc1bqtsi7B7kKepBITGKOClwm5KrHBz043a02GvBn/ym4hWBHw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 618bdf62-16e4-4f0a-8cc6-08d7d62c798d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:40.4728 (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: Gh9anUq6+mEcNY6CCcwbfnh2IQz9m3iczXdM7cQUx857mLZ0TI/jdzR10i0pey/ppBaR4FNu4NgoXBPiUHjOcQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The argument "total" is not used anymore since commit a3c529a83589 ("staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM"). Fixes: a3c529a83589 ("staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 09f823929fb6..bbab6b192b0c 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -354,8 +354,7 @@ static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) } } -static int wfx_get_prio_queue(struct wfx_vif *wvif, - u32 tx_allowed_mask, int *total) +static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) { const struct ieee80211_tx_queue_params *edca; unsigned int score, best = -1; @@ -371,7 +370,6 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, tx_allowed_mask); if (!queued) continue; - *total += queued; score = ((edca->aifs + edca->cw_min) << 16) + ((edca->cw_max - edca->cw_min) * (get_random_int() & 0xFFFF)); @@ -390,7 +388,6 @@ static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, { int idx; u32 tx_allowed_mask; - int total = 0; /* Search for unicast traffic */ tx_allowed_mask = ~wvif->sta_asleep_mask; @@ -399,7 +396,7 @@ static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM); else tx_allowed_mask |= BIT(WFX_LINK_ID_AFTER_DTIM); - idx = wfx_get_prio_queue(wvif, tx_allowed_mask, &total); + idx = wfx_get_prio_queue(wvif, tx_allowed_mask); if (idx < 0) return -ENOENT; From patchwork Wed Apr 1 11:03:44 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: 1265151 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=QWCHOiXW; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk1t2qWPz9sRf for ; Wed, 1 Apr 2020 22:07:46 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732750AbgDALHn (ORCPT ); Wed, 1 Apr 2020 07:07:43 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732006AbgDALFC (ORCPT ); Wed, 1 Apr 2020 07:05:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UMjCCSfMFGMYz4Xy9NFmXPU4fVd+zjN9MPvzmM/hCZvBa2GA3x+5VuSuuaw2VUhsfspNOt5TmMzsIdG0JFCX6UUx1y6Szy6Y4K4Vmy+1iX8fUknb1AHCBOxLfEKT8Y2IXawUBO0ZlDGrbSWNxqkAFdTXnWpx+HWi083Ac4qSo5L4h6kuYKN1xfmPCDi8B2EFdBz0o5g8ULJFZmG772v884beGq6UhKuCWz/usLeSd786U0pYPP1Z54OmyPGFM2pRhX4X5lXU67t9Tvu9leoHbRb4I0bnDQGLusk0pPzmvYidZFGCeFA9L8uTzssU04jN705CnOoUnfdtdRyJhLK2Og== 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=OI17RmbECAmpL6nfGn5OFPse05O3F+L2zD1msQh2kXI=; b=EAsRE6kxVp9Yff85cgMkacor0k9kP+zhuqj9M0LNcV8at95HI+IN4w5Vo+hmDK80O/m0jvlgJijRNoL7eZcs3fT/EtG4IN9xrStwmCGkopJTIb63EQsT3xT+SrY99oGbrozw/YKqDRdxRUifkb7ni/t4w+K219wCPSmp43BbFa8Jy2lCpZPlAReAsDhggKaSBx5eXzSiTFnoHwG7iUlVzrPHZE7BHfHyyv0SkPb5w9wj3ZbO2Q9/kOfoYb5z8dJ0H0RaqoZTuftijL2Qoc7SPhZRIAfkfwRGfo6S1SLwzqU2dpcE95FYzYqxnzr+ae6bv//do3Uc1pJsm7eDmG/zNQ== 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=OI17RmbECAmpL6nfGn5OFPse05O3F+L2zD1msQh2kXI=; b=QWCHOiXW3V3yZYw9A6DYR80QwD5dw70eCLp2+znZk7sKblRvvWtMB9BN99ZibqS+A66nxi+iDmxQwvo85r9ZT6MgDn516qbBYOGRunvbwsaXsKY72MCId449/wXJQJhGoTEpxvXr+pnjBCOwK/NzHEecbp/czcbFO+9HQebJqPg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:42 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:42 +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 11/32] staging: wfx: simplify wfx_tx_queue_mask_get() Date: Wed, 1 Apr 2020 13:03:44 +0200 Message-Id: <20200401110405.80282-12-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:40 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 405b75bb-a459-4b5d-4c19-08d7d62c7ab8 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:862; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RlIQgCWSZjSOX6jN7lKkQxMCESRlzwO5ntHB0S0gJczTzTn0lXr15WHr31gM8VGwGoxHDIURK2bzHuZiXZ4rZ8kQq/TixDhZQbeDqJdViuQfKGgwjXSAtHMIpoxVh8h9M2MNOg+ax0LJBiiveZlAlwkY9MihN8I7c0bQCpnOpLly91090rgk+hE1aIHMNYhB7UYyxoWs8vAXaUyXF4L/VoXqtMyer3osAbgQBufOWEcning4JaoIqOVBcQSlN0On75a8m28oqWE6W6b/RrI8ZRWNk+FXprmmvUOEJcJttuc1RsMKNi8cJjNl+PvMUgG+eUIP6GgEKkEyT32rC9r6UOLssp125ODULpmfqM34d7vAuU9Mh3Rzla+m5iZ8DzsaAWXikfE2Ga+Rnflu+Oc4MVhlQTFZFvvpfhJaU6KWZv/4bQvRCjtgIVVK82I5pAMk X-MS-Exchange-AntiSpam-MessageData: gRnXkQs4G/5j0sODkYCWlYp0OXMMSV++WlxnVxclVT6tJYb29NFZop6fTQDCsgpzjNTFnf2DdBn13SMRCdJ/QZcXiiVqZ0x7LeaF9nM+7N37O//+Lju8sHq8rUoxXb/6GPriBh2TO0yAgND6PGhxYPo15Mn/GTA4NF4yCHtUA01LhHkO0xT3nAaQmQqsXBKolm3LcQPpxEqbFM8JJFO9aQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 405b75bb-a459-4b5d-4c19-08d7d62c7ab8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:42.4286 (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: 0euN3I6vF25zGSeSxll9rReu7sL+dXp6bdjbRvHI3NEvfY4INa4SazOlvgZw4FJG0CcI4H/dqUstyomrrgqoyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller It is far simpler to return a pointer instead of an error. Thus, it is no more necessary to pass a pointer reference as argument. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index bbab6b192b0c..c602496580f7 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -382,9 +382,8 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) return winner; } -static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, - struct wfx_queue **queue_p, - u32 *tx_allowed_mask_p) +static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif, + u32 *tx_allowed_mask_p) { int idx; u32 tx_allowed_mask; @@ -398,11 +397,10 @@ static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, tx_allowed_mask |= BIT(WFX_LINK_ID_AFTER_DTIM); idx = wfx_get_prio_queue(wvif, tx_allowed_mask); if (idx < 0) - return -ENOENT; + return NULL; - *queue_p = &wvif->wdev->tx_queue[idx]; *tx_allowed_mask_p = tx_allowed_mask; - return 0; + return &wvif->wdev->tx_queue[idx]; } struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif) @@ -434,7 +432,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) u32 tx_allowed_mask = 0; u32 vif_tx_allowed_mask = 0; struct wfx_vif *wvif; - int not_found; int i; if (atomic_read(&wdev->tx_lock)) @@ -469,12 +466,12 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { spin_lock_bh(&wvif->ps_state_lock); - not_found = wfx_tx_queue_mask_get(wvif, &vif_queue, + vif_queue = wfx_tx_queue_mask_get(wvif, &vif_tx_allowed_mask); spin_unlock_bh(&wvif->ps_state_lock); - if (!not_found) { + if (vif_queue) { if (queue && queue != vif_queue) dev_info(wdev->dev, "vifs disagree about queue priority\n"); tx_allowed_mask |= vif_tx_allowed_mask; From patchwork Wed Apr 1 11:03:45 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: 1265143 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=lAofxLOU; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk151wjsz9sT9 for ; Wed, 1 Apr 2020 22:07:05 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732427AbgDALFI (ORCPT ); Wed, 1 Apr 2020 07:05:08 -0400 Received: from mail-bn7nam10on2089.outbound.protection.outlook.com ([40.107.92.89]:6053 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732340AbgDALFD (ORCPT ); Wed, 1 Apr 2020 07:05:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dUggNedVJ+sVHIYFUlwo3g/wIPv75/NJvvRyuLgRtYOvwf/8Gp9HDZTJMCx4xj/AkG1hpK6eMndDt0WSeacGin/CVvVAzjYnik8HVxg/0N0grzr0OeBxJLndOWp1HTNKG4Ht43syfFpuRu3NL5ts8aOraKvHfIuq5KSQnKcxsIC4Ut9mhEVUHEOKKlHMz2II2TsJVPtp7qgbsUGUf7RCHI0Y8ajZfuS9IaIXDyr+tgM9gidkm1aep4o261b6Ii3cvpd/BKd1rEpeRbK0laMbrUZQqizt8z/8aqZaVhFvNWiYiYGEYpd99riyKmYgVfMa+UUv07ac1C+Dbjc4uY1F6g== 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=xGXthnG62b5pCXPBtCRPeBP56iQOekkiutIOkUU8cEM=; b=ZNEHN3QGLsv6O4tqQ9/6jCvUyFkTfMQaJAhqVlCUG8lFS7q0AeO9IbASjV6XnNTRn4y40fgf/cRrSkqtRi5oRJyj3iiAQhul03SIqxhXMP+MTouVy+J0K1/ShUBmQVGT9Im3/81THiW8oEiZ9w1oc9EkptEet4vkzI+hIsnKZg26tpoT/aZZ9egqgSNoGhiGeVVKnEUR+EQhkY1cVzAddZGQ2pvobrdAkKPTARy2jolOfnJtzk0M3e6FNrO8d8QPN4Wu7QatpC0JVwpb0uMVEkCWjIHo1NaNnAstqqJdo5cu5QpUzAgyoygOT+k3+m5feAUqVcXKuHOQ0rHP9qczbg== 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=xGXthnG62b5pCXPBtCRPeBP56iQOekkiutIOkUU8cEM=; b=lAofxLOUJZfB52BdnVokvr03BI32LZm5WyxztVTTHga+stpeaOVbqNg6+KW11S3LygOYqKRCFzBcPGj+mABXeANW8LLXtrpjNBC9lc4D3f8+zUO7VNW/FzaHAZUYRporetnNXcFfoCvsoL0WfsLhjVGGikHJmDedASfz5xHYUm4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:44 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:44 +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 12/32] staging: wfx: drop useless sta_asleep_mask Date: Wed, 1 Apr 2020 13:03:45 +0200 Message-Id: <20200401110405.80282-13-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:42 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9e84e1fc-754c-4f3d-8df6-08d7d62c7bdd X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: l7a1zBzCVnUl7PWYqtXWEwvmbgjixFnZ5lHHQ5T3lzYAyTkmikqrdyYU6nlRiiF+9qFh5oBbVcKqfocQDxDpffB/BElRwf7mOci6wCtevMKPcBDRSSi+8rVkqyoG+0aFrMhTFIdVFMrxjbgh1HmAYPKNT9lKzDs4qQaCPtMBpttZTePzldbLRpFj4slM4HpyeXm6+fR0q7bl88v8F6vlkUS2OBxV0zhhpjqnXczxrHmEK9AdwJOzqN1J3Lfu8i5W8qeepzrjEla0Z1z3kWR4XffSd+Tvdq6scLCVSwP48Fm8rT5U0Pcm2CXnh8yzNMSIOa3yfAGTcfIAY2sG0LLsbU5tS2wSU8sZ6VdA1tQG6r1cUTmn/jKf/vJTvhf9FVCZOw1dwjw0Gh0jG3p9ZZofWoJcuYVjrsaBSg0wJRaeXvqMn0k5R9trVayQOZGNQQcM X-MS-Exchange-AntiSpam-MessageData: TPLUfsKFb/7RyfWQaQzQopQgmuOEFL+gNG4aiiq5iHCbpg9XbCYHJxX5sVns3Y3tOuE36UVpd8DIF5R/kiWx/bj4rhq6dAciXTegQ8dElX9RiT8QNi4Sw/LZNZC0lRSxuZ3QnogyJHIfV/GJNGpdgw68JGflz0yFEFTrHdkUvoTXBP/iSu+igYuiqj08Mav20NiiMHGP5Lj3ZW5nI6Dalg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e84e1fc-754c-4f3d-8df6-08d7d62c7bdd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:44.3435 (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: IZxojAp7k1O3dzuCQ+qqST8rUlZaDA4GTPNoIfiERxubuo3NiMoa+HLYwf/t6XJ7fotk+oCDpNwC31MV8/Aoig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Currently, the driver tracks power save state of the stations with the variable sta_asleep_mask. Then, it takes care to not sent data to asleep stations. However, this work is already done by mac80211. Normally, there are no frames for asleep stations in our queues. So, driver do not have to filter frames in its queues (apart the frames marked "AFTER_DTIM"). Notice that there is a risk of race between state of the station and data send to the firmware. However, this risk is limited since the number of frame in queues are small. In add, this race also exists with the current code. Anyway, the firmware is able to detect the problem and driver will receive a 'REQUEUE' status (translated in TX_STAT_TX_FILTERED for mac80211). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 6 ------ drivers/staging/wfx/main.c | 1 - drivers/staging/wfx/queue.c | 14 ++------------ drivers/staging/wfx/sta.c | 29 ----------------------------- drivers/staging/wfx/wfx.h | 2 -- 5 files changed, 2 insertions(+), 50 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 8e4c3e1aadfd..a53e6d15031b 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -275,15 +275,9 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, struct wfx_tx_priv *tx_priv, struct ieee80211_sta *sta) { - u32 mask = ~BIT(tx_priv->raw_link_id); struct wfx_sta_priv *sta_priv; int tid = ieee80211_get_tid(hdr); - spin_lock_bh(&wvif->ps_state_lock); - if (ieee80211_is_auth(hdr->frame_control)) - wvif->sta_asleep_mask &= mask; - spin_unlock_bh(&wvif->ps_state_lock); - if (sta) { sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; spin_lock_bh(&sta_priv->lock); diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 3c4c240229ad..5e1a7a932b53 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -138,7 +138,6 @@ static const struct ieee80211_ops wfx_ops = { .cancel_hw_scan = wfx_cancel_hw_scan, .sta_add = wfx_sta_add, .sta_remove = wfx_sta_remove, - .sta_notify = wfx_sta_notify, .set_tim = wfx_set_tim, .set_key = wfx_set_key, .set_rts_threshold = wfx_set_rts_threshold, diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index c602496580f7..e66debd60e3f 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -388,13 +388,8 @@ static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif, int idx; u32 tx_allowed_mask; - /* Search for unicast traffic */ - tx_allowed_mask = ~wvif->sta_asleep_mask; - tx_allowed_mask |= BIT(WFX_LINK_ID_UAPSD); - if (wvif->sta_asleep_mask) - tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM); - else - tx_allowed_mask |= BIT(WFX_LINK_ID_AFTER_DTIM); + tx_allowed_mask = BIT(WFX_LINK_ID_MAX) - 1; + tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM); idx = wfx_get_prio_queue(wvif, tx_allowed_mask); if (idx < 0) return NULL; @@ -464,13 +459,8 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - spin_lock_bh(&wvif->ps_state_lock); - vif_queue = wfx_tx_queue_mask_get(wvif, &vif_tx_allowed_mask); - - spin_unlock_bh(&wvif->ps_state_lock); - if (vif_queue) { if (queue && queue != vif_queue) dev_info(wdev->dev, "vifs disagree about queue priority\n"); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index be493b5f2b5d..5c5b52dc7bdd 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -590,11 +590,6 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, WARN_ON(sta_priv->link_id >= WFX_MAX_STA_IN_AP_MODE); hif_map_link(wvif, sta->addr, 0, sta_priv->link_id); - spin_lock_bh(&wvif->ps_state_lock); - if ((sta->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK) == - IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK) - wvif->sta_asleep_mask |= BIT(sta_priv->link_id); - spin_unlock_bh(&wvif->ps_state_lock); return 0; } @@ -841,28 +836,6 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, wfx_do_join(wvif); } -static void wfx_ps_notify_sta(struct wfx_vif *wvif, - enum sta_notify_cmd notify_cmd, int link_id) -{ - spin_lock_bh(&wvif->ps_state_lock); - if (notify_cmd == STA_NOTIFY_SLEEP) - wvif->sta_asleep_mask |= BIT(link_id); - else // notify_cmd == STA_NOTIFY_AWAKE - wvif->sta_asleep_mask &= ~BIT(link_id); - spin_unlock_bh(&wvif->ps_state_lock); - if (notify_cmd == STA_NOTIFY_AWAKE) - wfx_bh_request_tx(wvif->wdev); -} - -void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - enum sta_notify_cmd notify_cmd, struct ieee80211_sta *sta) -{ - struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; - struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *) &sta->drv_priv; - - wfx_ps_notify_sta(wvif, notify_cmd, sta_priv->link_id); -} - static int wfx_update_tim(struct wfx_vif *wvif) { struct sk_buff *skb; @@ -1019,7 +992,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) wvif->wdev = wdev; wvif->link_id_map = 1; // link-id 0 is reserved for multicast - spin_lock_init(&wvif->ps_state_lock); INIT_WORK(&wvif->update_tim_work, wfx_update_tim_work); memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); @@ -1083,7 +1055,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, wfx_tx_unlock(wdev); break; case WFX_STATE_AP: - wvif->sta_asleep_mask = 0; /* reset.link_id = 0; */ hif_reset(wvif, false); break; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 116f456a5da2..61899cd7942b 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -85,8 +85,6 @@ struct wfx_vif { struct tx_policy_cache tx_policy_cache; struct work_struct tx_policy_upload_work; - u32 sta_asleep_mask; - spinlock_t ps_state_lock; struct work_struct update_tim_work; int beacon_int; From patchwork Wed Apr 1 11:03:46 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: 1265144 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=a7Xk/QAo; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk190R3kz9sR4 for ; Wed, 1 Apr 2020 22:07:09 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732413AbgDALFH (ORCPT ); Wed, 1 Apr 2020 07:05:07 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732342AbgDALFD (ORCPT ); Wed, 1 Apr 2020 07:05:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kqwDvwWpu9EOyjjL45spTvaufqYvVAEdMRDKfq4E0g9JteIy6liea/orSsOn03zobvFBCLiWBFYqSuEjwTyDMhrKIEWiWRG+MCi15ocJKSumFMYpFnUN8DMDS/uEiOzqxkkTLzXbaFSQese2OXRvHf8GFVju7muwpx4810Pcfyy+aK88tCh4P+BOpDZhsMkYAeVk7e1mJZ3HcSw2ng7FbNJLl7pBB5Z+tlAvJQhhvaOlSLRCM+DwoU69LTZiipQF2kVEXAzhooxDC9OJrzMdhcC/Y+1xRLypxG2xuWogOO1xAzQtXaHGD1PLYR+W4oeAe2d3g3VD2wRmVf/G0tLD8w== 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=g9coPk8RKrRy4Cc4Jt799tpxHC3TTIwZMKSK8VkA+ZA=; b=gDw9bdur37DNPZK1kUDsoq/8FZOa0/GpjNT1OsaxWdBTpeidh39FbsChzuMiz/kOTIWPKt/uquVw+d8kVapYlBP8g93qKFArAQgD8juy2DUnW1Cg3qFO3mDOcUT5DdNrsQI98tT+QFTEDyi8Df5ZkIvOHmls+KJaJWwNwd7I7+u60GqrNR9aEnEejU9xXltnBZwJT5ObKmv1UBjL6r6/Lxrc12QsAx57GDM+VWeMLqNaY+w8ynbBY+lh7k8Irgw+Z/+/hFx2yDpA454XX85udryJ5TNDPhrF/aa1LHirs5m0MOpRPyPC6++J62YG6FjK96TNmRhgL6SAmiLiEQXQ9Q== 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=g9coPk8RKrRy4Cc4Jt799tpxHC3TTIwZMKSK8VkA+ZA=; b=a7Xk/QAoo3uua27vCJ/esbFjzIr38NBX07tgzT9s9l/fIncQPQ+9+6o+69QulQ2wDs4gtIjz/VN6/EE3sERSRFUZJ/Xy8uPt9822qwt0vFc52H8MF2TM9Ja0gbO1zxtQ6+vksbdBDkVUwOnhnk23vD2mv+tVoEKvgvbkX4al7V8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:46 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:46 +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 13/32] staging: wfx: drop argument tx_allowed_mask since it is constant now Date: Wed, 1 Apr 2020 13:03:46 +0200 Message-Id: <20200401110405.80282-14-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:44 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cdae392a-cdbe-41ba-ff2e-08d7d62c7d07 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D9YcBb/cPXoCz8WKacl2zAxaW+wS9bD/FVyieYLC5D9p9BqDo43hpxnzAQ7YV6eZSjY7UmwuG/PWcjHxbabr7Bo++X4rpPcD4PXnRnhJiHjHMjiyMPaG0fL3QvczUet1gDty3fgWFc3UnLZtLWyj6P1okPS28wogo/6U7aKgZvust0CVLiWFsDl6m8j2YQVEE9XNq/EeiAqViXU/LzHPUo8xXxS8AhZLhQMzRqJ5g4R3HsKdzZazNQsFN4DOxQgWe73vHq2ZUFnzfwoXY5psQgdxa1jtUq1FFgh8Le8LFC9NMuoaKW+XOM0w2PnwvDw+QWIu+r1M6au7OL4gyAJdbCUKFHvdrdKm+YjtluIhi8RZOSrQ0EcHATtTWXKleN4Ad3e3N/N4TaqJEzLXxotYkHCnlfdxjiM2mEmw9DCiaYceMBbUGHxpjGrvgupc1CoW X-MS-Exchange-AntiSpam-MessageData: o4/B18IYZrKVQshBLlqeZ/bseWHsPBiBP22IpK6rRD5KHkjLXTM+tvwFIJ16VuxmgjtQudp5iBzXMIJJ5bzD5d8TWKBr+DfXr7J89w2shYsbKfOUKpw7j0Df4zZ4euiVa1Gx7JFr2YxiIanPpMUbBYMHnDkJlU6rLRsNhalfqsakZgFcZs5S6//f6DGDtOhGflR8wy/DXmHrXIXTbB3XRQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdae392a-cdbe-41ba-ff2e-08d7d62c7d07 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:46.3184 (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: pyU8L/9m0q9tiZqwj/IaefHJTATMIVCmyCS6ysC5CnA5wMe5CtKNSRbug+FpPZRzwbHRW5u4KSnsq5DqkLIzHw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Following the remove of asleep_mask, the tx_allowed_mask argument passed to various functions is now always the same. Drop this argument and simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 48 +++++++++---------------------------- drivers/staging/wfx/queue.h | 2 +- 2 files changed, 12 insertions(+), 38 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index e66debd60e3f..cecf9aa7b3ca 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -144,22 +144,15 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) wfx_tx_queues_clear(wdev); } -int wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map) +int wfx_tx_queue_get_num_queued(struct wfx_queue *queue) { int ret, i; - if (!link_id_map) - return 0; - + ret = 0; spin_lock_bh(&queue->queue.lock); - if (link_id_map == (u32)-1) { - ret = skb_queue_len(&queue->queue); - } else { - ret = 0; - for (i = 0; i < ARRAY_SIZE(queue->link_map_cache); i++) - if (link_id_map & BIT(i)) - ret += queue->link_map_cache[i]; - } + for (i = 0; i < ARRAY_SIZE(queue->link_map_cache); i++) + if (i != WFX_LINK_ID_AFTER_DTIM) + ret += queue->link_map_cache[i]; spin_unlock_bh(&queue->queue.lock); return ret; } @@ -354,7 +347,7 @@ static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) } } -static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) +static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif) { const struct ieee80211_tx_queue_params *edca; unsigned int score, best = -1; @@ -366,8 +359,7 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) int queued; edca = &wvif->edca_params[i]; - queued = wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i], - tx_allowed_mask); + queued = wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i]); if (!queued) continue; score = ((edca->aifs + edca->cw_min) << 16) + @@ -379,23 +371,9 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, u32 tx_allowed_mask) } } - return winner; -} - -static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif, - u32 *tx_allowed_mask_p) -{ - int idx; - u32 tx_allowed_mask; - - tx_allowed_mask = BIT(WFX_LINK_ID_MAX) - 1; - tx_allowed_mask &= ~BIT(WFX_LINK_ID_AFTER_DTIM); - idx = wfx_get_prio_queue(wvif, tx_allowed_mask); - if (idx < 0) + if (winner < 0) return NULL; - - *tx_allowed_mask_p = tx_allowed_mask; - return &wvif->wdev->tx_queue[idx]; + return &wvif->wdev->tx_queue[winner]; } struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif) @@ -424,8 +402,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) struct hif_msg *hif = NULL; struct wfx_queue *queue = NULL; struct wfx_queue *vif_queue = NULL; - u32 tx_allowed_mask = 0; - u32 vif_tx_allowed_mask = 0; struct wfx_vif *wvif; int i; @@ -459,12 +435,10 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - vif_queue = wfx_tx_queue_mask_get(wvif, - &vif_tx_allowed_mask); + vif_queue = wfx_tx_queue_mask_get(wvif); if (vif_queue) { if (queue && queue != vif_queue) dev_info(wdev->dev, "vifs disagree about queue priority\n"); - tx_allowed_mask |= vif_tx_allowed_mask; queue = vif_queue; ret = 0; } @@ -475,7 +449,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) queue_num = queue - wdev->tx_queue; - skb = wfx_tx_queue_get(wdev, queue, tx_allowed_mask); + skb = wfx_tx_queue_get(wdev, queue, ~BIT(WFX_LINK_ID_AFTER_DTIM)); if (!skb) continue; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 5a5aa38dbb2f..58da216d47dd 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -47,7 +47,7 @@ struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); -int wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map); +int wfx_tx_queue_get_num_queued(struct wfx_queue *queue); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb); From patchwork Wed Apr 1 11:03:47 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: 1265150 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=HKlUuyyB; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk1h6D85z9sTK for ; Wed, 1 Apr 2020 22:07:36 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732738AbgDALHf (ORCPT ); Wed, 1 Apr 2020 07:07:35 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732355AbgDALFE (ORCPT ); Wed, 1 Apr 2020 07:05:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OVZ2WkU3+oZ/Etyshh7qNrv6oMtMf+E83o6ZJA6sQC0zO4b9bnffQnrQilLN6FlEEUYh7+5FTJNdUe7CGpALDWbITv735Fq9CBE9qpPUFqcHKTw690x9l3cCPhr6EKsrEOTdFMcB7qJ2zlu8RHvIbmxE7NRFuxM4iLkILpZcpVsXTbB9jV3lZBD5ueD2fPR7n+bEIFCmereCYs3cfoOElWG+WU/MSklE6Q+4dA+o7zZapyIjojxkm/VwIQCzgoD2HveR/Z22qxC7PrpgrYAnf9f4dZl2V6bvQYO815tYYy/I2Kn8o9/r42054o7ZANSkDgHJjueNqVKivi/OB2FhTg== 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=pbnuxLmWt0iP2LUq7bC8yC8POuBwjQxzXFwbeIfTZ7g=; b=VdyPbXIPoIyWKCDqulbzn+ilaFfNG5vVBnjY/hq9kg4+TaokLq/cP3nd+yiGc2TUDihBUC8Pc9QzENtDfbOdQgR7HHwEaJLHJPzwRzkS7uL0GI+Di0TTIVQANETTggAEI401sBpDmhZG3rPJhITfv62qBvGAshJ1IK7zfqme8i21XSgWtLq6M1SKJqAMHMlUslR8+80ILOewwpqE1BOl81Wev1vcT079mB+WHK4bLfsN+LuD+TZI8blHb0Mtq/pu6kPuXcepQkEYDDXnd7VcoNIiuldd/49LB8SKtLVE5tUApDdtuJtDaky1icTVQm1Sui0Lbr1b22JHMnJAXmLsAQ== 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=pbnuxLmWt0iP2LUq7bC8yC8POuBwjQxzXFwbeIfTZ7g=; b=HKlUuyyBsEAnZXoQ2GaA8RECA3p+QDHlPwQTW2xhNEp83mABmdOj3MqqIhpqcO1ywS9l6OVpeYin14VprWjJGZKBtqcunuCEzdcBVtWf6OElg1htkoDO8dUxy4ryp1lcrxrvVPyyPTR+i688A+KBeulFv1+xBoSb93sjYR8nQ34= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:48 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:48 +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 14/32] staging: wfx: do not use link_map_cache to track CAB Date: Wed, 1 Apr 2020 13:03:47 +0200 Message-Id: <20200401110405.80282-15-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:46 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0341eeeb-cb58-4f04-3813-08d7d62c7e31 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 78+wAF+ciFFoFdDotlwHqDguclQmPp09Y+nyOV8kFVaS5kjEthyK8rGS2XaprJvMT5bNqXUogzKyh1yGe64AOi0BifUPHwuBMLxdL+Rn7vymXen+CSbw98GtnWXVrEc9mqq7EOrfdQRZbN4vUwJ9QIAei19AUKB88Rl3OpehUyDAjVA+8+kBzttPU973vtjnwFWsBASfxY7su5pOPhwa5dHI/Z3F57hIy9pzrtTpdm+uT8u6gUm32Gh+fD1fmjIxKPgd5N9hhlLZLb6i6m4Cwx2gyyY7Nwjl4Wx0uzEsaW2baKi66It5xk4giFH2q+/WN+VyJkOkqXfuXcwfcNl2E0sp9eDbGClI41RC/Dl6n1HuZ8iPjBVpeeFflRpGQ/2suG1J9OHQO0sCi5oms79Cj+cduL0rudKshH369anhGFpakNyOzt7YNWLZSYbCaIB2 X-MS-Exchange-AntiSpam-MessageData: IMmLxwnemGja3xtPGfqg3og1MDGS73uZzdUqdE9YL8DTsqHSsR289wvbOSgj3Z5pKJf9PgZ795ePPNpMU9ONgmEZbol+8BLK6g0Fjg9WsATY5pKm331fMjX4R8tN3+2Yaq1jVlduILvHkv5DEBLw9hzU/zC5PaY4MWS7AiYov3iO6NsAtddF7AlpEA1vt2HQJUdnh+S6evYZsz6QdyPMKA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0341eeeb-cb58-4f04-3813-08d7d62c7e31 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:48.3202 (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: 2hpk/YpQ2Nxe+lw29/IayF67oEQjjcJAFEmaW7x7iLADta44LSANfMedxqWi+ug0phvoGl2wR9Jqm9gHAAql0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Since we do not track power save status of the stations anymore, link_map_cache is now only used to track "Content After (DTIM) Beacon". We prefer to rely on flags from tx_info. So we will be able to drop link_map_cache. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index cecf9aa7b3ca..6fa8f4e083d3 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -146,13 +146,16 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) int wfx_tx_queue_get_num_queued(struct wfx_queue *queue) { - int ret, i; + struct ieee80211_tx_info *tx_info; + struct sk_buff *skb; + int ret = 0; - ret = 0; spin_lock_bh(&queue->queue.lock); - for (i = 0; i < ARRAY_SIZE(queue->link_map_cache); i++) - if (i != WFX_LINK_ID_AFTER_DTIM) - ret += queue->link_map_cache[i]; + skb_queue_walk(&queue->queue, skb) { + tx_info = IEEE80211_SKB_CB(skb); + if (!(tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)) + ret++; + } spin_unlock_bh(&queue->queue.lock); return ret; } From patchwork Wed Apr 1 11:03:48 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: 1265147 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=FzSP18HF; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk1K4vvcz9sT9 for ; Wed, 1 Apr 2020 22:07:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732585AbgDALHQ (ORCPT ); Wed, 1 Apr 2020 07:07:16 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732360AbgDALFF (ORCPT ); Wed, 1 Apr 2020 07:05:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AWOLof8BeUkcAShp8UtzVX3QWAvw0/wvLbjIA/TzzqcE/wA12p1UiPFOKvUvdngvWskKpv4g/A7aMiqqFq+oVGzaKAFJRkq8ky41q8VIom/gOxFZhxtQsqBXA2U4k8AV8n8E+YuAyWWTsCj4IYeyhqe2KRgj6XBm938WrEDUquCwJxHU/Vl1hKYhvPQKSrToRmuxMR8mDbzduVFFQSGt8MByVDVj1vIiYzot5zngZUK++JnY4l74GUt33VJlgN0CyWpKyTT6psTCVNjPtUxkbaDOmlUNAtu6VCVkSXOiEf82BgYl74wxlFr6xaMFdenGxtnMrsVEyVR1+1SkSwj//A== 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=Zwnnlp0rg2bPpdzDiOZIrKpP7GITQwa8v5Y5n3ZgLMM=; b=gECgh3m+3hzPDMKDxrzUCystlp+oyeEQkJlVjERpR06GgMgMW8mBOEzX5oAI3H+PWKZWNOF6IoEnrlgT/TNyqQo1A39j9H4eDAlZzK1qqbLKXev74g0b6jbB4/oda+fvOtm8V9qVF91u4w/prR96yJ9FpF7EQ8psfh55vOXIrr2WYpgoe8g15d4AxK0ipT/Zb+9paU6pm+kfRBiN7o/7ex4txkyS/ZcJ/x4/arNyAH/S/yIEe1Hzhe4MNFx1/51Nr1gZl0gIyS22EOg9Mn1KBDAD5umgkmijQG8hn34lyCn/gYxfs1QZOMZnCvOONf+qxncBfUd2DFvfkJiIb/JO8Q== 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=Zwnnlp0rg2bPpdzDiOZIrKpP7GITQwa8v5Y5n3ZgLMM=; b=FzSP18HFStzfflJ8FOBKnByETLwdMXwvZK1mC+xyPyhj04EnLlOAqdof/b3xkWDQ3iQALZ3Y0i2j+MHiOOzFoIbygH1ElvH8YuWMjECcPNOfBkolQaZox2yXHMPb9pmxDfdks/axDrVRgimE2BdBQ96AxcxC0qBSyYlenXcrr9c= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:50 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:50 +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 15/32] staging: wfx: drop useless link_map_cache Date: Wed, 1 Apr 2020 13:03:48 +0200 Message-Id: <20200401110405.80282-16-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:48 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9415d82-8b5a-4082-742f-08d7d62c7f6a X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1923; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KPgPMW7QC/X9UXQ5QF5Mc6H0uFKZs99yEaRKvfc5SaGR5rbgFEykn/7/8P4B5Qb2n9pEXEBlls1/NdhaDLyDHlCPL/r6SyIkg1SczLV2KcSl62N3RrMHqDGbCHHsUvCsFCI8sFcIBQaQP25Yfz9/6rTwb0f6h0bCwbuHae5P3w5nuIeuXfHR96+LfZtIhJ1sPsSqi4oQuQP0Y1HjOc3JYHGOPz0JTp7PqpVJSuNn+AQa42c7MDh5NYyB0WKhDcNzYiOauWHKbWCk5TscHLssoXIgPNA1oFvr9vVGpQvPygCXSNR3Ga1e3m1RCo+GVDIjBRm4FBTMNgKKvAfOLTXr5Kb652x1RfGc8QNQgjwT9Bi/wxO2dISDWL+78R8Uusm0wLKpdCR6kpmq00hRkfwe35Ir/a7S4V333ouCryOLOpnwUG9lXQG2TaKznosSfYw+ X-MS-Exchange-AntiSpam-MessageData: jOB+flDVkLIzuFuEJkZAvwjzoq3vsb3gGI1FRPUv0qAZ37+LE89JVS2ljsYC3rQG0X95QpKwyBBra9pUT0Ow3rdsN06ffEMbvc3LQC9UqTTZDOvAnOUrKxnem+O1vY9zlqNJKN3nAQfoL7OkqpbfR5/BAalStn65BAeZsVY2FOYT8zXVPSmNAQ1qlnt6kdHgKcoKDkhXLU+VR96AF3lFsQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9415d82-8b5a-4082-742f-08d7d62c7f6a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:50.3051 (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: Q/DfLUB9YtTtRUfpAjg3Hjw10HsYiWHvRLX0aO0eF4AO+dU+XZ8TMOskyHH1IeYeDjTERB20O4jobIEh6X6/YQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Driver does not use link_map_cache anymore. So we can drop it. In add, we do not have to keep this counter in sync with skb_queue item, so we can drop explicit spin_locks. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 60 ++++++++----------------------------- drivers/staging/wfx/queue.h | 3 -- 2 files changed, 12 insertions(+), 51 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 6fa8f4e083d3..82c2781b1f78 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -94,20 +94,10 @@ void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif) static void wfx_tx_queue_clear(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff_head *gc_list) { - int i; struct sk_buff *item; - struct wfx_queue_stats *stats = &wdev->tx_queue_stats; - spin_lock_bh(&queue->queue.lock); - while ((item = __skb_dequeue(&queue->queue)) != NULL) + while ((item = skb_dequeue(&queue->queue)) != NULL) skb_queue_head(gc_list, item); - spin_lock_nested(&stats->pending.lock, 1); - for (i = 0; i < ARRAY_SIZE(stats->link_map_cache); ++i) { - stats->link_map_cache[i] -= queue->link_map_cache[i]; - queue->link_map_cache[i] = 0; - } - spin_unlock(&stats->pending.lock); - spin_unlock_bh(&queue->queue.lock); } void wfx_tx_queues_clear(struct wfx_dev *wdev) @@ -163,28 +153,15 @@ int wfx_tx_queue_get_num_queued(struct wfx_queue *queue) void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb) { - struct wfx_queue_stats *stats = &wdev->tx_queue_stats; - struct wfx_tx_priv *tx_priv = wfx_skb_tx_priv(skb); - - WARN(tx_priv->link_id >= ARRAY_SIZE(stats->link_map_cache), "invalid link-id value"); - spin_lock_bh(&queue->queue.lock); - __skb_queue_tail(&queue->queue, skb); - - ++queue->link_map_cache[tx_priv->link_id]; - - spin_lock_nested(&stats->pending.lock, 1); - ++stats->link_map_cache[tx_priv->link_id]; - spin_unlock(&stats->pending.lock); - spin_unlock_bh(&queue->queue.lock); + skb_queue_tail(&queue->queue, skb); } static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, struct wfx_queue *queue, u32 link_id_map) { - struct sk_buff *skb = NULL; - struct sk_buff *item; struct wfx_queue_stats *stats = &wdev->tx_queue_stats; + struct sk_buff *item, *skb = NULL; struct wfx_tx_priv *tx_priv; spin_lock_bh(&queue->queue.lock); @@ -195,39 +172,28 @@ static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, break; } } + spin_unlock_bh(&queue->queue.lock); if (skb) { + skb_unlink(skb, &queue->queue); tx_priv = wfx_skb_tx_priv(skb); tx_priv->xmit_timestamp = ktime_get(); - __skb_unlink(skb, &queue->queue); - --queue->link_map_cache[tx_priv->link_id]; - - spin_lock_nested(&stats->pending.lock, 1); - __skb_queue_tail(&stats->pending, skb); - --stats->link_map_cache[tx_priv->link_id]; - spin_unlock(&stats->pending.lock); + skb_queue_tail(&stats->pending, skb); + if (skb_queue_empty(&queue->queue)) + wake_up(&stats->wait_link_id_empty); + return skb; } - spin_unlock_bh(&queue->queue.lock); - if (skb_queue_empty(&queue->queue)) - wake_up(&stats->wait_link_id_empty); return skb; } int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) { struct wfx_queue_stats *stats = &wdev->tx_queue_stats; - struct wfx_tx_priv *tx_priv = wfx_skb_tx_priv(skb); struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; WARN_ON(skb_get_queue_mapping(skb) > 3); - spin_lock_bh(&queue->queue.lock); - ++queue->link_map_cache[tx_priv->link_id]; - spin_lock_nested(&stats->pending.lock, 1); - ++stats->link_map_cache[tx_priv->link_id]; - __skb_unlink(skb, &stats->pending); - spin_unlock(&stats->pending.lock); - __skb_queue_tail(&queue->queue, skb); - spin_unlock_bh(&queue->queue.lock); + skb_unlink(skb, &stats->pending); + skb_queue_tail(&queue->queue, skb); return 0; } @@ -235,9 +201,7 @@ int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb) { struct wfx_queue_stats *stats = &wdev->tx_queue_stats; - spin_lock_bh(&stats->pending.lock); - __skb_unlink(skb, &stats->pending); - spin_unlock_bh(&stats->pending.lock); + skb_unlink(skb, &stats->pending); wfx_skb_dtor(wdev, skb); return 0; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 58da216d47dd..dd141cb4bf63 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -16,18 +16,15 @@ #define WFX_LINK_ID_NO_ASSOC 15 #define WFX_LINK_ID_AFTER_DTIM (WFX_LINK_ID_NO_ASSOC + 1) #define WFX_LINK_ID_UAPSD (WFX_LINK_ID_NO_ASSOC + 2) -#define WFX_LINK_ID_MAX (WFX_LINK_ID_NO_ASSOC + 3) struct wfx_dev; struct wfx_vif; struct wfx_queue { struct sk_buff_head queue; - int link_map_cache[WFX_LINK_ID_MAX]; }; struct wfx_queue_stats { - int link_map_cache[WFX_LINK_ID_MAX]; struct sk_buff_head pending; wait_queue_head_t wait_link_id_empty; }; From patchwork Wed Apr 1 11:03:49 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: 1265148 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=e4XAfeQZ; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk1Q1Lw3z9sT9 for ; Wed, 1 Apr 2020 22:07:22 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732360AbgDALHS (ORCPT ); Wed, 1 Apr 2020 07:07:18 -0400 Received: from mail-bn7nam10on2089.outbound.protection.outlook.com ([40.107.92.89]:6053 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732363AbgDALFF (ORCPT ); Wed, 1 Apr 2020 07:05:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=euKpgOBqfmicGLOb6g3zoGBoUZCZQx3qzaV/iIUBBOaqvGFOivr8ljOB/V1fmNpPMrufKjA18ekGonmzeHQ3B6LwiwurwSIfgQCwm9bBvdlT1o2kPuV0zlS4H2LmBFTaJsGmBp/2K/bYnsCZn+TGsYclqYrr1v7/onWsGQ1S/SN1UmSkqSUR8cASAnT3SKpXk6JLoZAyU7q3v7VZDPvGSxAC0Ks4Zk6AtqgNy3vp67H5UYKTB3JDRlaKssFH/U9lAxwNE+TlP37CIXW6hGTdcA1YbElQgg5g6ccyaWklBmMnCpfgIcg6kPTzJQuL26ybLbena9SOzxEqUmDsBRAmJQ== 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=77gQiqNqTu8gkEiMjIxwEnynF727rXFv9lLt0W2uKIY=; b=R1jyV6ZmpiyTeODFRN5oj1lDAJpaoNx9LiNuGTFt4M8DFLeB/eJxKMzJaPt/hgdxB1UA9MkGqYtY5QnPNYfC4ZXIGQ/rW4V2mWatmcb04D0aCfwSMazOK8IBKjTSB1X0J+27aIre6MpumUlfrf5ohqHOGqAOAA0BB5UEVFmdK77B5ccYkL6OTadX5vDP5bnAJrTiB5OVmzOc0aaFutolX2KjEhC5UDycgCcWtaWKZqdnx8f143YO0KfcQnz1eZ3nSOpeAZFDQaizX3gkCKZgFMbfbgRJ6GjRG7UPBnR/Ml0ZJ9APmV1C8+Tdh1znnbzCEk/4ZA4ODpBD5wXS2Fw0cQ== 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=77gQiqNqTu8gkEiMjIxwEnynF727rXFv9lLt0W2uKIY=; b=e4XAfeQZ2cVRxMUZOahTsBTCr70cM/XTnmL9KlfCJnsOGEinwQzG2d1RohlqOnaEh9DAbUgyPlvABcHTgs5XNV17KrZhpuqdRNBJkn+u+ml4oXgerzj39l9RwQSh4Yz1FI2qP6H9Faxs8Coryd/DKUjqo+06kLB8qdMirVYe0jQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:52 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:52 +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 16/32] staging: wfx: do not rely anymore on link_id to choose packet in queue Date: Wed, 1 Apr 2020 13:03:49 +0200 Message-Id: <20200401110405.80282-17-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:50 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3f5f50cc-3dcd-4c24-360c-08d7d62c80ae X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G2z9tuh274ARHIwheXGSt3TCVuwChHBom4pLMjIGAoS+/KXQZ+RF/UmZAN6Mc2lfKE+jJjeH7DTJJYqZhN4eFXKZC1HhY0CRbPBd4gZnxmFbFpu8o/OdJdqNA3uvCMZUOt1dqa3lp5hRJdkbUekULx5EUSfumdVVD2eKamnsIeOIzqKwJ82MMaRVAtxpXmh2VXf+1d35w7QhUx4ZvX5oqs9TPv6pRsA69WMagUAx00sPMG5Wndnv7+8OztcXEw/ph2sazHo9QFotOBZytRstR4ApwrGNWGBWd/AMCKNHC7w7I1FmRbQlrYwBAi2QKOowVAaeOpyi/WIl8d0zmNvfeusCSRsYv48+ugcHCKNmnDnMiH0+SMDRwjRGVTE40NkLCTgansCirbIY2F5LpPv8Y4olDdB1Gw5yruMUmZm9JtgBAngWR9Mzdl48Fh9T/EWI X-MS-Exchange-AntiSpam-MessageData: T2ryQobBzi7NqWWFHTc+TRgIXiwIH510hLcNTxbJscVN4cMNgMnG1FFD8F5g97Os+FOX8QxePwOvJR6JKHDo4AJneqO72Z++2hSm1IPLINWuCcvUEasiSjhVEdcFVmvN/n5iIVj5l63dwzJ5PU6gtYIGQ2nZXRvHf0MWlLUg5/6w7iyvL/IqBHJ2va/m6ltHuiUHcyRqVwDq6GTjDYKjVQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f5f50cc-3dcd-4c24-360c-08d7d62c80ae X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:52.4129 (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: zij2WY1dl7SM3KQ2X4OyBal7jl8lBC5jzkQTv+UwgFutv8DJvagZGtogMFNOb8pVBMZ3ghSXOAfanRwinWdQpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller link_id was expected to contain identifier of a station. It was also used to mark frames that has to sent after dtim. We do not use the further purpose. For the last purpose, we can directly check the flag value in tx_info. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 82c2781b1f78..046aba77618a 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -158,16 +158,17 @@ void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, struct wfx_queue *queue, - u32 link_id_map) + bool mcast) { struct wfx_queue_stats *stats = &wdev->tx_queue_stats; + struct ieee80211_tx_info *tx_info; struct sk_buff *item, *skb = NULL; struct wfx_tx_priv *tx_priv; spin_lock_bh(&queue->queue.lock); skb_queue_walk(&queue->queue, item) { - tx_priv = wfx_skb_tx_priv(item); - if (link_id_map & BIT(tx_priv->link_id)) { + tx_info = IEEE80211_SKB_CB(item); + if (mcast == !!(tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)) { skb = item; break; } @@ -381,7 +382,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) for (i = 0; i < IEEE80211_NUM_ACS; ++i) { skb = wfx_tx_queue_get(wvif->wdev, &wdev->tx_queue[i], - BIT(WFX_LINK_ID_AFTER_DTIM)); + true); if (skb) { hif = (struct hif_msg *)skb->data; // Cannot happen since only one vif can @@ -416,7 +417,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) queue_num = queue - wdev->tx_queue; - skb = wfx_tx_queue_get(wdev, queue, ~BIT(WFX_LINK_ID_AFTER_DTIM)); + skb = wfx_tx_queue_get(wdev, queue, false); if (!skb) continue; From patchwork Wed Apr 1 11:03:50 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: 1265141 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=Hszff1kA; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk0p2rq3z9sSb for ; Wed, 1 Apr 2020 22:06:50 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732443AbgDALFL (ORCPT ); Wed, 1 Apr 2020 07:05:11 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732371AbgDALFG (ORCPT ); Wed, 1 Apr 2020 07:05:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BTBCDlXI+zA7cFT5E+ifbDyWTUdmiynArXdH2xGwHS1nKdizyvzDoQ81T1/rL50/tPTYk9OB63E4iMt2lQe2yrjyfMdTjVYrTyp+SmPco67ZLj3jR/bQNUJQvW5YKQ1HBsBDWDMAIyJyNF1FKGAbRMVKGYE4UT7iMuySx6A2G/pc4R5vPfTZlp0rP/IsgkdD8Wbllo+P9HRSfKaPv+XIM2CgyZMObRYRyn+wf71nRy8Ez0DLu6A+NGFJY2o2x+f8LqCehymwmhbUQgBLjZhdTUZQUaobK6dtOGDr7MuQS/NFsU6kcO3yv85gpsTaP2AynoIiNK8WQRTyYZBzstQssw== 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=xQ7YYdW/7wdJYTGnqtNObTowuAlDxIcPNkAKBaBDW2w=; b=D9jsXmCn3nKL7NXE6qsACmCjLBvvpbR7rXN+vTU7I60PH7gLuPaHVShj3wMOhC42gkBtA/DnNvzDVCEwptFdvXccMKeZT5zIY6ttc+B1AE/gNbhYvDAlpiAzfYkAitdtQxryskTE3in2wJnsETK1phpYm4Nk9aqT1iViHhECZskmWol/zQvtQSo51OcKAwNbI58zq9T899uDDvo05yoqb0CgG1nZkbpFCl3PZnVk4EWF5Q8vSiiwCfUGGKBPveoJBAsvpAY7oHg28DSAkOQmJ09lhom1iJi2V+d10Td5NgUnY0LWSc+uSTiIDqr+V231M7dZBe4nXBA2B2D+tV+Kyw== 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=xQ7YYdW/7wdJYTGnqtNObTowuAlDxIcPNkAKBaBDW2w=; b=Hszff1kABiaIVEwlgQU3casYo8wg0imDSg/eV9TPH5mXL+zbszjEUtRphbg8xaiQFVBfWb+xVq9kmY2b8mmZsirxdHFXNEyc8ZBP2rbHixKS682DIPtUtyvmKLqEFIkjLY9hW2cN0fg+Mkul0t7tXBxseDdFChXSwn6v/APvQps= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:54 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:54 +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 17/32] staging: wfx: drop unused link_id field Date: Wed, 1 Apr 2020 13:03:50 +0200 Message-Id: <20200401110405.80282-18-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:52 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 882a91be-f4be-4538-3a7a-08d7d62c81dd X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(5660300002)(86362001)(4326008)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nH5nLn8Z2GvzYZUtAkvlfuL27YNTX1DrPgl9yoc0K0wcnOXfbjBp2Q3i+zc9jQr9HaKaE5i6LDJEoOU+zwSIj8aGB0lfZo4nt8LcaVye1IQT/K7Wl3XcvromSlfPenjmZ7n//CR1u3Q2AVbLBJpPxGs3OLQE+KvCBhS58aw0TzQlcfTpMety7aX/IJoD36sVQGc4+o0lEjmCFNtXDnrOgFfQS8x2bIxGa3UH8rJDAHgWJWzfpWAARQS8Lq2xoDSyC7jZb+jeY7JNubYgba/3eHuauFwSz8lUVMFm4yQ0Fe1ASpmItS947kocZYgSYCeGJOUp4I6dejN6HT/SQ8NDgtU8noH+fZubeV4B6Pz8qnWwRCWHkErS3oZJgda3zTOVHCuYZW1Os7WI24XcQEK6o8uh1S2h0Ba1XUhVpunb5gbtsxYiLvydaJaWZCfY9s+E X-MS-Exchange-AntiSpam-MessageData: sUeLyMOVLHInnwxBcso+5DPv+t0LUuY8TBbNPyTBLvL2XTYh8UjJz6J3vjavF5guKLdaZPIzQ8C6PYNP3Vqcyl5gmPyjShaXq1SUcPB6oJd4WP2KvTRCGzj3eG0cjBfYRze5XWvprNKr08d1ZSWznPZ+uoq/Q+nJ1Y8BOM6c7NChhZUysLkJn9snz7103lLA+ZQ/gBDxahj4JVzjpyvuDw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 882a91be-f4be-4538-3a7a-08d7d62c81dd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:54.3977 (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: 6RROmdASlC6TMrFEpdSB5dmamjBs/Y2v4wxUtUUe1ICeYVPcZp7qMBVOgk9r3mYYDH1dEY7jiZVxjLN6w6Uoyw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller It is not used anymore. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 5 ----- drivers/staging/wfx/data_tx.h | 1 - drivers/staging/wfx/queue.h | 2 -- 3 files changed, 8 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index a53e6d15031b..f794212f42e2 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -424,13 +424,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, // Fill tx_priv tx_priv = (struct wfx_tx_priv *)tx_info->rate_driver_data; tx_priv->raw_link_id = wfx_tx_get_raw_link_id(wvif, sta, hdr); - tx_priv->link_id = tx_priv->raw_link_id; if (ieee80211_has_protected(hdr->frame_control)) tx_priv->hw_key = hw_key; - if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) - tx_priv->link_id = WFX_LINK_ID_AFTER_DTIM; - if (sta && (sta->uapsd_queues & BIT(queue_id))) - tx_priv->link_id = WFX_LINK_ID_UAPSD; // Fill hif_msg WARN(skb_headroom(skb) < wmsg_len, "not enough space in skb"); diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index c545dd75449b..b561bbf9f16f 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; - u8 link_id; u8 raw_link_id; } __packed; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index dd141cb4bf63..39c265e4b86e 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -14,8 +14,6 @@ #define WFX_MAX_STA_IN_AP_MODE 14 #define WFX_LINK_ID_NO_ASSOC 15 -#define WFX_LINK_ID_AFTER_DTIM (WFX_LINK_ID_NO_ASSOC + 1) -#define WFX_LINK_ID_UAPSD (WFX_LINK_ID_NO_ASSOC + 2) struct wfx_dev; struct wfx_vif; From patchwork Wed Apr 1 11:03:51 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: 1265127 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=p2p5JdUf; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjyx63ZSz9sRf for ; Wed, 1 Apr 2020 22:05:13 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732455AbgDALFM (ORCPT ); Wed, 1 Apr 2020 07:05:12 -0400 Received: from mail-bn7nam10on2089.outbound.protection.outlook.com ([40.107.92.89]:6053 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732335AbgDALFH (ORCPT ); Wed, 1 Apr 2020 07:05:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nPs0JlMNyTEXl7aWc2dIADAO5j+ku64zPrw/OGjf4598emz8t8CqL99XNtP460udnszrvcTOCogHUafYDZ7hZ+0cQvleBurou2i9OUD/tFCEBef+z1qWwPEDdxFeyWTFDXuyXn+cx3FHd6RBr3qSk8akgspy83RUzQOckiQERi9tYOcVi/eIbXNcZvY03rwD0L+diia2Zi5oC6XgVKMVOm7vK8V0C8jubLKQadcw4oVsumTZabgI2nmyr0dt4P1dAkBr6GQzEvLMZ3S+azchD563D7XKG3EkIsu5EPNUV+lFlOFRbnrzKgibHK2u0gtCGBnVM6qdnjSrdPJoSfLhMw== 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=20ueHzGkZvyRLZMo7s2ss/kn1LfmbL/UGhtDkK8/TvQ=; b=HRcTo87Cnr+F9vgYkIxtqE+4KcV2Z8hO0Zp5FS3TxT6S0U+JoUGrQqhXiwqAVwRRTWTZruDtT6Yvb+aeJ1ozOtf1HSqu6Z2tUTckH52FLxbT5E3vDeMgf0dXdIraNSUBvOslGPJfR+4EA5dQXu0J8BxKZ6qg3WaabkIQsmvFBn55WSWD9wnKOYExJu6DlQd0xbZkjB/8W9i8WhWuewgm5rdX0aF68YG0I8MDA/gEx2lfV81XUfzl0FMpV8nttX/QD7xaSC2Mk/HooCzbSHubuSOiZJ88YsLXu5noIoFoeHvERd8VOx+vwYPudkUHS+wNk6kQqtPzfEvrslGlGaZomQ== 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=20ueHzGkZvyRLZMo7s2ss/kn1LfmbL/UGhtDkK8/TvQ=; b=p2p5JdUfDfUGdwYq0grxAKvm5ZsgDq/c+5of2XOA7599NYb/dsmkS/TU4Vi+NmxSlKNeUQjxCxDVtEo68LdPFwt73Y83SsfGVDxG+stVHs4vmErKrJ9472rnlIyHprluvXMVCt5y4QRUvjwHd0GcBbQSj7bQ+qQW21gfdC4QDLw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:56 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:56 +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 18/32] staging: wfx: drop unused raw_link_id field Date: Wed, 1 Apr 2020 13:03:51 +0200 Message-Id: <20200401110405.80282-19-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:54 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f7147423-a4a7-4bed-1c56-08d7d62c8347 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2803; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HLFZCAJmo7AMq7kyy+j/9qaPsslT8EJzH9x6BEJ40HFquNoWJmqQ4Sch7/rhM9O6eT7icnEE4OWfftK2qTTYay9yhiFrklSgdx0P7RXN2OaKNvJrB8QHZvrj87x1BHIGRXeKjjuVXop4zZ5eVQJvsgkxTb3ghe8oZxQcKqsqnZzAP7DjLW3vzUy+S3GwV7oSaAeaIba/VhMjbJJ6IQa2EXJ9vwYVspm/Pi1EEcvQVrQnKiuQ/q1oADMOY+8aTTwZDUeZxhpDQhFdab7qlDll1gcuNpZIToiLJroiy8bvZpxVixRPpJvU1zAFnLOgxfpjK97/1ZvIgFocxC/8cAvvUGgbtxTnYaYvRByF0BWBUq3UXdkdC1WEy1DZRzUx8PP+axZy+gCO4RWRlhCc3bl4DGAFMVpokMMpg+cg8WIG15McjhgywDZBuoZQ3q5rHvgx X-MS-Exchange-AntiSpam-MessageData: ZHZCdHbdu3Fmb7cjJY5uhPuhtvU0YIm8b5VFUwE6yPuY5VXarFHOvG7Ly2rDC2DZRHOtXTBnwsXiNXc0Qe8n0ngD1nlLMhM8YQPFuI6X1wFdA1E8HVy42QBwZlNcU5BdjLp2RjFYK+eA1G9aQujS1R5pBF6EIFLIBl9G4mNh4qN7RLRTkzN2agwlXD0fiAwxT/9eKbcukfU8vJigrxn0KQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7147423-a4a7-4bed-1c56-08d7d62c8347 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:56.7284 (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: 71W5l25Oz1CGYIRvo5VkX7TthRKuEem/pgb5FvoyTkau6RRplqoab9bPn01Nh+INIQECJiJDYMhaoLM79wVNEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller raw_link_id can be retrieved by wfx_tx_get_raw_link_id(). So, it is not necessary to keep it in struct wfx_tx_priv. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 3 +-- drivers/staging/wfx/data_tx.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index f794212f42e2..57afabc102a7 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -423,7 +423,6 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, memset(tx_info->rate_driver_data, 0, sizeof(struct wfx_tx_priv)); // Fill tx_priv tx_priv = (struct wfx_tx_priv *)tx_info->rate_driver_data; - tx_priv->raw_link_id = wfx_tx_get_raw_link_id(wvif, sta, hdr); if (ieee80211_has_protected(hdr->frame_control)) tx_priv->hw_key = hw_key; @@ -455,7 +454,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, req->data_flags.fc_offset = offset; if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) req->data_flags.after_dtim = 1; - req->queue_id.peer_sta_id = tx_priv->raw_link_id; + req->queue_id.peer_sta_id = wfx_tx_get_raw_link_id(wvif, sta, hdr); // Queue index are inverted between firmware and Linux req->queue_id.queue_id = 3 - queue_id; req->ht_tx_parameters = wfx_tx_get_tx_parms(wvif->wdev, tx_info); diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index b561bbf9f16f..03fe3e319ba1 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; - u8 raw_link_id; } __packed; void wfx_tx_policy_init(struct wfx_vif *wvif); From patchwork Wed Apr 1 11:03:52 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: 1265142 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=kUGyQSZj; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk123r1Gz9sT9 for ; Wed, 1 Apr 2020 22:07:02 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732688AbgDALGv (ORCPT ); Wed, 1 Apr 2020 07:06:51 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732385AbgDALFK (ORCPT ); Wed, 1 Apr 2020 07:05:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JxfSdp57Nq9P/jYpqx9XaKnWBVffmbQkY7aRCRV+5k4TIJ1izReozZ93PEtWY4+x7oN5xCzTw8kMmG20bdBY/1OoxLzu1ldlfHFOnff4SeTYMcuXwDb5a00PfHXhiZrZ48RIEG5XjoGLvUe6pdxqn2zdhFKSxqwHBa75kFQgfOps6ukh6DJ1UaQItyxvaUwtVmwPHtAw/68yVXKWIsiByordJymrJd7mSyl6qKWAvyM5G+nHztR3apDdKDUWXgL8E0QI5Gn/LukQsv9I2gveR18TtKdNpA87xcfF8XBKuyf4rJ2z2BN8QaN5znAW3x7+vXMCb6ur6iv18yBcMMVJaw== 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=GuQDNbxb4F3YogEifT9Q+oCjESVIo3OH/9JiW5IStck=; b=NeGo4z0d0c/rsyMjnNWVNSdmqj/gE4B6Gk9TajDPSbEG1QPbE5frQ/W1TB3Rsd0j7oJHz6IeBMspSOHvy3h2lGRWH+G4Ly+s59y9od4SKp37mmjx77SCnvYgpqL5IqgS0AmB3ucSHJSAsmITUJUd+eiyabbggKCBvBbzqwcQpZyF7WqCbzvVq5hBolCV1AnL6aRsf0uxsAK+RwZppZqVa1h7h9Z8bufwbtXqdO8XOEQz2Mso5cCzIgLMBgBQtMjqXs+QGr0slTZWpxxIDq8crnrhUzJG6wWSKaypgLIhZmlb2o7IcPT6C9f35xM+fSH+jNsWwvyC01Hqu4mjGrRKow== 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=GuQDNbxb4F3YogEifT9Q+oCjESVIo3OH/9JiW5IStck=; b=kUGyQSZj6XrveZvStbiTZeiKsrQ3zRDz2HJlZFHBWdmgMWW+CeLnsZCuzrwDzlTAVV9dXQIUTdf1PpXw6e7tU9XP6XSkBh1/eflQDxFkC8nDVluNWklV+t+oTZVKvNn5kUyGWiXklsF9hxHCdqoPPoEOJmL6qbLiOyxfXJKnJ7I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:04:58 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:04:58 +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 19/32] staging: wfx: rename wfx_tx_get_raw_link_id() Date: Wed, 1 Apr 2020 13:03:52 +0200 Message-Id: <20200401110405.80282-20-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:56 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82a0ee3a-1600-4cf3-1d93-08d7d62c8466 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1417; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Q9zUhpqgxqqv8ZjaFNhaYMXt7WrZ4GuYgSVd4M0wAL1wqvyGv93PT0loDcZn7P9WCdv+QamHuHaI68x+apVucqYj5j5oV14pJCcEpXncPFwHJ3Bh6bb+6y/d5Zbb0n0eIgutooJtEnTfOGVcmeSoNlMagkcjrpeq/LGep0/ZguaueX2diNIontXTw4xkRlHbBwQSMHo7jSgSFcV2HSYUCBhgharNJYWuMtUpa2TLBK5lW17GF+WLOdemhS5j+ibEfLMcmBXtyHlkNyGzEecVOUAO29CTg1cSQFpJUQXzEol3w/sFlcEVmbw+sge55v1RQ/n2IWtzS3h2bUS96RWROIb0DgQcE4pLmm1k2Ku0QcMapraywjcXnW9Yd4KXo2Jt9RKzn4w2+E/Pb68GtorTnJt2EMBVfVVpjZ+kxzaz4lUdlDMw46yoTKDaFyMPDVtT X-MS-Exchange-AntiSpam-MessageData: Pvz7a6q0XqtwnaQ5tjvPVXv7TK3DEAMy57hvDsaNvQfrmyHLEJtYTUdwEvOzU03VfJLQv1hUO7eRhawpyy9STf7dAY6uUQ7dif7aFRnxStKmz7VMxMeGNJgQGPgzq3jO2ZhhwRmvhD1d1rwJLGYO37mRdCzaV/LOTrpEPVVwrfz2HZB7cC/G7uGwaXYbDRDFCUmgWYSXyWgSxa5tIVWSXA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82a0ee3a-1600-4cf3-1d93-08d7d62c8466 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:04:58.6613 (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: TWKqyKnNVh8EygrHsI4t0lsmLbND3oBWnRJgPcENrSIwJ1mtWYujRSa5x2+0ElDfbXcTPYnW84Rt2yHJtSAUag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Since concept of "raw_link_id" does not exist anymore, rename wfx_tx_get_raw_link_id() in wfx_tx_get_link_id(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 57afabc102a7..2533d4f53f83 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -287,9 +287,8 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, } } -static u8 wfx_tx_get_raw_link_id(struct wfx_vif *wvif, - struct ieee80211_sta *sta, - struct ieee80211_hdr *hdr) +static u8 wfx_tx_get_link_id(struct wfx_vif *wvif, struct ieee80211_sta *sta, + struct ieee80211_hdr *hdr) { struct wfx_sta_priv *sta_priv = sta ? (struct wfx_sta_priv *)&sta->drv_priv : NULL; @@ -454,7 +453,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, req->data_flags.fc_offset = offset; if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) req->data_flags.after_dtim = 1; - req->queue_id.peer_sta_id = wfx_tx_get_raw_link_id(wvif, sta, hdr); + req->queue_id.peer_sta_id = wfx_tx_get_link_id(wvif, sta, hdr); // Queue index are inverted between firmware and Linux req->queue_id.queue_id = 3 - queue_id; req->ht_tx_parameters = wfx_tx_get_tx_parms(wvif->wdev, tx_info); From patchwork Wed Apr 1 11:03:53 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: 1265128 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=bryt0T8F; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjyz4z37z9sRf for ; Wed, 1 Apr 2020 22:05:15 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732470AbgDALFO (ORCPT ); Wed, 1 Apr 2020 07:05:14 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732397AbgDALFH (ORCPT ); Wed, 1 Apr 2020 07:05:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h1JZye9hiymctHsY/I0hLU9FKhbmtUAVd+aQCpzPfJkwD6CddKrYqb3PuYx3ZUwnqJJbP6EBa4coeeEcHXZ2OAEximizbTBX0RqyBdM3DrS6nmBeJjRbCHGYtpemSm6EuP2VO+N7/DX0SmylHJ+wzHdQ1W/wDdSKlL8tca8RBByrgqi4UglkIpU73sduPjEOGAhLfMzD/W2x/viWgJEjNmvISYNNL/WLJchYBu5D8NQqy5V2mPYhf113oCGMC4yt1DyTe7tobhKVqwTuY41S0JpFvPAm0vQhw9zJi/NF9VzJpA+ksQ84K6GaDe9UKO03m9tnIK16tO+2zNf3T9fyTA== 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=ckRI9VlPgVa5+jADj0msC+suM5ZwBwbWygxuwsP1SDM=; b=mXxh2OSbGdxfFmLcgUEfihfU9viqMROuuHVsZo1+xMAE75rMTdiMw9NocsXIBARdee0kosRoXBD6SMUXpu9tsaZb5cQ32bM77t7/jXYl0+LofKwkbSj1toyu6k2NPpF/F43/JGXQUAjIOrzeSlINhl5rLgnHYEPNYUnMZxsKOGWRA55bBbU0GrCIp3pzFqie0pfAuPwhSHzFmoni7zCQptGFceSdnawzYp1HV3KmuMGdAyXOdXdajxFvTxKq+lR3qimJ60kZu80//Q2HuK8YgrJOLwb6Rm2hrk4VICQqefCnywdaaXV8Xs2cKKfoKAi6lBnruuVXJ6CrbnxdP1Hg2g== 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=ckRI9VlPgVa5+jADj0msC+suM5ZwBwbWygxuwsP1SDM=; b=bryt0T8F32rI02mleVev5MQRbgh1DYd8Ey17BHwy02QS0RqsWjbvAZJyBgkMCViJUs0twZixW8lnaXERHCBkH9ozwtTxDmgnQDWfr89epJlIiLfSPdKJnK3W2ZZmX+NAV2u4I4SdhGAz49B9lyxtJsSPxZnNa9P768mCTAVMPmU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:00 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:00 +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 20/32] staging: wfx: replace wfx_tx_queues_get_after_dtim() by wfx_tx_queues_has_cab() Date: Wed, 1 Apr 2020 13:03:53 +0200 Message-Id: <20200401110405.80282-21-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:04:59 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 06119e87-49bb-4b4b-4862-08d7d62c859e X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BcnC5xBsteWgenmoLkOeOIhZq7fwBzlwql+JhuLgLy9xPgaRW3LYkQcupxSTn4j+GM00iwEdrdjxJrf4CjHT4iWpitLMnbkedDhGGl2zAjCwGP7/Fp6pV4P6umlsgwe0Kpcfaptv500BovdS8OidimiTinP0U9VsiXM5sPFIHepVwnJI0vNVr8tog85ARnk7fK5m7Y6RcVyaX9i1qXpbKnUXe9w/RqQ1IxweIUTyylUQ5Yz2x84OwABCro5yd1/5JfXRWnWKtCGLJ0a8UEQZRT17Vxh+KECUoE9A3BAezh/f9ttisxpcOYbdGVOPl7dsaHwNQT8dDDzCt8/9LraZv8fjR7TGnLnl9iDc3ZacpuHYM6E2SZPxYsQeyylEskxMWh8GIU0lJYMifL7XbqjgndTb11TYTj0xCPxnvIfU5Wbw4kCq3uAklmwDcFb7iNuy X-MS-Exchange-AntiSpam-MessageData: yQSkw2LqeoUlc/ZYk9Ski8UbP7shmi3p6woKBAaUIRaXDeCSutir5LBsthHwFWaOf/gzH6kcQhG74g+PomE29gVygnS2fGp8zuafhUw0fCaRGyXhcpQMO7Iou84MbCAIeth9MAiJkr2lF8Suh0I/syJbUZjIS1jv2YfpCYKaY4tvRm/kd/HdXGG9alFO9vBeS/vJu4vVWEAD/z6SGL/ViA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06119e87-49bb-4b4b-4862-08d7d62c859e X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:00.7800 (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: fIr9lblWd1l+RDm6AVoB/qK2S/kH4IzzQJcvXjuy20xb5o92i9XpcTABrSeg/DbfbWNSPI45KNM5Pl03d2kj5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller It is not necessary to return a skb. Just getting the information if there is traffic to be sent after DTIM is sufficient. In add, the acronym "cab" (Content After (DTIM) Beacon) is used in mac80211 to designate this kind of traffic. So, make wfx_tx_queues_get_after_dtim() return a boolean and rename accordingly. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 40 ++++++++++++++++++------------------- drivers/staging/wfx/queue.h | 2 +- drivers/staging/wfx/sta.c | 4 ++-- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 046aba77618a..4ddb2c7370cd 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -264,6 +264,26 @@ unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, return ktime_us_delta(now, tx_priv->xmit_timestamp); } +bool wfx_tx_queues_has_cab(struct wfx_vif *wvif) +{ + struct wfx_dev *wdev = wvif->wdev; + struct ieee80211_tx_info *tx_info; + struct hif_msg *hif; + struct sk_buff *skb; + int i; + + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + skb_queue_walk(&wdev->tx_queue[i].queue, skb) { + tx_info = IEEE80211_SKB_CB(skb); + hif = (struct hif_msg *)skb->data; + if ((tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) && + (hif->interface == wvif->id)) + return true; + } + } + return false; +} + bool wfx_tx_queues_empty(struct wfx_dev *wdev) { int i; @@ -344,26 +364,6 @@ static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif) return &wvif->wdev->tx_queue[winner]; } -struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif) -{ - struct wfx_dev *wdev = wvif->wdev; - struct ieee80211_tx_info *tx_info; - struct hif_msg *hif; - struct sk_buff *skb; - int i; - - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - skb_queue_walk(&wdev->tx_queue[i].queue, skb) { - tx_info = IEEE80211_SKB_CB(skb); - hif = (struct hif_msg *)skb->data; - if ((tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) && - (hif->interface == wvif->id)) - return (struct hif_msg *)skb->data; - } - } - return NULL; -} - struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) { struct sk_buff *skb; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 39c265e4b86e..2c4724699ed0 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -36,9 +36,9 @@ void wfx_tx_queues_init(struct wfx_dev *wdev); void wfx_tx_queues_deinit(struct wfx_dev *wdev); void wfx_tx_queues_clear(struct wfx_dev *wdev); bool wfx_tx_queues_empty(struct wfx_dev *wdev); +bool wfx_tx_queues_has_cab(struct wfx_vif *wvif); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); -struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 5c5b52dc7bdd..e1d7a0670c9d 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -857,7 +857,7 @@ static int wfx_update_tim(struct wfx_vif *wvif) tim_ptr[2] = 0; /* Set/reset aid0 bit */ - if (wfx_tx_queues_get_after_dtim(wvif)) + if (wfx_tx_queues_has_cab(wvif)) tim_ptr[4] |= 1; else tim_ptr[4] &= ~1; @@ -888,7 +888,7 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) { - WARN(!wfx_tx_queues_get_after_dtim(wvif), "incorrect sequence"); + WARN(!wfx_tx_queues_has_cab(wvif), "incorrect sequence"); WARN(wvif->after_dtim_tx_allowed, "incorrect sequence"); wvif->after_dtim_tx_allowed = true; wfx_bh_request_tx(wvif->wdev); From patchwork Wed Apr 1 11:03:54 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: 1265137 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=lZbxPuzj; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk0K0DGcz9sT2 for ; Wed, 1 Apr 2020 22:06:24 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732482AbgDALFP (ORCPT ); Wed, 1 Apr 2020 07:05:15 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732411AbgDALFI (ORCPT ); Wed, 1 Apr 2020 07:05:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VFYpCKtgphHq0uwn92Ukw+1yshAUqXTLbD3Mbbganza4dVtbo6momBu+1/hxAwRJPtZAXx04sTi5JBpqOicz9T933knheOxgYifF9bM5TWyiLXqbPPH1Qs/edk1sOU8zxGpK0sRCGXLVJSXivAQEwYLt68I2zQZ6XU4U8QG736p6745K/9dwzwO/pORNo4cHfX6vU45cXEmLyzjS2M7m57sWhupAMw3hzfhX6Udz0JnigVXjN3Ih23mgVDiWM36ylLzlkF4Rczmq+HmQLeJcNPNELmBTvFwbAxqkuFbjgEEeo/YjKL0dE3WljEqP8MfyWvCS2hXPxUN0ljCwn0WAnQ== 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=KByH8CMeALcWNBVr4ZyAF71eawkmjEy+Ct0mBPM1yJQ=; b=V6GhFGvuzlIkLHYDA3VnNUcXzr9+TY06ZQU1IzyHJu5iYSZvk/pUFN83BkfAdk/1UsnpcBXrl8EYU1bsu8Jz++FaJTN2Ge1hmY/EpQxqrV6ZHzBiKJX//oG8IeB4ANRIz5ehrjnJ+SQeWa63pu4uZAtvwOGbhMEcVUugOh6zQsHP7SlxG/ycyH7FsIyzWBeRkCrMMrLxvBr43qY35tUqjjf2rUZZ43rL8b0EJNhpaLFq7O+b76vNpYbpR4wl7QAgq+4Z6QcJTkmoh9+QiioTGDMBllYIhE/CNcro0dTRr8HOf62t4Ysu50ma+G2dihopTOl2vtl/6xUw6sYZUx2PIA== 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=KByH8CMeALcWNBVr4ZyAF71eawkmjEy+Ct0mBPM1yJQ=; b=lZbxPuzjFlfvomYS6bmLo+2nCZ4HyMEUNB8ye1gOIeboJz5ysH6667MXsFlvTe656Z5SXWjzDYbgnT70w8yy5QGoEFcits8Ff6TgjiObOTVEh4/DokYUviMCGyC5fr/RmPh00zRCKRqLGbPuan3AJ+xa1Qsjb3CEMiHiR+nDUyw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:03 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:03 +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 21/32] staging: wfx: introduce a counter of pending frames Date: Wed, 1 Apr 2020 13:03:54 +0200 Message-Id: <20200401110405.80282-22-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:01 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 47540c5e-2a2e-4c04-3ebb-08d7d62c86dc X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xFlBb6duW27fpd3n7YV3JtJ/W3bgOhFcc0LmcTa7hbXcyREFG7WURlK8ojzdIm/LSWWRZuLMALj+TeEGT+A+aciuT6IuG3oCGz/x/AiFd5cIKq8xizR6kDdrmwG1S4IqTBPGMAslOQ98SqDJeqQh1odw9twDvoLywO41mP37Dac0hKHW2FkhB/J+wRpl3oko3wGvMolbsdNftZBhQ/vayA9ulcPxJuGEvUpx0LavdouvHCtdeTF/Jx7S+TReLc1f2yh3lOWoNZb5N/oJE+YPxdTyL5oilVsoAxzX4CaMqy65PSw3TCj/qPeCyu60qHaw3OGQuXxln/ZFTEaHA4y3sb9Rs4QwhFfOHa9O2I1CRClIAnkMc35yj6U+KYXFe2j7VbnOo/+PzppSV+rG2Ym5xzKAmii2hPhN43YueFMYXUepUM3pi8VTx40jNh2Z4nxX X-MS-Exchange-AntiSpam-MessageData: ahcmKjOT8kZv+4WIlGS34xr3TyXYS0CwNUMS7ysg4e4+3dbwy3S8cqea4H2TuaN9I1Ch2Cy52rqtMsi4oqMpDghEjSbU/Zjq9DtCFqHRnGc0Y0INll301YOtUGGhsFAK9JPg0mIeUIFa4nRETJhqvXCgON+Pdi8xajanTwT3k7fzx2Y+85EU2KP6+LLnrlDyrsTK1OPQCMzwuNxxmSm9QA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 47540c5e-2a2e-4c04-3ebb-08d7d62c86dc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:02.8259 (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: OQatUSOhByYXZ9QHFhqAigf88hWAiQJh6plaQW7F99ZGrFkL0Rhv2ENUTvAIjXGpgqnQgE8i3q+52EYPCSxIAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller This counter will be useful to know which queue is least full in a further patch. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 15 +++++++++++++++ drivers/staging/wfx/queue.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 4ddb2c7370cd..21a2c8aabbb9 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -30,6 +30,7 @@ void wfx_tx_unlock(struct wfx_dev *wdev) void wfx_tx_flush(struct wfx_dev *wdev) { int ret; + int i; // Do not wait for any reply if chip is frozen if (wdev->chip_frozen) @@ -39,6 +40,12 @@ void wfx_tx_flush(struct wfx_dev *wdev) ret = wait_event_timeout(wdev->hif.tx_buffers_empty, !wdev->hif.tx_buffers_used, msecs_to_jiffies(3000)); + if (ret) { + for (i = 0; i < IEEE80211_NUM_ACS; i++) + WARN(atomic_read(&wdev->tx_queue[i].pending_frames), + "there are still %d pending frames on queue %d", + atomic_read(&wdev->tx_queue[i].pending_frames), i); + } if (!ret) { dev_warn(wdev->dev, "cannot flush tx buffers (%d still busy)\n", wdev->hif.tx_buffers_used); @@ -176,6 +183,7 @@ static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, spin_unlock_bh(&queue->queue.lock); if (skb) { skb_unlink(skb, &queue->queue); + atomic_inc(&queue->pending_frames); tx_priv = wfx_skb_tx_priv(skb); tx_priv->xmit_timestamp = ktime_get(); skb_queue_tail(&stats->pending, skb); @@ -192,7 +200,9 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; WARN_ON(skb_get_queue_mapping(skb) > 3); + WARN_ON(!atomic_read(&queue->pending_frames)); + atomic_dec(&queue->pending_frames); skb_unlink(skb, &stats->pending); skb_queue_tail(&queue->queue, skb); return 0; @@ -201,7 +211,12 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb) { struct wfx_queue_stats *stats = &wdev->tx_queue_stats; + struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; + WARN_ON(skb_get_queue_mapping(skb) > 3); + WARN_ON(!atomic_read(&queue->pending_frames)); + + atomic_dec(&queue->pending_frames); skb_unlink(skb, &stats->pending); wfx_skb_dtor(wdev, skb); diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 2c4724699ed0..c24b8cd41a78 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -9,6 +9,7 @@ #define WFX_QUEUE_H #include +#include #include "hif_api_cmd.h" @@ -20,6 +21,7 @@ struct wfx_vif; struct wfx_queue { struct sk_buff_head queue; + atomic_t pending_frames; }; struct wfx_queue_stats { From patchwork Wed Apr 1 11:03:55 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: 1265139 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=iUvtOZKL; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk0b5sFcz9sT6 for ; Wed, 1 Apr 2020 22:06:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732664AbgDALGf (ORCPT ); Wed, 1 Apr 2020 07:06:35 -0400 Received: from mail-bn7nam10on2089.outbound.protection.outlook.com ([40.107.92.89]:6053 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732412AbgDALFL (ORCPT ); Wed, 1 Apr 2020 07:05:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IU1KLuT+XjnOvOM7FyShH9zSPM4yozWCwzMuiR/WKHVY8kv2kkYyb5/8c9qcCRqs4DTDyOsPq+fCZbXiZm3yB3p2vAGNyLMmLLBUxryFoX9uc/4R3C0YpEJPnd0FTnuquBC45/NovEHpvtGGw8jNkRPnCH179+dI4cYsDwHy+QtDjJx4xlVQpZ2Zz7vpq41twiptL8pscjZLkwv9JwV5IFciQ12aG38xoADcQO2+tCGjwOKgt88kR4pvnCXW0fLrJiYdw5D8Pho00kO3ZlvfMPqxX27eqxBPuM97tRNevtb7aD6Oq56RsJ79aOqR2TLEwQcsnxkDdBL+KkM39IcXbA== 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=5afC7/e2E2WYAJ4SwTxjg+t8JqdclpcyhV0d8Fdr3ss=; b=MbBlO4QQ+Lp3VKZjm+tZe9iuhNeH5ztVb4s2tALit5mwlVOwEWOpZ3qBZ8W4ck5S2cNZb/tS1y7roHNhF8Hbx7/DPFW7qTUJz/GheY+S36hZpzeYI07StdWzgtogIr5EAnv3E1XAXA/k8xP0Nm1rWAIUZsmxnMjkT9deFbQBUY8yYRLUayLFobL1lAfYjyvXA9PZ2ZDWZxM/VqBGyTPNbveD8uJQb053iUsMO3DyxVPH+vLoSv7ff7bOhXFatxoma+km+r0dg8JMh/obL9TceLm0PNHA+o6zDitJY3oYYIKlt0pCPY02bmq6mI6ncwd4A57zi01A6PZDiHcDZZptUQ== 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=5afC7/e2E2WYAJ4SwTxjg+t8JqdclpcyhV0d8Fdr3ss=; b=iUvtOZKLHqCg2lJIEO+Ddt2eHqzKD5MjGcCS74810FKuziDMi4cVd6dKbxsZxSEKALcdfn+Br20kX+wYUvCPlC+W/yY/FWY/RDZQief3LbhwLyzEyir+iMLafTKV23nYJ6VSlqCfQ0j1J7vZ+fCESl1OylicnG0xoFSbFpFCQ8A= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:05 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:05 +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 22/32] staging: wfx: change the way to choose frame to send Date: Wed, 1 Apr 2020 13:03:55 +0200 Message-Id: <20200401110405.80282-23-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:03 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9aed5a88-ca27-4147-6eb8-08d7d62c8809 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(30864003)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005)(43043002); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2B4e0fQ3E/Bgqk+G5UOl+1NAT62eEHLa9X9ownQ+sinbVsuUqdm0xKdtfvCmOFSYiSiaSybzvPdpnLG4xdqbNOLLG/d5ksQ2lIgvl4zdDfJ1nmckEYLQyY6qaWe+A/IdxpxSbVZ5tvgV/VUycqWe7u3B/GdMPoq3O1q5oZDPWp1sEYg6BFJEf8x7yFE8bgXoBUUHdWoRCt4uINgJQblDY5XfY7YQcq7hQ3DLjz1aP9Qv81XUs/j1e/uYx7lyv5uzWTuPPCZPfbbZk+An6Y1BvwZKqYK1ir+j78S3vpIRZWNXll1fT94QCefkUlFmzV7boYkF7r5N/+NA1HLVaHbwI8QDYGg/pvDSPfSeWzTvGdv6nVk/5ASDtxPkqb1J9R7UXfB0qJ4HBkaU6HpsH9M7LeOTNwB0sjE7eEVHFV+loux1tyo8JAT1Xy4a4wEt1EBDcpHQ/AVMsoo+gZNAhEavE+Y4I90eHnAEv39ZbkDq21UJmlxsnToLszS5GZq1MW89 X-MS-Exchange-AntiSpam-MessageData: QfFAk8RoP033863JpAgQRfXTLWqN8sH5qOtcQyopEtxC8yXgOLp0KUp0oqYIaLsA3IrkgwZDSSz6Sut1lImjPyEko2gzn15XUhCixWdhwHfyDKlSBYjsSSaveyFhjleDStHR+VYjSC/wWtamSIopK5ovLBwhrwqIPwLNrP5+6mxROgkmVrxRhJi1PpHyAhII8dKf03ibm1JZDiNDLjuflw== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9aed5a88-ca27-4147-6eb8-08d7d62c8809 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:04.8687 (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: cZJM4w1Th/IBphaOc7TKg5fqYkw2IShH1u/cSTYvguPpHLzbMMY92BJICvKlS/eqj1ef5zXAjt8zT9+VIvot7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The current code computes itself the QoS policy to choose which frame should be sent. However, firmware already do that job. Firmware would prefer to have packets in every queues and be able to choose itself which queue to use. So, this patch sort the queues from the emptiest to the fulliest (thanks to the pending frames counter introduced a few commits earlier). It send frame to the least full queue. However, we continue to be careful with frames that have to be sent after a dtim ("cab": Content After (DTIM) Beacon). So, this patch splits AC queues in two skb_queues: one for normal frames and another for cab frames. It cares to send frames from CAB skb_queue if appropriate. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 238 ++++++++++++++---------------------- drivers/staging/wfx/queue.h | 4 +- 2 files changed, 94 insertions(+), 148 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 21a2c8aabbb9..b45fb837f1cd 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -83,13 +83,20 @@ void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif) wfx_tx_lock_flush(wdev); for (i = 0; i < IEEE80211_NUM_ACS && done; ++i) { queue = &wdev->tx_queue[i]; - spin_lock_bh(&queue->queue.lock); - skb_queue_walk(&queue->queue, item) { - hif = (struct hif_msg *) item->data; + spin_lock_bh(&queue->normal.lock); + skb_queue_walk(&queue->normal, item) { + hif = (struct hif_msg *)item->data; if (hif->interface == wvif->id) done = false; } - spin_unlock_bh(&queue->queue.lock); + spin_unlock_bh(&queue->normal.lock); + spin_lock_bh(&queue->cab.lock); + skb_queue_walk(&queue->cab, item) { + hif = (struct hif_msg *)item->data; + if (hif->interface == wvif->id) + done = false; + } + spin_unlock_bh(&queue->cab.lock); } if (!done) { wfx_tx_unlock(wdev); @@ -103,7 +110,9 @@ static void wfx_tx_queue_clear(struct wfx_dev *wdev, struct wfx_queue *queue, { struct sk_buff *item; - while ((item = skb_dequeue(&queue->queue)) != NULL) + while ((item = skb_dequeue(&queue->normal)) != NULL) + skb_queue_head(gc_list, item); + while ((item = skb_dequeue(&queue->cab)) != NULL) skb_queue_head(gc_list, item); } @@ -131,8 +140,10 @@ void wfx_tx_queues_init(struct wfx_dev *wdev) skb_queue_head_init(&wdev->tx_queue_stats.pending); init_waitqueue_head(&wdev->tx_queue_stats.wait_link_id_empty); - for (i = 0; i < IEEE80211_NUM_ACS; ++i) - skb_queue_head_init(&wdev->tx_queue[i].queue); + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + skb_queue_head_init(&wdev->tx_queue[i].normal); + skb_queue_head_init(&wdev->tx_queue[i].cab); + } } void wfx_tx_queues_deinit(struct wfx_dev *wdev) @@ -141,57 +152,15 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) wfx_tx_queues_clear(wdev); } -int wfx_tx_queue_get_num_queued(struct wfx_queue *queue) -{ - struct ieee80211_tx_info *tx_info; - struct sk_buff *skb; - int ret = 0; - - spin_lock_bh(&queue->queue.lock); - skb_queue_walk(&queue->queue, skb) { - tx_info = IEEE80211_SKB_CB(skb); - if (!(tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)) - ret++; - } - spin_unlock_bh(&queue->queue.lock); - return ret; -} - void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb) { - skb_queue_tail(&queue->queue, skb); -} + struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); -static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, - struct wfx_queue *queue, - bool mcast) -{ - struct wfx_queue_stats *stats = &wdev->tx_queue_stats; - struct ieee80211_tx_info *tx_info; - struct sk_buff *item, *skb = NULL; - struct wfx_tx_priv *tx_priv; - - spin_lock_bh(&queue->queue.lock); - skb_queue_walk(&queue->queue, item) { - tx_info = IEEE80211_SKB_CB(item); - if (mcast == !!(tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM)) { - skb = item; - break; - } - } - spin_unlock_bh(&queue->queue.lock); - if (skb) { - skb_unlink(skb, &queue->queue); - atomic_inc(&queue->pending_frames); - tx_priv = wfx_skb_tx_priv(skb); - tx_priv->xmit_timestamp = ktime_get(); - skb_queue_tail(&stats->pending, skb); - if (skb_queue_empty(&queue->queue)) - wake_up(&stats->wait_link_id_empty); - return skb; - } - return skb; + if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) + skb_queue_tail(&queue->cab, skb); + else + skb_queue_tail(&queue->normal, skb); } int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) @@ -204,7 +173,7 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) atomic_dec(&queue->pending_frames); skb_unlink(skb, &stats->pending); - skb_queue_tail(&queue->queue, skb); + wfx_tx_queue_put(wdev, queue, skb); return 0; } @@ -282,20 +251,15 @@ unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, bool wfx_tx_queues_has_cab(struct wfx_vif *wvif) { struct wfx_dev *wdev = wvif->wdev; - struct ieee80211_tx_info *tx_info; - struct hif_msg *hif; - struct sk_buff *skb; int i; - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - skb_queue_walk(&wdev->tx_queue[i].queue, skb) { - tx_info = IEEE80211_SKB_CB(skb); - hif = (struct hif_msg *)skb->data; - if ((tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) && - (hif->interface == wvif->id)) - return true; - } - } + if (wvif->vif->type != NL80211_IFTYPE_AP) + return false; + for (i = 0; i < IEEE80211_NUM_ACS; ++i) + // Note: since only AP can have mcast frames in queue and only + // one vif can be AP, all queued frames has same interface id + if (!skb_queue_empty_lockless(&wdev->tx_queue[i].cab)) + return true; return false; } @@ -304,7 +268,8 @@ bool wfx_tx_queues_empty(struct wfx_dev *wdev) int i; for (i = 0; i < IEEE80211_NUM_ACS; i++) - if (!skb_queue_empty_lockless(&wdev->tx_queue[i].queue)) + if (!skb_queue_empty_lockless(&wdev->tx_queue[i].normal) || + !skb_queue_empty_lockless(&wdev->tx_queue[i].cab)) return false; return true; } @@ -350,95 +315,76 @@ static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) } } -static struct wfx_queue *wfx_tx_queue_mask_get(struct wfx_vif *wvif) +static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev) { - const struct ieee80211_tx_queue_params *edca; - unsigned int score, best = -1; - int winner = -1; - int i; - - /* search for a winner using edca params */ - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - int queued; - - edca = &wvif->edca_params[i]; - queued = wfx_tx_queue_get_num_queued(&wvif->wdev->tx_queue[i]); - if (!queued) - continue; - score = ((edca->aifs + edca->cw_min) << 16) + - ((edca->cw_max - edca->cw_min) * - (get_random_int() & 0xFFFF)); - if (score < best && (winner < 0 || i != 3)) { - best = score; - winner = i; - } - } - - if (winner < 0) - return NULL; - return &wvif->wdev->tx_queue[winner]; -} - -struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) -{ - struct sk_buff *skb; - struct hif_msg *hif = NULL; - struct wfx_queue *queue = NULL; - struct wfx_queue *vif_queue = NULL; + struct wfx_queue *sorted_queues[IEEE80211_NUM_ACS]; struct wfx_vif *wvif; - int i; - - if (atomic_read(&wdev->tx_lock)) - return NULL; + struct hif_msg *hif; + struct sk_buff *skb; + int i, j; + // bubble sort + for (i = 0; i < IEEE80211_NUM_ACS; i++) { + sorted_queues[i] = &wdev->tx_queue[i]; + for (j = i; j > 0; j--) + if (atomic_read(&sorted_queues[j]->pending_frames) > + atomic_read(&sorted_queues[j - 1]->pending_frames)) + swap(sorted_queues[j - 1], sorted_queues[j]); + } wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - if (wvif->after_dtim_tx_allowed) { - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { - skb = wfx_tx_queue_get(wvif->wdev, - &wdev->tx_queue[i], - true); - if (skb) { - hif = (struct hif_msg *)skb->data; - // Cannot happen since only one vif can - // be AP at time - WARN_ON(wvif->id != hif->interface); - return hif; - } - } - // No more multicast to sent - wvif->after_dtim_tx_allowed = false; - schedule_work(&wvif->update_tim_work); + if (!wvif->after_dtim_tx_allowed) + continue; + for (i = 0; i < IEEE80211_NUM_ACS; i++) { + skb = skb_dequeue(&sorted_queues[i]->cab); + if (!skb) + continue; + // Note: since only AP can have mcast frames in queue + // and only one vif can be AP, all queued frames has + // same interface id + hif = (struct hif_msg *)skb->data; + WARN_ON(hif->interface != wvif->id); + WARN_ON(sorted_queues[i] != + &wdev->tx_queue[skb_get_queue_mapping(skb)]); + atomic_inc(&sorted_queues[i]->pending_frames); + return skb; } + // No more multicast to sent + wvif->after_dtim_tx_allowed = false; + schedule_work(&wvif->update_tim_work); } + for (i = 0; i < IEEE80211_NUM_ACS; i++) { + skb = skb_dequeue(&sorted_queues[i]->normal); + if (skb) { + WARN_ON(sorted_queues[i] != + &wdev->tx_queue[skb_get_queue_mapping(skb)]); + atomic_inc(&sorted_queues[i]->pending_frames); + return skb; + } + } + return NULL; +} + +struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) +{ + struct wfx_tx_priv *tx_priv; + struct sk_buff *skb; + + if (atomic_read(&wdev->tx_lock)) + return NULL; for (;;) { - int ret = -ENOENT; - int queue_num; - - wvif = NULL; - while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { - vif_queue = wfx_tx_queue_mask_get(wvif); - if (vif_queue) { - if (queue && queue != vif_queue) - dev_info(wdev->dev, "vifs disagree about queue priority\n"); - queue = vif_queue; - ret = 0; - } - } - - if (ret) - return NULL; - - queue_num = queue - wdev->tx_queue; - - skb = wfx_tx_queue_get(wdev, queue, false); + skb = wfx_tx_queues_get_skb(wdev); if (!skb) - continue; - + return NULL; + skb_queue_tail(&wdev->tx_queue_stats.pending, skb); + if (wfx_tx_queues_empty(wdev)) + wake_up(&wdev->tx_queue_stats.wait_link_id_empty); + // FIXME: is it useful? if (wfx_handle_tx_data(wdev, skb)) - continue; /* Handled by WSM */ - + continue; + tx_priv = wfx_skb_tx_priv(skb); + tx_priv->xmit_timestamp = ktime_get(); return (struct hif_msg *)skb->data; } } diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index c24b8cd41a78..8e99bb2792ed 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -20,7 +20,8 @@ struct wfx_dev; struct wfx_vif; struct wfx_queue { - struct sk_buff_head queue; + struct sk_buff_head normal; + struct sk_buff_head cab; // Content After (DTIM) Beacon atomic_t pending_frames; }; @@ -44,7 +45,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); -int wfx_tx_queue_get_num_queued(struct wfx_queue *queue); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb); From patchwork Wed Apr 1 11:03:56 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: 1265140 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=RgY7f7V0; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk0h01Ftz9sSb for ; Wed, 1 Apr 2020 22:06:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732677AbgDALGm (ORCPT ); Wed, 1 Apr 2020 07:06:42 -0400 Received: from mail-eopbgr750070.outbound.protection.outlook.com ([40.107.75.70]:46082 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732431AbgDALFL (ORCPT ); Wed, 1 Apr 2020 07:05:11 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OyuqE/tBDSZxMzwEkCKdSiIy+kgsn0n/RLXKFXvnXHoSgjte5T4e0TMHUgx9CEfu/hvYW2vje2l+RwS3ra32EOV0QRzkcTfv/Wq90ez4aV0a0hr/K/KIKf+lg93Uuc8cPtN40AWr3xEE1M80csF2+aM8Mm6CdUF0Nlvtnx2zMN0SoXiJ+2KgPctX+VqdARCOga/6uj6OkVsZb9BUklgeZH+b2uwBNfn+sLgOX4YF/uoLHB7iTXpgv1f1fm3jERqznnW3Ywfo750Szh0NRGst6uC48t2WffJ3mcPyDvzczUPz5r+X7x++7uzZXiaPxtNn66qTcM52bemEKZAUz9hMrw== 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=w5RE61aEh8TA6jceHMMeJhKCrBm8qbsZvDmJckrPQdc=; b=ItZhHK9MYMcbYRxfT05dNZI7KrM1iQQ6ThhOQeBVnVsCzkG6iOm/6xH6y0OCmCK61qA3Zav8FlV1uhLjIhsqj4oZdZag3krPUzCSOr4cDrMjh1t2y8hpqhyBdHHFafS+lki2wMunGZHgV7p2AD4K3KCKgalmRRgk5SKWAZLATB4jYxA10YkD6yeAECRClYjNPLPiDbczxsv+W5p9wkBNdHiK2umVm2kK21SPHQ+z7Y8+gpm+b1iC2jiQFGbRbLYNsbhuNRdoDaOoAvO1OG9xHJA41/zGRRBposZ0ScZyoOC3lq/GYicaes4w+HPv+BZ/KkqHxzbHRnV6DUh8Qavvvg== 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=w5RE61aEh8TA6jceHMMeJhKCrBm8qbsZvDmJckrPQdc=; b=RgY7f7V0FiTRJd9W1erFykLxXLWZ5XDIudtghoUCfe1rkgUK62D3TFTeMXma/xbG2dWR9ihOUjY3xwPhUXpdGQkthct6JJjLZkAtiLF30a5mUl5Sc1aN+4+osoP6er3znCh0B7/o7tAvHdbdiouMhgVSk7hnhIS9NPav3UqURqY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:07 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:07 +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 23/32] staging: wfx: drop now useless field edca_params Date: Wed, 1 Apr 2020 13:03:56 +0200 Message-Id: <20200401110405.80282-24-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:05 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b28649f4-14d1-4c49-46fe-08d7d62c8943 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hmHILPmTYSTaHZ8WCEY0xJi70LX6RPxqUb8eHFO7R1SHZxtB0Kv5ndwefKGwxSmvySX9ngx0QqBL45AiGyK8Awhs4yPWH3+fGPl2yzTZzRHMHkd1PfB3pIW4v81gQJDdYFszA4YZzxB8TFi0zn76UIjvG2TljU2af+e4J9pk0JhnpgvKE6xEzRhENCSIH0KZoetUvNeGRCvn+joW/zbXvI+R/VWgTP38aIP8R9QZbKFo3p47PfPDah0T+dJcsmzTsJCoAyQII0HSoHQfGbXOV/hPEqH0+moT32FtkEaryfvWJZqn2rNbbcpURjIcyZQVmUuOagvjhGg5uc2psTz3zia+zd8MTpxr7Gw3I3dc76ltEHtAh6EnQGTjbjREjPQhY9QTVZWvZ51zGLTz5VmKtt/ogTzNwY7+C5JJczu1rkD+ex8JKJM88X+iAkdXx8wk X-MS-Exchange-AntiSpam-MessageData: NKqazT9u1bmKhdCmpJENthVZlJjuMjbOEPzNiYIs5EcloXEI1uhP9+CKn7N1VyM9WfyhzI3Ps3RATvyUsbsejHXn0PrqVINCbKMmzrVa237R+4lXXxjcc7LCgbosDQMWgSVA2st2t7/rQJc2zJTZzKP4FfCxw5UdOlj0DsMfsHZFVrvzNNw+1Y6WKNUCR0pp2rX0QjRQJ2GJ5zEzfvvAXQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b28649f4-14d1-4c49-46fe-08d7d62c8943 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:06.8915 (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: RGq1e84p6mbXbCkAJARsHLnfIWN0AyAo6/+RkoBnu2PPkNs6on2mbFFbOxZ88gIFBjfXmgNWg8vM62+pdHzjiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Since we do not rely in QoS parameters to choose which frame to send, it is no more necessary to keep a copy of EDCA parameters. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 1 - drivers/staging/wfx/wfx.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index e1d7a0670c9d..15f00ea84068 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -298,7 +298,6 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, mutex_lock(&wdev->conf_mutex); assign_bit(queue, &wvif->uapsd_mask, params->uapsd); - memcpy(&wvif->edca_params[queue], params, sizeof(*params)); hif_set_edca_queue_params(wvif, queue, params); if (wvif->vif->type == NL80211_IFTYPE_STATION && old_uapsd != wvif->uapsd_mask) { diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 61899cd7942b..6b5b95a45e60 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -94,7 +94,6 @@ struct wfx_vif { struct work_struct update_filtering_work; unsigned long uapsd_mask; - struct ieee80211_tx_queue_params edca_params[IEEE80211_NUM_ACS]; struct hif_req_set_bss_params bss_params; struct work_struct bss_params_work; From patchwork Wed Apr 1 11:03:57 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: 1265129 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=MOGBpe95; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjz53N0fz9sSw for ; Wed, 1 Apr 2020 22:05:21 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732242AbgDALFS (ORCPT ); Wed, 1 Apr 2020 07:05:18 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732441AbgDALFM (ORCPT ); Wed, 1 Apr 2020 07:05:12 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AA77cmsSQfX2P5UcE1b5CEE80ginMeJF6xK8ehxAFQwsQNbyafH4aaJa4BukIf24gmHtdbO7wICL/IfW80VeLdgw2VAR1wLcVPohltojw0P6WZBhmpERi6UE3rJlL0Szmbe1JpPHF1bbR7WBD3iHwy6GbpbhZVK+kcuNNvLzZgTmZnDr1hrSftGWuXuBYSc1HXI0XDJST/qPxlNy7zwzmIBvs+/RnJiijf6U6N3QcEmNyy02cs7mtyjdwEPmRAIZzOviCQpveZO/PqG7/a2m1oDdLZZ59kQYA0GHjueHJ2gYsLbyi+iPcADqiqG8c6wArvx306gg1idP4V3vYG0O1g== 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=ADI/HTZknKww89v+/KToEisrEZcdFerjBHSWKVVMbto=; b=MYliBoeIeBw/duj3PApY7zBxp0kLVFFhQhdhYhxqAyKyA9uXvlML+CtF87XpW9eKGHzgwrw8rlAt6Ysq2eH3zQ4HXWBZBpcLfHSuDIgkVCtMeLlm9L/aFw1fWPQtuDk1xN3GgSX7v9npEG6H2O700YFN6CQylAb4idmS562S5MdxACoSrRJndeB0/KZ+CHPvq3fy30BVpSLXZ2jUEYGoSnyJIZecQ7zxMnSSsh/H0jWUFn/JcYzmaJt9jrUTXuaaqmwY4/5KnIrmiTFd5F6qZ+h+XtUhTUUU2QNY7Wf4NVuACmKyuC3DuWZi6UjJA7C3d44tCqRdMYUYpejJZ5MMcg== 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=ADI/HTZknKww89v+/KToEisrEZcdFerjBHSWKVVMbto=; b=MOGBpe95dj+oZtFSC06HtI4ajGYRs6MbwsTEJM69cnyjB7J3KzASJN0cIWmZG8yLd79pmaE6Ms4a/T2EON+Vrlz9v9TFCsVoWZZz+XGfSgv8iM1QQNYhbzfeFGxZvH5M5g4m0E4lrSw711MFYcLkvh7sOk6GrD1EpQOWnq7i/qQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:09 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:09 +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 24/32] staging: wfx: drop struct wfx_queue_stats Date: Wed, 1 Apr 2020 13:03:57 +0200 Message-Id: <20200401110405.80282-25-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:07 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3dfbd0f1-797e-4ca5-d64c-08d7d62c8a71 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1303; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wU24RMWgRSTndmNu7CzcFEdhhuP+rVnrNKW/tDsQRx7f49PwhMZhgJ97aDTld/v/Q1VxGDB/5NXVqN/pVWZ8Pgd85dNY7fc7PRDNzoL/lHFsEo5AZp4A2Q2/BjLp/qqDPoM1c33nIHoCRzWERY210Mwbh8ZQFOPPhAesajIyKWIkgSWMdLTzVvR5wAH2+FXPFYU76ZsmA0HvedJZNK122dhp7THC1iDfVYsj14+kXT7Q9MEFX8gsjyrea4QHpNG2PZDtRWw+R+RuChFkqQHegkx5UPj+J7XhZ5ookxmaX8pYugIt3YdCCqsMIzEQxoNI9ohAgc2Ud/6PGlWuiPip2S5ibqa0N10h3nzEKsB63HlQS48ahRZovuOs2rtBCnDBj8dW51Qoxnkcym5DQF62GvHzabp0OfshTKJqge8KDau4N7koqdFpgrsMbR9O5V87 X-MS-Exchange-AntiSpam-MessageData: HjB08tcpg3jYEHLOPIAFpvPHHchD9OO9CSYdfAsA8biy9o/mlmr8CGz3e+8tlXFBGUsJxG5fVptJn1kDROYgslj1w0wb/DqrXj93KHpTVE5kCT5lIUrzG4vTsXjOQlq8+FBhc0Q92IMSRd+gkQHOdXGFVc5FJmB6xvi99/0ENjTyVaeZB4gvlnP+6dr3kc7VFFZVw//br1hAVNv9vtPzXg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3dfbd0f1-797e-4ca5-d64c-08d7d62c8a71 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:08.8724 (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: zUGgnkaHo69KmKRpqq8upfxuJ01IWMLIuVkePgCuJnhbLg/lDfbhL6oFA5kk778ylf5SQ/iRJo34vwLpoLV2+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller There is no reason to keep the intermediate struct wfx_queue_stats. Relocate its members to struct wfx_dev. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 36 +++++++++++++++--------------------- drivers/staging/wfx/queue.h | 5 ----- drivers/staging/wfx/sta.c | 2 +- drivers/staging/wfx/wfx.h | 3 ++- 4 files changed, 18 insertions(+), 28 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index b45fb837f1cd..a03860db2f54 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -121,12 +121,11 @@ void wfx_tx_queues_clear(struct wfx_dev *wdev) int i; struct sk_buff *item; struct sk_buff_head gc_list; - struct wfx_queue_stats *stats = &wdev->tx_queue_stats; skb_queue_head_init(&gc_list); for (i = 0; i < IEEE80211_NUM_ACS; ++i) wfx_tx_queue_clear(wdev, &wdev->tx_queue[i], &gc_list); - wake_up(&stats->wait_link_id_empty); + wake_up(&wdev->tx_dequeue); while ((item = skb_dequeue(&gc_list)) != NULL) wfx_skb_dtor(wdev, item); } @@ -135,10 +134,9 @@ void wfx_tx_queues_init(struct wfx_dev *wdev) { int i; - memset(&wdev->tx_queue_stats, 0, sizeof(wdev->tx_queue_stats)); memset(wdev->tx_queue, 0, sizeof(wdev->tx_queue)); - skb_queue_head_init(&wdev->tx_queue_stats.pending); - init_waitqueue_head(&wdev->tx_queue_stats.wait_link_id_empty); + skb_queue_head_init(&wdev->tx_pending); + init_waitqueue_head(&wdev->tx_dequeue); for (i = 0; i < IEEE80211_NUM_ACS; ++i) { skb_queue_head_init(&wdev->tx_queue[i].normal); @@ -148,7 +146,7 @@ void wfx_tx_queues_init(struct wfx_dev *wdev) void wfx_tx_queues_deinit(struct wfx_dev *wdev) { - WARN_ON(!skb_queue_empty(&wdev->tx_queue_stats.pending)); + WARN_ON(!skb_queue_empty(&wdev->tx_pending)); wfx_tx_queues_clear(wdev); } @@ -165,28 +163,26 @@ void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) { - struct wfx_queue_stats *stats = &wdev->tx_queue_stats; struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; WARN_ON(skb_get_queue_mapping(skb) > 3); WARN_ON(!atomic_read(&queue->pending_frames)); atomic_dec(&queue->pending_frames); - skb_unlink(skb, &stats->pending); + skb_unlink(skb, &wdev->tx_pending); wfx_tx_queue_put(wdev, queue, skb); return 0; } int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb) { - struct wfx_queue_stats *stats = &wdev->tx_queue_stats; struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; WARN_ON(skb_get_queue_mapping(skb) > 3); WARN_ON(!atomic_read(&queue->pending_frames)); atomic_dec(&queue->pending_frames); - skb_unlink(skb, &stats->pending); + skb_unlink(skb, &wdev->tx_pending); wfx_skb_dtor(wdev, skb); return 0; @@ -196,32 +192,30 @@ struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id) { struct sk_buff *skb; struct hif_req_tx *req; - struct wfx_queue_stats *stats = &wdev->tx_queue_stats; - spin_lock_bh(&stats->pending.lock); - skb_queue_walk(&stats->pending, skb) { + spin_lock_bh(&wdev->tx_pending.lock); + skb_queue_walk(&wdev->tx_pending, skb) { req = wfx_skb_txreq(skb); if (req->packet_id == packet_id) { - spin_unlock_bh(&stats->pending.lock); + spin_unlock_bh(&wdev->tx_pending.lock); return skb; } } - spin_unlock_bh(&stats->pending.lock); + spin_unlock_bh(&wdev->tx_pending.lock); WARN(1, "cannot find packet in pending queue"); return NULL; } void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms) { - struct wfx_queue_stats *stats = &wdev->tx_queue_stats; ktime_t now = ktime_get(); struct wfx_tx_priv *tx_priv; struct hif_req_tx *req; struct sk_buff *skb; bool first = true; - spin_lock_bh(&stats->pending.lock); - skb_queue_walk(&stats->pending, skb) { + spin_lock_bh(&wdev->tx_pending.lock); + skb_queue_walk(&wdev->tx_pending, skb) { tx_priv = wfx_skb_tx_priv(skb); req = wfx_skb_txreq(skb); if (ktime_after(now, ktime_add_ms(tx_priv->xmit_timestamp, @@ -236,7 +230,7 @@ void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms) ktime_ms_delta(now, tx_priv->xmit_timestamp)); } } - spin_unlock_bh(&stats->pending.lock); + spin_unlock_bh(&wdev->tx_pending.lock); } unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, @@ -377,9 +371,9 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) skb = wfx_tx_queues_get_skb(wdev); if (!skb) return NULL; - skb_queue_tail(&wdev->tx_queue_stats.pending, skb); + skb_queue_tail(&wdev->tx_pending, skb); if (wfx_tx_queues_empty(wdev)) - wake_up(&wdev->tx_queue_stats.wait_link_id_empty); + wake_up(&wdev->tx_dequeue); // FIXME: is it useful? if (wfx_handle_tx_data(wdev, skb)) continue; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 8e99bb2792ed..241ca3039b54 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -25,11 +25,6 @@ struct wfx_queue { atomic_t pending_frames; }; -struct wfx_queue_stats { - struct sk_buff_head pending; - wait_queue_head_t wait_link_id_empty; -}; - void wfx_tx_lock(struct wfx_dev *wdev); void wfx_tx_unlock(struct wfx_dev *wdev); void wfx_tx_flush(struct wfx_dev *wdev); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 15f00ea84068..340e09bb639d 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -323,7 +323,7 @@ static int __wfx_flush(struct wfx_dev *wdev, bool drop) for (;;) { if (drop) wfx_tx_queues_clear(wdev); - if (wait_event_timeout(wdev->tx_queue_stats.wait_link_id_empty, + if (wait_event_timeout(wdev->tx_dequeue, wfx_tx_queues_empty(wdev), 2 * HZ) <= 0) return -ETIMEDOUT; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 6b5b95a45e60..af4c93af81be 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -50,7 +50,8 @@ struct wfx_dev { struct wfx_hif_cmd hif_cmd; struct wfx_queue tx_queue[4]; - struct wfx_queue_stats tx_queue_stats; + struct sk_buff_head tx_pending; + wait_queue_head_t tx_dequeue; atomic_t tx_lock; atomic_t packet_id; From patchwork Wed Apr 1 11:03:58 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: 1265138 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=VBN58U+r; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk0P6zNXz9sT6 for ; Wed, 1 Apr 2020 22:06:29 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732652AbgDALG0 (ORCPT ); Wed, 1 Apr 2020 07:06:26 -0400 Received: from mail-bn7nam10on2067.outbound.protection.outlook.com ([40.107.92.67]:6024 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732461AbgDALFN (ORCPT ); Wed, 1 Apr 2020 07:05:13 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CMzf+wbiNmbmyXhoWK1hYBAM/TAnWC+P6WwhX6hfUZ2tN242w33hCfmdVOIOVTbQWc0HV292pRMKZuFPqRqS0wbPRzvz6pZWiTArpLdRcwidae5iw+uRvzF7T2OssSkFK+VODNK6FZ4C6zIILteNviCDQmuVldCMpQedQqLdlRmHnXB10t03rLF0Pk3JVq05AfyIYR/efo+fAUqcpBRqZ13PfACMVC1erRIp5kFFLJw7czCUJnsm6xXx7QsBfrsUkReFqmPZUkIRs0dhFuCZzxoLlqMAmICZsbgAGfY+lOVBBINuglTh9jdPh+VEeJWCkxap5kPq+8VMvGBOU3fjyA== 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=SrPGMLsUEPUKhc3RhU1c5TMkTtuEHRylbkifV77yKIE=; b=KzjGcCvWYatJdYVWBLYloB56fHZIR3t3YbiqDm3dwQkqQmdl8jzB1tLtLZr8An7sAHnLlE0SisWhRR9nT88m2BMT1MMSwQ2wM+Rdoi2M/syL6gemRGzpLi4cHrcSiSdmE7wK3kv6SC25bZJ1fkLtVNO3gmvKkTWMUyeG8Zt8a7zXMF/cF5NjphGllr2f1cxPymk3r384g0aLHWC0V/Jfr47vr/BWPttVqQb6opaaF/xD6OV05TDpLcxu9sa4ICNMsBkruRXSe/tLUaXAs7cqPVF3RtU8AJd3y3q+3xn25hs8ae1kl1h10E3hvzgcYZ1tiztNgIaa+DHHQzmOCuHb9A== 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=SrPGMLsUEPUKhc3RhU1c5TMkTtuEHRylbkifV77yKIE=; b=VBN58U+rgULbzVWJvYWUm00f3Hdvq+I7JplszFDkQMSmBsv1Hy9vXjmCTvT2MZ3AMmaG1BLWQFNXqSAfaFtNKi69GbEkWXtc/j4DatXyZG5TqBD03NcwKFrn6wXOCkjkTXu8Rn6/tExbvD9XMUlLm5mCApgCYCDsPphiyud4Z0o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:11 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:11 +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 25/32] staging: wfx: simplify usage of wfx_tx_queues_put() Date: Wed, 1 Apr 2020 13:03:58 +0200 Message-Id: <20200401110405.80282-26-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:09 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 938b6c8e-ca5e-43d9-a11c-08d7d62c8bb1 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /vyoY46YSncBi8N6TLiuZ05Fl/YsDNq3A/L4Yj6BL1cbED3dASjytmxJZwN3QlgkSCIrCdNEu7WXibphrQYeQkEQFF5weoZJbmVS9eqIqh419n8pzlN4zpmhiKLLiJn/y79QwZCy9fl6UbUelq1+q/ynrC52wiHSTJpJZ624E1PAzdy7ib0Y4HTHSrjSeoBpmULQLWRDLf/AjT5Hj4fEJ6YfygNklrjByInkxryID1tgpDnpF+bl1++SvNGy6WYMgvSenY6RN44MFs+iEkH2jHEGG8Bg3nIDw89j+AjoofKy+QKdZTApTkduDcZCoHwp0ecJVxiijJaeXIXGSAlbynA2FnYsrjGUmG8M0mrbyelcJ63iBoxw+/jY77OMki7y3qKseb/nyBoHuN+ulw1Ek+I7GrQUjgZNPeAhUKP7qXcA5TangqeYsVBPCY5KnBpT X-MS-Exchange-AntiSpam-MessageData: m2xNRBDodGcpHi9FDDN1K73uDIgvggk321DDv3eugaX62e6jHbDHaDjIpTedDkeT2hxu3TRbkDLc3XhGvJpUOcS+ofKHd9sXEqyS6w7mdCeO1ao9MmlgGQMbFUH8BVSe+xWT99P6/hBgQwfQj+XWPm5MO4mykDhkQZpnrzeXP+s0YMbCcNTTR5w+oY93Tk5FO4q+SBTuM+0QIm5EEW1dGA== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 938b6c8e-ca5e-43d9-a11c-08d7d62c8bb1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:11.3549 (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: pcDAsAAzybDjXMMKAh+otitrW8ToJwR6+VACUCHYVmw1cn8/oe4jbVr7+C8GD2xIZmg1jwZpkXSQPiEWC09Y5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller The queue used for wfx_tx_queue_put() can be deducted from the content of the skb. So drop this parameter from call to wfx_tx_queues_put(). In add, this change uniformizes usage of functions wfx_tx_queues_*. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- drivers/staging/wfx/queue.c | 6 +++--- drivers/staging/wfx/queue.h | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 2533d4f53f83..d2e925218eda 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -461,7 +461,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, // Auxiliary operations wfx_tx_manage_pm(wvif, hdr, tx_priv, sta); - wfx_tx_queue_put(wvif->wdev, &wvif->wdev->tx_queue[queue_id], skb); + wfx_tx_queues_put(wvif->wdev, skb); if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) schedule_work(&wvif->update_tim_work); wfx_bh_request_tx(wvif->wdev); diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index a03860db2f54..cc89bfe1dbb4 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -150,9 +150,9 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) wfx_tx_queues_clear(wdev); } -void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, - struct sk_buff *skb) +void wfx_tx_queues_put(struct wfx_dev *wdev, struct sk_buff *skb) { + struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) @@ -170,7 +170,7 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) atomic_dec(&queue->pending_frames); skb_unlink(skb, &wdev->tx_pending); - wfx_tx_queue_put(wdev, queue, skb); + wfx_tx_queues_put(wdev, skb); return 0; } diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 241ca3039b54..4851635d159b 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -36,10 +36,9 @@ void wfx_tx_queues_clear(struct wfx_dev *wdev); bool wfx_tx_queues_empty(struct wfx_dev *wdev); bool wfx_tx_queues_has_cab(struct wfx_vif *wvif); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); +void wfx_tx_queues_put(struct wfx_dev *wdev, struct sk_buff *skb); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); -void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, - struct sk_buff *skb); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb); From patchwork Wed Apr 1 11:03:59 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: 1265136 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=lDoAZBtF; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk0C0ylkz9sT6 for ; Wed, 1 Apr 2020 22:06:19 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732645AbgDALGS (ORCPT ); Wed, 1 Apr 2020 07:06:18 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732478AbgDALFQ (ORCPT ); Wed, 1 Apr 2020 07:05:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fiuOc9UUKb2YIfQYsT1sQM1b4h6rDJcMqqFS1bKl/n5I9NBxw2+EjlijqQfmen+QTXhgwFFPIUeLEWn6O0yT5iaz6ScCBxxzx+6r2lP5YnVZcuVrq/1avTAAAnfydAxS4hIg3GIL2QFA+4O2m0Rjla6jd5r8xNRkUcd8sKasCRPSNV6W6ic/NCQeW96cX5Wnr+JhoPcdA6UztKgAXxL50JuLniqOW63+sjyhS8RlRrVdSyt4+ZQwqDXcPTHmg8dlcTqNswpvZG2ePb1/Qbnb6jX2I4wEfuExGN2HS6AtMTdeYZus8QZn7LFDnhIimMDNYRcaxUPoHOFpIgyo4j9qiA== 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=JLXkHtgOfIXkrIv65auGzqAl7SnFA+CICIpiDZd5Mfc=; b=hbMMmN1mhanqW0eVozOPCYKmNE6eiX5xdjStQG2LwxVpiWyjIgIzJI3hA2J/YHrOA+ydlmu3LTA5j8MQdT6m6TCAZuKL6sF578KEmVWn9jo5vGlvxW+0PjNbpKNAS+nFz4e3+rk7r9YB9ij3pDAaokP9ucveaCW41VqEow8nnufU2QRKtvE7swEU9APxh7XZUwll8IK2tmpjN8QFnLmB1nhDhbCc1IFrC8Zj0uURfjDG/ZwZLvhBcepUTnykJmlbicJW86Aq7jmlwNfiEQNOW6sSvPS4mOaSJ3Fi2akPBDRjwDFj5eg4scWILj6Gwh0OPb4a7OC03NDqmD137G/1TQ== 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=JLXkHtgOfIXkrIv65auGzqAl7SnFA+CICIpiDZd5Mfc=; b=lDoAZBtFGGcMdA0kfRASUGKxWPZ3ctMXJpNMVS1XVfc/rIUcqMjgtipX+WW9TipT5kRFDzPP5Kv+52rYyiUPBhNInnqENBsliRq2dQDSVJEPSbm3KClpJNNvcvlb+T2LwRQdpmA1R7VW38PN5ksK5dPAppMFBdfhnrkN6Tnyuao= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:14 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:14 +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 26/32] staging: wfx: improve interface between data_tx.c and queue.c Date: Wed, 1 Apr 2020 13:03:59 +0200 Message-Id: <20200401110405.80282-27-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:11 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 97463663-6387-4ee3-38c8-08d7d62c8d22 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2201; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ctcs35DUbRf2jjxtaIJt/OZH50BOMMP/3GMj37QfEFi8DhsXm+u3KmRY1jZNhI+QDE8kZfvdlqo4kAB0by0IU0FaYSXpxf8rhD6aMR7tOTEQ2pBrDJgdtrK+u3XdIWDm4R752IhevIMb06R2+Vyp7jNwEkjeb2uk0BW6eliC39aeJviURE9FnLH6vuFJKeyEMdgei67/Ye0xmy684nQjVAFE9QIPmWusCAOCivRxYpA0ufCzgJbfE5WXIr0yu89t85KbM4zQ9XwocBJ3wUo6yShJw8DkoWoJ/EW+ZzOUx9fYO0Ksorf4Z4zyh5KzjrW0WKdtYzbdz8huzXdiziXS0rkRzSduw3B2QXv51K/7Ndg4zR2aIZdEIzJzJWCmHwEdh35QjrIvgNmTyP+QODcguNVi61ZmBvr1Xy3kxCvo9oFGMT8dJZkxM4nIs8rnPWVO X-MS-Exchange-AntiSpam-MessageData: o1fbsVfMdt7w74HbnjKvV1u9FqGuaCryNJ/XBVbfyR6LYOYhaBwe57Uzv11dG2UrUYw5BSIwhySgfvq8ESKCMnBawFfL478iTp3TFYlQLcDPNK/Ghx1vMW3/LlPvZj4aYWGCtRUWGU7Cin7jSvIeb5EkW7QVH6LiFCEgLRphr07e7JGW19WoMS4UU7bRpXLNTK+5GFxU0R8dh6cAfRaT8A== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97463663-6387-4ee3-38c8-08d7d62c8d22 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:14.2343 (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: xIEKb6xF6ach2a3TxsvXYiEBqbkVDrWNlRVjoD0JqGKbt6nJdfwDS8+6wMVQ99nEc52KHiMrql+p/por0eungA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Currently, wfx_pending_remove() (from queue.c) call wfx_skb_dtor() (from data_tx.c) that forward the tx status to mac80211. Moreover, there no purpose to retrieve a frame from the pending queue without dequeuing it. So, the main purpose of wfx_pending_remove() is to forward the tx status to mac80211. Let's make the architecture cleaner: - merge wfx_pending_remove() into wfx_pending_get() - call wfx_skb_dtor() from data_tx.c Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 2 +- drivers/staging/wfx/queue.c | 22 +++++++--------------- drivers/staging/wfx/queue.h | 1 - 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index d2e925218eda..17209f645e4b 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -586,7 +586,7 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) arg->packet_id == wvif->bss_loss_confirm_id) wfx_cqm_bssloss_sm(wvif, 0, 0, 1); } - wfx_pending_remove(wvif->wdev, skb); + wfx_skb_dtor(wvif->wdev, skb); } static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index cc89bfe1dbb4..a1a2f7756a27 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -174,30 +174,22 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) return 0; } -int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb) -{ - struct wfx_queue *queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; - - WARN_ON(skb_get_queue_mapping(skb) > 3); - WARN_ON(!atomic_read(&queue->pending_frames)); - - atomic_dec(&queue->pending_frames); - skb_unlink(skb, &wdev->tx_pending); - wfx_skb_dtor(wdev, skb); - - return 0; -} - struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id) { - struct sk_buff *skb; + struct wfx_queue *queue; struct hif_req_tx *req; + struct sk_buff *skb; spin_lock_bh(&wdev->tx_pending.lock); skb_queue_walk(&wdev->tx_pending, skb) { req = wfx_skb_txreq(skb); if (req->packet_id == packet_id) { spin_unlock_bh(&wdev->tx_pending.lock); + queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; + WARN_ON(skb_get_queue_mapping(skb) > 3); + WARN_ON(!atomic_read(&queue->pending_frames)); + atomic_dec(&queue->pending_frames); + skb_unlink(skb, &wdev->tx_pending); return skb; } } diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 4851635d159b..9bc1a5200e64 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -41,7 +41,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); -int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb); int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb); unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb); From patchwork Wed Apr 1 11:04:00 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: 1265135 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=a8cySrl6; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sk065jpjz9sSr for ; Wed, 1 Apr 2020 22:06:14 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732634AbgDALGK (ORCPT ); Wed, 1 Apr 2020 07:06:10 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732371AbgDALFU (ORCPT ); Wed, 1 Apr 2020 07:05:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DuIakfpLclIhvC08MDL/J8knykQsinZFlpg5IPJGTIXMgLQ2M7hLeionptugLsxuTKHfKYz+2V8k0bxkMl0Fj572jkWoEpzUm2T14IkxMfgjvzN4HTLRHtERbSF7MLUbRYjlyyh1CH9L6Pyc3QYZRwJgDEmV8t/cYU0ijypBqCzonKIT2DozlZOX71bCd6Nue38dImEo23NsSkHdzDO9ZX+Ah8Yrd21bKObIPKx3LM2rokLC1N7NtgY0EsqfqRt0DVfIyamX5CxI3IFdGMAdqP4yEvnEil3lZi8QqeRiNmaLkvsFO1D8hXNb3hhcMZQX+gIIcZAw5RMTiysjTFUEwA== 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=ipe2aWSSMB78BnIB4Y4LFB4IIbiiUl6mWBkN44tREXU=; b=IIi/uduRDDQfP7kFQecOJZqBIr1Ebqw7dj63N2eEKe9zivY/1tWtZnxEVPn+MPI0w3wbBrbYxxOZ3Z2gOLj1fxvhsPyfz6uvUQOccPbTb/Nx4U45JT2AGHJA5UZOd5cdq0Ud8TLjjllyuZAvo3/3J2kKvP5fGwOJnLwYpuoJUSOIE9z1JHtaBojS64lwrwXJPt+xs5/qWAO4m7PDQpqtO7Omx57IN8cMw8vNEup2HTTg4nWR9ZQwdpnwogDtO/zZhQkzm7L0exZUQRUN3pIClVfUTvY3FTkXtte8TA8gRO1TqaKaHei5rVttZ2gQP1p7aIjOh9gQy4B3INmEdsn5gA== 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=ipe2aWSSMB78BnIB4Y4LFB4IIbiiUl6mWBkN44tREXU=; b=a8cySrl6iFH6icN+yjjognMfL52vVldCG/9+vaE4GdDU8Sh2TzRDBY27GDUDLCxoervqR1rWAZyFAQbghqNIIrSCSlzOZYZb9P99Hj4MISdIgyvqaJmnauWLrrmYiEvMAI3AMY12ehm5YkDwPx0i7BQLj0VKV/yxV4bG4Bihfy8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:16 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05: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 27/32] staging: wfx: relocate wfx_skb_dtor() prior its callers Date: Wed, 1 Apr 2020 13:04:00 +0200 Message-Id: <20200401110405.80282-28-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:14 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 98face08-f269-438a-e95a-08d7d62c8ede X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VVVq+4BeHiIgyQUhbAaFp5+TuAjBw1M8BMgUj1Cf8dNjWCgGwFBMpetIYRindcY6XvKbjVF0pQgm4R+dJ8u0uSkTtubIDzuyDtMmwwpexl8c++KLurn96N3r873GlkpURHkQykcPIelS3buv6kHWjOGrNTo7UIMOjKpGryhjlVRHqFcYPDNnYx9Y/KR028rZ08bYGrgGmKYKkRC89TQUZhXajofrzojKQMxye+aBbhnsFOx7QBdDg7wt1Mz1uW4RcogZelNS30cZPM5xYV5hpNn66zDmNg1kcywye4pO5wzoJMOdRKjkGc/1pC4BJMBuv+fgLn/0bwuxwxAmSq5FjDshkYioLGkoX4dUVipenrSAfyXMr6LzdocR2h+y6olis5cilk7zqVSZovk7R8Mgeza/AGUV7uQEgKsEyqfXsFaTKuSqm1DwZJQp+GAwmOCZ X-MS-Exchange-AntiSpam-MessageData: VvsOg203fCxAOgFw5SmD5eD+P87gc4+3aDNcVDpkydevIe9l425L3qH+1dMtt+ol+2TWzFppmQwcUM3HAak0PMpD+HJDNJdMARtYfNylJWsRv89FevyUW6nAyPqJ+Yk/4JUX98F1s+KrmrArjnQAUkfCNzRhkLX33pSlxFUBIFUH60DzIl1+uDsOymCov22hNVWOSjvqoTlIIl/JVqem9w== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98face08-f269-438a-e95a-08d7d62c8ede X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:16.3141 (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: eT0dG2VgO0kqVvrWsd962Ro2Q/uv2294PB9ZTQESTHZRP0WzcKSGG2Ms13svaZ39Bm/PAUYbeE2Ct4tdlUK3RQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller In a next commit, we would like to mark wfx_skb_dtor as static and stop to declare it in data_tx.h. Relocate wfx_skb_dtor() prior its callers to avoid compile error. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 72 ++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 17209f645e4b..ec95518c9167 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -503,6 +503,43 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, ieee80211_tx_status_irqsafe(wdev->hw, skb); } +static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) +{ + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + struct ieee80211_sta *sta; + struct wfx_sta_priv *sta_priv; + int tid = ieee80211_get_tid(hdr); + + 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]--; + if (!sta_priv->buffered[tid]) + ieee80211_sta_set_buffered(sta, tid, false); + spin_unlock_bh(&sta_priv->lock); + } + rcu_read_unlock(); +} + +void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) +{ + struct hif_msg *hif = (struct hif_msg *)skb->data; + struct hif_req_tx *req = (struct hif_req_tx *)hif->body; + struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); + unsigned int offset = sizeof(struct hif_req_tx) + + sizeof(struct hif_msg) + + req->data_flags.fc_offset; + + WARN_ON(!wvif); + skb_pull(skb, offset); + wfx_notify_buffered_tx(wvif, skb); + wfx_tx_policy_put(wvif, req->tx_flags.retry_policy_index); + ieee80211_tx_status_irqsafe(wdev->hw, skb); +} + void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) { int i; @@ -589,39 +626,4 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) wfx_skb_dtor(wvif->wdev, skb); } -static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) -{ - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; - struct ieee80211_sta *sta; - struct wfx_sta_priv *sta_priv; - int tid = ieee80211_get_tid(hdr); - 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]--; - if (!sta_priv->buffered[tid]) - ieee80211_sta_set_buffered(sta, tid, false); - spin_unlock_bh(&sta_priv->lock); - } - rcu_read_unlock(); -} - -void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) -{ - struct hif_msg *hif = (struct hif_msg *)skb->data; - struct hif_req_tx *req = (struct hif_req_tx *)hif->body; - struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - unsigned int offset = sizeof(struct hif_req_tx) + - sizeof(struct hif_msg) + - req->data_flags.fc_offset; - - WARN_ON(!wvif); - skb_pull(skb, offset); - wfx_notify_buffered_tx(wvif, skb); - wfx_tx_policy_put(wvif, req->tx_flags.retry_policy_index); - ieee80211_tx_status_irqsafe(wdev->hw, skb); -} From patchwork Wed Apr 1 11:04:01 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: 1265134 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=QeQL0PRe; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjzz5rjJz9sR4 for ; Wed, 1 Apr 2020 22:06:07 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732603AbgDALFy (ORCPT ); Wed, 1 Apr 2020 07:05:54 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732335AbgDALF0 (ORCPT ); Wed, 1 Apr 2020 07:05:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cYwJuLeIjzyHei4R6hp8da/xyM4Px2sCIpjCHvIfxa8DyrvIwHFoV1eWvc8LWR+MdhnxEJ5M9T8IWBvnjLFmgmWnP1Ze4mn3tB98mPAHw6c6DZEa7lxnPkGtVaMr2GuvX8+uJU7GCxhoQziagm+sZju1TAUbfFqqkhJSC80KAMEnjNEuZg1FoHQ1LdaZenEa2GTnX7bxMvEvYGg9iK/4lMS4cVGU2fMBl6QPe1KfMfOd/+MC47oIEoB118iuH+7YuHCTETnqKiY5SDyUjQ13+q38cHEK1p8h/RP2vouCDZ9tD86MOjcKeRt0TUrb1IHSD2qNgndO6lNRBWzyXS54Mg== 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=IH8W3kGmmtO9DfMHjIyd12rVVibWNotPl7qw2RYprBc=; b=hMV1pl9pYRbdja1pVRfoVn9rEeP+8Sls+ankDCl53cmwAraXCThNpVOb41CGt3gMIhrtQu7i2mHjcVhvh5tjt0v4wQS0UxcMdJ2Ywt8L6jRSwVLwZGAw/oGG1TMYdpMVPK5eq5JldGaUZItD0TPnbRSba3VH5cGp2MbSKDcXO/cJOZJjCJ5RW3Ml7dPPAAxWk1vBgsaT6BDaZatRnnsBkfrAzHoFfsxAW4GTU7fhiSJaD+zjDkpxFg6uFs4psWwge0LX71MzqFgdPDkwiI9wysB+K6qSbLjdbaxE/UrN15XwYaOAX8ASZW99H6fXrgy2R+i6SrUpQG+WunvwQANqAQ== 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=IH8W3kGmmtO9DfMHjIyd12rVVibWNotPl7qw2RYprBc=; b=QeQL0PReTdid74e7ikpvvft+CbU6a4YJoTPS7iBvN1KcY2C5WTUPCKBeUYCvJQY+r+yZ24wOKxlh/DYnju/9okvnJbqIV1RWlbUiD5IRXLlR9ur38EzhSSBSJvG7JYbVyvmQrLleRmpjgeGnBf0qCPSVFCVmPRGGsgD+xkC0Z/I= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:18 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:18 +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 28/32] staging: wfx: repair wfx_flush() Date: Wed, 1 Apr 2020 13:04:01 +0200 Message-Id: <20200401110405.80282-29-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:16 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 99bc3cde-139a-4d46-96c5-08d7d62c9011 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(30864003)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /fepGjL8ioX+pJ3isCWbu1pQm5Qex5fi+clOppf8Lnya+ufxBCQhvD3+Tz7KAMpsrvasScQAH+FSfcj6aSDxsOG8aC2XW+NrvrM2U6Mc+MXbH4eDetwAcCjv3TH2yQDnCTYXT8EePaF50ZIGJGksU6dwhr7nJs4QUfRgrK4WhPiVVZuGY3vDk/oXOgWrIDRkejlvb5M1iw2q6T8lAU6VuVaf+okxI03uNFad8QSCUBHHKpefQn2v2gRDNNZ6Cvh4AeLyLqO3kIruOrO5XP0trtixesNUdgl24U0Fin3zfmdFdaUs03B64QzRBbwITUJIN1vTCK7Nquc+pldv3fnnXz06Dr0mpzjclOWQApkNRna/PEbAQANh5x7w12yD6E/jPd9X1Aki73+LhLGpIetAza2ssjw2f69txUDF4GLhDNDGGfnOMVlDt3Bi9fFCzp8R X-MS-Exchange-AntiSpam-MessageData: lsRitfDkjNZ/rO2AZkNBOoWxnWRr2t/XbdAY7cOOEc8s4uzBDUvOAbFOXtheEYxA30EtNnoFBa2q8QoozDoRM6+bNNGAWCSNVerwekrb9nt89/mDCNTa/E4DhkMLndgQ9wqt+5W5OotxYxf6mGZ1Nar62H3l4IHRqFzgDne33DQwlZXxoPUBsYQtLX4e18xRbmEUNdFLMZRtCzUCnvkGUg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99bc3cde-139a-4d46-96c5-08d7d62c9011 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:18.4408 (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: i1x5HgyHfXP9JbuwYOJQedORVRtgEnpSSrWaF41bVfrdtvPx5wUKTGJPsQLd+SggkCA4sG55me4nzl+C69IEBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Until now, wfx_flush() flushed queue for while device instead of only the queue of the intended vif. It sometime failed with a timeout, but this error was not reported. Moreover, if the device was frozen, wfx_flush didn't do anything and it results a potential warning (and maybe a resource leak) when the frozen device was unregistered. We can also notice that wfx_tx_queues_wait_empty_vif() did only exist to work around the broken feature of wfx_flush(). This patch repair wfx_flush() and therefore drop wfx_tx_queues_wait_empty_vif(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 34 ++++++- drivers/staging/wfx/data_tx.h | 3 +- drivers/staging/wfx/main.c | 1 - drivers/staging/wfx/queue.c | 163 ++++++++++++++++------------------ drivers/staging/wfx/queue.h | 10 ++- drivers/staging/wfx/sta.c | 36 +------- drivers/staging/wfx/sta.h | 2 - 7 files changed, 120 insertions(+), 129 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index ec95518c9167..1d9a8089f3d3 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -524,7 +524,7 @@ static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) rcu_read_unlock(); } -void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) +static void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) { struct hif_msg *hif = (struct hif_msg *)skb->data; struct hif_req_tx *req = (struct hif_req_tx *)hif->body; @@ -626,4 +626,36 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) wfx_skb_dtor(wvif->wdev, skb); } +void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + u32 queues, bool drop) +{ + struct wfx_dev *wdev = hw->priv; + struct sk_buff_head dropped; + struct wfx_queue *queue; + struct sk_buff *skb; + int vif_id = -1; + int i; + + if (vif) + vif_id = ((struct wfx_vif *)vif->drv_priv)->id; + skb_queue_head_init(&dropped); + for (i = 0; i < IEEE80211_NUM_ACS; i++) { + if (!(BIT(i) & queues)) + continue; + queue = &wdev->tx_queue[i]; + if (drop) + wfx_tx_queue_drop(wdev, queue, vif_id, &dropped); + if (wdev->chip_frozen) + continue; + if (wait_event_timeout(wdev->tx_dequeue, + wfx_tx_queue_empty(wdev, queue, vif_id), + msecs_to_jiffies(1000)) <= 0) + dev_warn(wdev->dev, "frames queued while flushing tx queues?"); + } + wfx_tx_flush(wdev); + if (wdev->chip_frozen) + wfx_pending_drop(wdev, &dropped); + while ((skb = skb_dequeue(&dropped)) != NULL) + wfx_skb_dtor(wdev, skb); +} diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index 03fe3e319ba1..7f201f626410 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -44,7 +44,8 @@ void wfx_tx_policy_upload_work(struct work_struct *work); void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb); void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg); -void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb); +void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + u32 queues, bool drop); static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb) { diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 5e1a7a932b53..738016d45d63 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -267,7 +267,6 @@ static void wfx_free_common(void *data) mutex_destroy(&wdev->rx_stats_lock); mutex_destroy(&wdev->conf_mutex); - wfx_tx_queues_deinit(wdev); ieee80211_free_hw(wdev->hw); } diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index a1a2f7756a27..d4302a30dc41 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -62,92 +62,79 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev) wfx_tx_flush(wdev); } -/* If successful, LOCKS the TX queue! */ -void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif) -{ - int i; - bool done; - struct wfx_queue *queue; - struct sk_buff *item; - struct wfx_dev *wdev = wvif->wdev; - struct hif_msg *hif; - - if (wvif->wdev->chip_frozen) { - wfx_tx_lock_flush(wdev); - wfx_tx_queues_clear(wdev); - return; - } - - do { - done = true; - wfx_tx_lock_flush(wdev); - for (i = 0; i < IEEE80211_NUM_ACS && done; ++i) { - queue = &wdev->tx_queue[i]; - spin_lock_bh(&queue->normal.lock); - skb_queue_walk(&queue->normal, item) { - hif = (struct hif_msg *)item->data; - if (hif->interface == wvif->id) - done = false; - } - spin_unlock_bh(&queue->normal.lock); - spin_lock_bh(&queue->cab.lock); - skb_queue_walk(&queue->cab, item) { - hif = (struct hif_msg *)item->data; - if (hif->interface == wvif->id) - done = false; - } - spin_unlock_bh(&queue->cab.lock); - } - if (!done) { - wfx_tx_unlock(wdev); - msleep(20); - } - } while (!done); -} - -static void wfx_tx_queue_clear(struct wfx_dev *wdev, struct wfx_queue *queue, - struct sk_buff_head *gc_list) -{ - struct sk_buff *item; - - while ((item = skb_dequeue(&queue->normal)) != NULL) - skb_queue_head(gc_list, item); - while ((item = skb_dequeue(&queue->cab)) != NULL) - skb_queue_head(gc_list, item); -} - -void wfx_tx_queues_clear(struct wfx_dev *wdev) -{ - int i; - struct sk_buff *item; - struct sk_buff_head gc_list; - - skb_queue_head_init(&gc_list); - for (i = 0; i < IEEE80211_NUM_ACS; ++i) - wfx_tx_queue_clear(wdev, &wdev->tx_queue[i], &gc_list); - wake_up(&wdev->tx_dequeue); - while ((item = skb_dequeue(&gc_list)) != NULL) - wfx_skb_dtor(wdev, item); -} - void wfx_tx_queues_init(struct wfx_dev *wdev) { int i; - memset(wdev->tx_queue, 0, sizeof(wdev->tx_queue)); skb_queue_head_init(&wdev->tx_pending); init_waitqueue_head(&wdev->tx_dequeue); - for (i = 0; i < IEEE80211_NUM_ACS; ++i) { skb_queue_head_init(&wdev->tx_queue[i].normal); skb_queue_head_init(&wdev->tx_queue[i].cab); } } -void wfx_tx_queues_deinit(struct wfx_dev *wdev) +void wfx_tx_queues_check_empty(struct wfx_dev *wdev) { - WARN_ON(!skb_queue_empty(&wdev->tx_pending)); - wfx_tx_queues_clear(wdev); + int i; + + WARN_ON(!skb_queue_empty_lockless(&wdev->tx_pending)); + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + WARN_ON(atomic_read(&wdev->tx_queue[i].pending_frames)); + WARN_ON(!skb_queue_empty_lockless(&wdev->tx_queue[i].normal)); + WARN_ON(!skb_queue_empty_lockless(&wdev->tx_queue[i].cab)); + } +} + +static bool __wfx_tx_queue_empty(struct wfx_dev *wdev, + struct sk_buff_head *skb_queue, int vif_id) +{ + struct hif_msg *hif_msg; + struct sk_buff *skb; + + spin_lock_bh(&skb_queue->lock); + skb_queue_walk(skb_queue, skb) { + hif_msg = (struct hif_msg *)skb->data; + if (vif_id < 0 || hif_msg->interface == vif_id) { + spin_unlock_bh(&skb_queue->lock); + return false; + } + } + spin_unlock_bh(&skb_queue->lock); + return true; +} + +bool wfx_tx_queue_empty(struct wfx_dev *wdev, + struct wfx_queue *queue, int vif_id) +{ + return __wfx_tx_queue_empty(wdev, &queue->normal, vif_id) && + __wfx_tx_queue_empty(wdev, &queue->cab, vif_id); +} + +static void __wfx_tx_queue_drop(struct wfx_dev *wdev, + struct sk_buff_head *skb_queue, int vif_id, + struct sk_buff_head *dropped) +{ + struct sk_buff *skb, *tmp; + struct hif_msg *hif_msg; + + spin_lock_bh(&skb_queue->lock); + skb_queue_walk_safe(skb_queue, skb, tmp) { + hif_msg = (struct hif_msg *)skb->data; + if (vif_id < 0 || hif_msg->interface == vif_id) { + __skb_unlink(skb, skb_queue); + skb_queue_head(dropped, skb); + } + } + spin_unlock_bh(&skb_queue->lock); +} + +void wfx_tx_queue_drop(struct wfx_dev *wdev, struct wfx_queue *queue, + int vif_id, struct sk_buff_head *dropped) +{ + __wfx_tx_queue_drop(wdev, &queue->cab, vif_id, dropped); + __wfx_tx_queue_drop(wdev, &queue->normal, vif_id, dropped); + wake_up(&wdev->tx_dequeue); } void wfx_tx_queues_put(struct wfx_dev *wdev, struct sk_buff *skb) @@ -174,6 +161,22 @@ int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb) return 0; } +void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped) +{ + struct wfx_queue *queue; + struct sk_buff *skb; + + WARN(!wdev->chip_frozen, "%s should only be used to recover a frozen device", + __func__); + while ((skb = skb_dequeue(&wdev->tx_pending)) != NULL) { + queue = &wdev->tx_queue[skb_get_queue_mapping(skb)]; + WARN_ON(skb_get_queue_mapping(skb) > 3); + WARN_ON(!atomic_read(&queue->pending_frames)); + atomic_dec(&queue->pending_frames); + skb_queue_head(dropped, skb); + } +} + struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id) { struct wfx_queue *queue; @@ -249,17 +252,6 @@ bool wfx_tx_queues_has_cab(struct wfx_vif *wvif) return false; } -bool wfx_tx_queues_empty(struct wfx_dev *wdev) -{ - int i; - - for (i = 0; i < IEEE80211_NUM_ACS; i++) - if (!skb_queue_empty_lockless(&wdev->tx_queue[i].normal) || - !skb_queue_empty_lockless(&wdev->tx_queue[i].cab)) - return false; - return true; -} - static bool wfx_handle_tx_data(struct wfx_dev *wdev, struct sk_buff *skb) { struct hif_req_tx *req = wfx_skb_txreq(skb); @@ -364,8 +356,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) if (!skb) return NULL; skb_queue_tail(&wdev->tx_pending, skb); - if (wfx_tx_queues_empty(wdev)) - wake_up(&wdev->tx_dequeue); + wake_up(&wdev->tx_dequeue); // FIXME: is it useful? if (wfx_handle_tx_data(wdev, skb)) continue; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 9bc1a5200e64..ab45e32cbfbc 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -31,16 +31,18 @@ void wfx_tx_flush(struct wfx_dev *wdev); void wfx_tx_lock_flush(struct wfx_dev *wdev); void wfx_tx_queues_init(struct wfx_dev *wdev); -void wfx_tx_queues_deinit(struct wfx_dev *wdev); -void wfx_tx_queues_clear(struct wfx_dev *wdev); -bool wfx_tx_queues_empty(struct wfx_dev *wdev); +void wfx_tx_queues_check_empty(struct wfx_dev *wdev); bool wfx_tx_queues_has_cab(struct wfx_vif *wvif); -void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); void wfx_tx_queues_put(struct wfx_dev *wdev, struct sk_buff *skb); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); +bool wfx_tx_queue_empty(struct wfx_dev *wdev, struct wfx_queue *queue, + int vif_id); +void wfx_tx_queue_drop(struct wfx_dev *wdev, struct wfx_queue *queue, + int vif_id, struct sk_buff_head *dropped); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); +void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped); int wfx_pending_requeue(struct wfx_dev *wdev, struct sk_buff *skb); unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 340e09bb639d..b1ee02d2f515 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -318,29 +318,6 @@ int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value) return 0; } -static int __wfx_flush(struct wfx_dev *wdev, bool drop) -{ - for (;;) { - if (drop) - wfx_tx_queues_clear(wdev); - if (wait_event_timeout(wdev->tx_dequeue, - wfx_tx_queues_empty(wdev), - 2 * HZ) <= 0) - return -ETIMEDOUT; - wfx_tx_flush(wdev); - if (wfx_tx_queues_empty(wdev)) - return 0; - dev_warn(wdev->dev, "frames queued while flushing tx queues"); - } -} - -void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - u32 queues, bool drop) -{ - // FIXME: only flush requested vif and queues - __wfx_flush(hw->priv, drop); -} - /* WSM callbacks */ static void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi) @@ -843,10 +820,8 @@ static int wfx_update_tim(struct wfx_vif *wvif) skb = ieee80211_beacon_get_tim(wvif->wdev->hw, wvif->vif, &tim_offset, &tim_length); - if (!skb) { - __wfx_flush(wvif->wdev, true); + if (!skb) return -ENOENT; - } tim_ptr = skb->data + tim_offset; if (tim_offset && tim_length >= 6) { @@ -1062,8 +1037,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, } wvif->state = WFX_STATE_PASSIVE; - wfx_tx_queues_wait_empty_vif(wvif); - wfx_tx_unlock(wdev); /* FIXME: In add to reset MAC address, try to reset interface */ hif_set_macaddr(wvif, NULL); @@ -1097,10 +1070,5 @@ void wfx_stop(struct ieee80211_hw *hw) { struct wfx_dev *wdev = hw->priv; - wfx_tx_lock_flush(wdev); - mutex_lock(&wdev->conf_mutex); - wfx_tx_queues_clear(wdev); - mutex_unlock(&wdev->conf_mutex); - wfx_tx_unlock(wdev); - WARN(atomic_read(&wdev->tx_lock), "tx_lock is locked"); + wfx_tx_queues_check_empty(wdev); } diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index cf99a8a74a81..a0c5153e5272 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -54,8 +54,6 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags, int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif); void wfx_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif); -void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - u32 queues, bool drop); int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params); void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, From patchwork Wed Apr 1 11:04: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: 1265133 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=E8Cwhicr; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjzg1Bqkz9sTD for ; Wed, 1 Apr 2020 22:05:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732538AbgDALFa (ORCPT ); Wed, 1 Apr 2020 07:05:30 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732519AbgDALF1 (ORCPT ); Wed, 1 Apr 2020 07:05:27 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=njgc14w20R23fOHzYTwh+B4IAXHL+55iZjwWl2UVXDn9WBy4DeeJuPc/XgpgFlGR3TVAFj7UAgp065Ehi13uVDg8rMTTCtdeLB/jnbwWqvttdbngAd4c5csxDLjZKCnbsMULhau2sisObrRGjrIsEA6HrX/rb8EpfhQnr97NkZu84HzXUCGj6QY6Cyjrv4/73ZHgV59OwscTI/KbVtP5s2aRiYwsoJ2g+l411TbArM8B1iLlWI0xK7xUV8HezQ4CFzQV/78zSi2tbE+Prt9cL/ZXVYLG7eCfX342+DBmuAo2txArJXfbVmHaMeeeuzGmoKCUIrPKsbU2J+XDWzNFmg== 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=SuiUnwuz2aP9VbUPhDjydwCeV6LGGUmPjVg+SxwDwqM=; b=TcDAVO22xxraX8gCSfM7eR7jkpUoczSgT/zGQVO6YlrOqaHQDQmInGFlkfzKDbCOY35pSdR/4GAIBKi0qoVYh4hVcBZiuyUD3pGB/bEtJig+2JOqn6OrecJtQizRO3J6ypjYQQPpfLe9Ex8oY8ZDf0wE30/9IUUBvF3S6VPeqwAmgh3TN+XPQZmidxql4hNBhSdlynDWsBZIL4eGEkDsiM2LwIIUluACun185e7aZg8IHxkcXciDIALP+jWTdZmqEPsgXim5xrE6zIIXXegJjAT4mDwAn3X9NuV7FFVWg36HfcYoBZ7Vo5ucb/dHDV33IQ9hxgEV4P46UbQkKx3QuQ== 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=SuiUnwuz2aP9VbUPhDjydwCeV6LGGUmPjVg+SxwDwqM=; b=E8Cwhicr/aMSW8+4VwRHNGMS7z+ik1TfhrW/sbbQ9rTd0AsanUXTUPH/aZzHEjV/VRhtgdd4xr5pROGf6A+z8wdfrtJTdeopAzt/MLXqSkDHB1pBqJQoEvxuSHbJ/m8gUdmXxD47JHSp1tto4lt9QUu5VA39vRcijbDWKIrIuKc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:20 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:20 +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 29/32] staging: wfx: wfx_flush() did not ensure that frames are processed Date: Wed, 1 Apr 2020 13:04:02 +0200 Message-Id: <20200401110405.80282-30-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:18 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7f4ee1ce-1dfd-40a6-a054-08d7d62c9172 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i+Os8x3p0D1MvFCMESx8f4w6kLzWbdtAjT6VVxbGaaDQ1vodwTkiR7MEcHz/Ti7/Kkl2nVo8PLjC8xZ6bJeranXVDeSKBUul8d2WDpUspYPot+LiCqGMK0glB5AM6auId2naRomev9lMQE5JExQMg/eHR2TCLFtQG/ywfNw0qjEIm4JzaPdW2YhwuaXatct+dzJyue7ZPHDLv40Wt4xh+sekwXhtgKNJLv29ypwN1ToXalv2ivnChsDbvn6dp/79gvFknX6BPTC2YdtCz7WUv97YnWwX9Q1ukOWwwIst4TlvE8ZQTTw0m5juHIchMVq0ZP9tLj5Pm+Y7m8OCSzE+U6kP5mu31vZ8K/jX0hcZ1Zh69pwvLiaCQ3jbouQlSz1Dq/O25mGNCP65/JW046/SSmVlscAxcYwKSpETAYo+zGnWVKxtzAR9S/jy7H4R0ZZF X-MS-Exchange-AntiSpam-MessageData: aWtP+UqJQoh8tA75uY4sUoPsKh47mYY1EXs15EH14+JTMco6X/Zet7049HIwkWArgQe3wXXw+7fwb8CiuxHpqs52KE6q3aIXZEbiKRpom5IRivT6UZSfgFDptPA4YiF+22EgHwgsCkZpAAJVszhE1zlcoS0EtZwcuJTpPbjstggdcqsX8tfVggtYwfE9N9V32ePpUg6tk/oel5p9hXdR3g== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f4ee1ce-1dfd-40a6-a054-08d7d62c9172 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:20.7655 (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: /OdnmbXSGghxACJ+Vegvd7zkSu7HRuBg5Lh6PmufhWdvbXMTlmNeB2Xkxv1IMwEn55zSUM1xTl9QmjAbhgpI8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller wfx_flush() exited once all frames are retrieved from the device. However, it did not ensure they were processed by driver before to return. Therefore, some frame may be processed after the interface has disappear. Change the place we signal that the queue is empty to fix that. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/bh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index 9fcab00a3733..ba7fa0a7cd9a 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -108,8 +108,6 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) release_count = 1; WARN(wdev->hif.tx_buffers_used < release_count, "corrupted buffer counter"); wdev->hif.tx_buffers_used -= release_count; - if (!wdev->hif.tx_buffers_used) - wake_up(&wdev->hif.tx_buffers_empty); } _trace_hif_recv(hif, wdev->hif.tx_buffers_used); @@ -123,6 +121,8 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) skb_put(skb, hif->len); // wfx_handle_rx takes care on SKB livetime wfx_handle_rx(wdev, skb); + if (!wdev->hif.tx_buffers_used) + wake_up(&wdev->hif.tx_buffers_empty); return piggyback; From patchwork Wed Apr 1 11:04:03 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: 1265130 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=m7Irli7C; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjzJ2QGHz9sSb for ; Wed, 1 Apr 2020 22:05:32 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732553AbgDALFb (ORCPT ); Wed, 1 Apr 2020 07:05:31 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732441AbgDALFa (ORCPT ); Wed, 1 Apr 2020 07:05:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LD9YXgC8s5iH17VD0Q+uPsF+Za1tE0ewPMu3aL2PLMfc78Y3IDZdh2QBzIM0fEXRpupbKRyOsSdCBLeUM7VFVIVNBrydg8OSJeBiD3CWPQHryQSLmyP1TQPz2zjR8SRMTXuQJmQH2hrBSxtIB1Zffn9z5uAX0cnpMO/bqx16FqWTs5Hxq6zVn+qHrHG19DahzMPvLGTeXHtp1ShTlucIDiCBSI6kej+MOAthWovsUHTkUZES2c29JkMJkv3dYHohtpYjEdIZ1vs9LC4MIWs5OwHQOUdY7jSi6a0BDRX/iEeCCR3L5RnqMaXQHQ1Njf89R6/ospMk6gMROO1KDfp9/Q== 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=Q4Swx1XSBETPQKAOKPk7/O84WzGRDzaHNgSGjmQRB2Y=; b=h8k/we5CAX42VywcNT5NdlKOEYBtD2sbgB0nmz9Qv2RjktXcZXLCsNdiUKDYGK2goU09Uuw3oyHlG5rcd3o6/AyFDnCBX/c3p8LG+CyQ5/x6gCISd66Ed1ceHrXRVpYh/BRvH673u9lgthtOzwb/AX2dpSgYUKZs7UhwNkZba05JzWIVAboJ6TSivIw2jt7/ngTCKWoX2vddZBp2DQIrkT1tklsiIom4SuusIo13Rb/toFODgevMmSyKGbhQYD4ouTuZi2VqeSv1WqcLDjXg3rrSDWv60wPtHqc4lQ8SBh+JJPtWLlS0bX4kj2sIR4tN3PlfeAcDoOwvrZuOQMs+vg== 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=Q4Swx1XSBETPQKAOKPk7/O84WzGRDzaHNgSGjmQRB2Y=; b=m7Irli7CkR97oNAQZh/DZ3oXmLqZii4X+YdCbDhp4SQHQ/usbkzhf7UebtNwtzVuwlk/7Vklcen4wj2KcPOH6yHaOuZQipd64agKNnaVJQoCI42F/EpQAc6XhG97meWut/rlJslFK94+TxyR0UBzShLXtlm//KqW8HHLWS5Gfzg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:23 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:23 +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 30/32] staging: wfx: fix potential deadlock in wfx_tx_flush() Date: Wed, 1 Apr 2020 13:04:03 +0200 Message-Id: <20200401110405.80282-31-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:21 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 21259e16-d60b-421d-f41f-08d7d62c92cc X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SrvUj0WhhGGbgWj9L+qOC0YI/4aZA5jS73cqPAIapUJBANq4XMKIPuZbPqs3hytE374kesWvY2VcFwAZF3RpM58T6C3fqy0Uo8kIBuoSygBT068F+DONbiFWUZX0I65LtNxqtJePwhv6n2pC+Vet9LfPKozh2ZzZNAsnWmkq0kGrqBfknWQs82jFQ+U9veyroOe/zdA+ywPWNQaZlyaF6bwUZfWoQ7BwWeh/glKnaCgn2p9zESUKMUZwQHivvTNeVp4PYdL2T0/bZyw7l4RVeYIByFZfzZO7TiLbTcTaMKJU3vk6FfvmHZjLYr9e6LEQn3kNglKmLXpC4T2TH8lLKvrPp32tqhhVND2KGwriz3uqKvO2wFV75qxBXkjzGgyDuKt8SvzCicGsobg2TvAuyKLMfl1H6hu4+7O2Sp5BDWYxTqZS+yqmyzQnqFDu0rhF X-MS-Exchange-AntiSpam-MessageData: JPfaJduqfOThZ8IKitOMLEuh6VmypmkJmJpdygtTfx4UfJxE8LeGraXmHMjiMCr9jJQURpwjt61g5ymqEppuZb3JfULkgJq2/borOT/gKvDkFWbQiT3jTTw/C43am2cfP5LFC1+Jkbg07XSdJGF+aT5KIchUEBr/LYNQ6Eok7MuzNZ8SRcFOWpMlCLQ85n1m04hS5wSudfrUAkO9RNeQ2g== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 21259e16-d60b-421d-f41f-08d7d62c92cc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:22.9343 (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: AqlkUbdxfXe6RJNbl44aSHkI77Jx4oghD83D8tJzUFxzIrhccYJI+ySsZTMMVO/E81Ugf/n2vRyfwM3w+FIKig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller wfx_tx_flush() wait there are no more frame in device buffer. However, this event may never happens since wfx_tx_flush() don't forbid to enqueue new frames. Note that wfx_tx_flush() should only ensure that all frames currently in hardware queues are sent. So the current code is more restrictive that it should. Note that wfx_tx_flush() release the lock before to return while wfx_tx_lock_flush() keep the lock. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index d4302a30dc41..e6d7d0e45156 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -36,6 +36,7 @@ void wfx_tx_flush(struct wfx_dev *wdev) if (wdev->chip_frozen) return; + wfx_tx_lock(wdev); mutex_lock(&wdev->hif_cmd.lock); ret = wait_event_timeout(wdev->hif.tx_buffers_empty, !wdev->hif.tx_buffers_used, @@ -54,6 +55,7 @@ void wfx_tx_flush(struct wfx_dev *wdev) wdev->chip_frozen = 1; } mutex_unlock(&wdev->hif_cmd.lock); + wfx_tx_unlock(wdev); } void wfx_tx_lock_flush(struct wfx_dev *wdev) From patchwork Wed Apr 1 11:04:04 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: 1265132 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=U6GpXhF9; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjzX1dYfz9sSb for ; Wed, 1 Apr 2020 22:05:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732575AbgDALFf (ORCPT ); Wed, 1 Apr 2020 07:05:35 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732539AbgDALFc (ORCPT ); Wed, 1 Apr 2020 07:05:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c+3iJzJaMuf6XoOiJqOndz+RMf0461SDJA9Qi81LMPmqtehqoE1uFDSGMYBZ3LDLzp5R040woI2PIAFttj+93IzTFt5UlsaGcyKqtnGS56CFnmA0ZkDb+/6B1RvA4ALOqwVkpQ0rFn+4Ime+3WKLNeV1FVJvV5/jet+PifRDIBW1Ba9LK4WUOJ0JUcxGI6hu9I7JWhmYgkkUZLILyOqR6PQG7SlqzdxucAgPfa5P3TZ/jjpMAqecr/mNmVW/VvtkQlUkpZI/m/xM46IICBTQx4b8xbOXFA03PaUhR3RiYKY2FYNIWPpg/WGlU5NUjOIigudcuIw99Mp3//9ertNvsA== 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=X1jqhwnOCvIDXeCRXQIhQJr9ISs6aDNmUCuvc/MDHFs=; b=drXvrgkHHQ7i4mp8ujsBA3Xm0ydDwVZslkj66oU2k1iyhjSChdwXBQ+wYO/9g3UsOfxTgrGft6zqpjx/X9iEV/8PVUVCepQH6pwTW/aDsO9oVWkQ2iv/BK0X4USCSfIqO5WfToEWd16JPadZMdwM8pUhreuHU6FhQ3rIualYk83qum0rX08n36ZTqijvv5Z5KpVeTSGLvUmV0iu3Ydb9qLm43wnsLeNHevgcstsccEExRvPYoWMvWU6BDQJd6zXxOeNRNfTuRmIfnYtvBwYNgUbiOhU4vDFOWOWhm8PakvWeFWvMbqeYof7aDKKV633SfThlVW6CMQ8mpjPZyTXBHQ== 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=X1jqhwnOCvIDXeCRXQIhQJr9ISs6aDNmUCuvc/MDHFs=; b=U6GpXhF9WwAny3tBT8oH011KVBtUwsieLIQb5lLY4TboY+YHrWFdIITb6tQCVzOtzzod2UNnGGHfbzNikQvQ5w9Gh+PY8pfcRXue+LCiIx70/7WvTGvjB3r2JZRmKLw848duTe8t/6yrMpWBsH3DHF7XUScE15xr9bFCk6g4RJ4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:25 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:25 +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 31/32] staging: wfx: fix case where AP stop with CAB traffic pending Date: Wed, 1 Apr 2020 13:04:04 +0200 Message-Id: <20200401110405.80282-32-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:23 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f642917a-be3c-4d38-ff9c-08d7d62c9412 X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(66574012)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sANo9FWGYNxA1kQVyxYhKx0Ov885UhR3vPmFNEGlOy9V2x7yp9BPp7up2/XLhNYHhHH41wW8S/SCsDuvxcMfDvdRL9zR0G+KxEo0eowNPHFMBTa7CIfRgzCiZDDlcqTcvbeq5pSiZskbglRDbQjlFCKzkSx3LMELuZ2URsioss0CUSWl9aNAa3LuTKspUJe2K48bjapO7m5GMoYc9xZ1P+nwLvoerLmSYZGmMq2u9q61rmyny0f3GI0MOlN+KqT211CECBl4RNZWYXkXsAAr1OvSQIspqASwE5YSjtsjvdVPOOlgB7ehjLGxYT1GgAbUHiGfnMWnVI0TobnPApdHYvkR5SIiMKzI+FFjWPYOCbhKyOgeHTK3FtNPN2SmRWlImnUlpKrm8zeEiwEyePXoKmT8YbPCWJ8zA88C/g2Io9OF8pi9DkWEeElkXJHUy5hQ X-MS-Exchange-AntiSpam-MessageData: KB9ORJdqZFv4GLWzlwNPLxG4nb6ZH03Esv99EeEOH5/MawncESlH390QTP0tb8LWIV3GyeNZhkw3R6D7iy+qxnxM4ofuM+BpMV3kV21XeVqInmVBKERor9rmIaf+u/j92CNFdMNbwZipwDmKrumYb+t5xjmg1XWniTmDowk8psDMog+yVC3k+/oCSMCtGFixSyM9NSJvTBsaUrN85ONirQ== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f642917a-be3c-4d38-ff9c-08d7d62c9412 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:24.9411 (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: jMhziX8BpOw0/fXVzQLxZ1jHOGmEmlJ7H8ydEdWrLFOzHptIWuOlqTIXNkDp8RrczvpednKHaLP6gHmdCkJ3rw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller When driver has Content After DTIM Beacon (CAB) in queue, it wait for an indication from the firmware. However, when we stop to send beacons, this indication may never happen. Solve this issue by simply simulate this indication. Firmware will send data that probably nobody will heard. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index b1ee02d2f515..2e8d3f571c3e 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -686,6 +686,19 @@ static void wfx_join_finalize(struct wfx_vif *wvif, } } +void wfx_enable_beacon(struct wfx_vif *wvif, bool enable) +{ + // Driver has Content After DTIM Beacon in queue. Driver is waiting for + // a signal from the firmware. Since we are going to stop to send + // beacons, this signal will never happens. See also + // wfx_suspend_resume_mc() + if (!enable && wfx_tx_queues_has_cab(wvif)) { + wvif->after_dtim_tx_allowed = true; + wfx_bh_request_tx(wvif->wdev); + } + hif_beacon_transmit(wvif, enable); +} + void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, @@ -724,7 +737,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_BEACON_ENABLED && wvif->state != WFX_STATE_IBSS) - hif_beacon_transmit(wvif, info->enable_beacon); + wfx_enable_beacon(wvif, info->enable_beacon); if (changed & BSS_CHANGED_BEACON_INFO) hif_set_beacon_wakeup_period(wvif, info->dtim_period, From patchwork Wed Apr 1 11:04:05 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: 1265131 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=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; 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=Y5QjFHLS; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48sjzP2Ny9z9sSb for ; Wed, 1 Apr 2020 22:05:37 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732589AbgDALFf (ORCPT ); Wed, 1 Apr 2020 07:05:35 -0400 Received: from mail-bn7nam10on2084.outbound.protection.outlook.com ([40.107.92.84]:6083 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732561AbgDALFe (ORCPT ); Wed, 1 Apr 2020 07:05:34 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CgZX1sVmmmsImtvIFJXGN68MmR6nkJUBC9vAOQj5pK0Tky998kAZXmmp5NlGf+mqmj2oUmAnnCiDgqLikEn5FqC5v1WfOnu6Z/Xid2U5AJaR7TZY7pTigbNDZBx3zem6M83OfnA+0G/YfMk8IqLdAQPK5LPiSOMIdWmvXo5iSzBt3lDLFS9p+6Fk+NACoG+LMO6br5pUzDivPO5nkxjLweEAfCTxEzf9jqG0fjU0nijiuAHNzo5i+k8VfXL2JcJEzX3y7KC+XtIY67ynJOAYiMK1lBP4d+tkFaWSy5h9WR4wgUXLfGZhvkC/qGc0exWU7WV7YdqW9hdnUrlbYP4Ybg== 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=RPrxWdWGNJvYjUT2owohbDyOyC0Vbtfc7ra7B4ROlWQ=; b=BR5+gGsllV6XE30EYTOXrpuesGKnj3fu7Si7rTskYWmLcpuA0CLmdxStu7Z3fKO0Y3xMhQ+VFBr/Qf48fSsnMxPI+1+yQeEdm3o1m1sYYwuJrHuE0cRjkZs1aHIMX4LT7GCAYT7JJ3fzxUUn1G+AF8qsDmVz8LeAPkwn8TK8mj2o89wUSbbktwBBIkqk4CB97vn7PbpZvuWkKk+DnJqdunRJYSEzuNiALb0HiRzsmI+Xv0ddhJ2pDJ/BpGT+GQoRnSYPl+lRfnsLfiCvNVfOIIkN6l+7P6eEjbOqlUOb/RrsC5NV8AECcHVQ9C3+4JPELQs4XvqaKppDbRlATN7gWw== 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=RPrxWdWGNJvYjUT2owohbDyOyC0Vbtfc7ra7B4ROlWQ=; b=Y5QjFHLSt+COTKOYugvB7uaQi6yDAfdAuLXrVGaKOYzSlFK4c5+aibM8+qvWUziGzLwJNOXlErbBHcTEupDyd5QIpj24OxqYA0Mu6XffXKlQ/EoNt8i9dnlX2nGEfYDelOyRGJ/Yq7u3O9aVRKAovM61b+WstvtNdSt1US1gJCY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; Received: from MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) by MN2PR11MB4285.namprd11.prod.outlook.com (2603:10b6:208:191::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.20; Wed, 1 Apr 2020 11:05:27 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::ade4:5702:1c8b:a2b3%7]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 11:05:27 +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 32/32] staging: wfx: remove hack about tx_rate policies Date: Wed, 1 Apr 2020 13:04:05 +0200 Message-Id: <20200401110405.80282-33-Jerome.Pouiller@silabs.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> References: <20200401110405.80282-1-Jerome.Pouiller@silabs.com> X-ClientProxiedBy: SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pc-42.silabs.com (2a01:e35:2435:66a0:1265:30ff:fefd:6e7f) by SN4PR0501CA0156.namprd05.prod.outlook.com (2603:10b6:803:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Wed, 1 Apr 2020 11:05:25 +0000 X-Mailer: git-send-email 2.25.1 X-Originating-IP: [2a01:e35:2435:66a0:1265:30ff:fefd:6e7f] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 32e0810a-ea3f-483a-d92f-08d7d62c953a X-MS-TrafficTypeDiagnostic: MN2PR11MB4285: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB4063.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(136003)(366004)(346002)(376002)(39850400004)(396003)(7696005)(8676002)(1076003)(16526019)(186003)(6666004)(5660300002)(86362001)(4326008)(52116002)(478600001)(66946007)(66476007)(54906003)(36756003)(8936002)(316002)(81156014)(6486002)(2906002)(66556008)(107886003)(81166006)(2616005); DIR:OUT; SFP:1101; Received-SPF: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h1qeSPoIe//HHNak+pSUaABbmyQA0ggmemurZGzVSDHV+lsH1cpN8OAf/8aU4nhNl0W+3S0iqUzRf+2AGzPtIB8LzaAGwbi0U2IROY0z/HutS5cP1QrwhV6Bzwf2Jbgq84UJdSMBZDM/HPHK+CN2EeGiFv4X5gEndVIxxSoQPgs3zMPVtj0VtBKC+NifTRRZnUL78bUn/8KakfJc6CMldLkJ75r4hH0FV2OwO3MZ1FJw6xTCHlcAtvdgkmP3ui9VUleakgYwEaihpYz4eTr0tZOqcASrNdWYjnMImVuDpFldletzn8xt6aITj9NDg2w76doZWWs24uN0DM6NR35H/vRyNYHu+3j+zioeNVv90im0AtQu9NbXvMauWve8Il+2uogWtkVzMrnuC9W0cdl1wLy7pxk9BLl0dhYhokril2d2xDh8WaQ5c0PiS9/Vqy3T X-MS-Exchange-AntiSpam-MessageData: cvMgiYPn/2TlNtXfy5qZ+kggf3E9UStRlG5XJFEfPDo+64PfnBui3mS9D/ojNBsxW0L3Txg98ge5VDT8P2bdIlWbtcKymJBAyM+BBJAPG4a11S5Th6RcKlpyE4s4aYfU3cBveRbDKrKev87Fze31x51r4jwqVyqCIgCjvT1IC9CpytbrtIbDQ14EEIEkhUw/Tttaho/x7jogPwVT9usICg== X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32e0810a-ea3f-483a-d92f-08d7d62c953a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2020 11:05:26.9909 (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: hauASE1EqdAfBmoLfcj8lpqkFGCLqgziLNRUVpvY5P57dY0ZtCHj09C+/vr5CUxg++HO6VtWmxvzV914g8KgQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4285 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jérôme Pouiller Current code contains a weird hack to avoid switch from 54Mbps CTS to 1Mbps. However, we have not been able to reproduce the problem and hardware team don't know any defect of this kind. So, it seems this hack is no more necessary. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 53 ----------------------------------- 1 file changed, 53 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 1d9a8089f3d3..93ed0ed63bb2 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -51,59 +51,6 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy, if (rates[i].idx < 0) break; count = i; - - /* HACK!!! Device has problems (at least) switching from - * 54Mbps CTS to 1Mbps. This switch takes enormous amount - * of time (100-200 ms), leading to valuable throughput drop. - * As a workaround, additional g-rates are injected to the - * policy. - */ - if (count == 2 && !(rates[0].flags & IEEE80211_TX_RC_MCS) && - rates[0].idx > 4 && rates[0].count > 2 && - rates[1].idx < 2) { - int mid_rate = (rates[0].idx + 4) >> 1; - - /* Decrease number of retries for the initial rate */ - rates[0].count -= 2; - - if (mid_rate != 4) { - /* Keep fallback rate at 1Mbps. */ - rates[3] = rates[1]; - - /* Inject 1 transmission on lowest g-rate */ - rates[2].idx = 4; - rates[2].count = 1; - rates[2].flags = rates[1].flags; - - /* Inject 1 transmission on mid-rate */ - rates[1].idx = mid_rate; - rates[1].count = 1; - - /* Fallback to 1 Mbps is a really bad thing, - * so let's try to increase probability of - * successful transmission on the lowest g rate - * even more - */ - if (rates[0].count >= 3) { - --rates[0].count; - ++rates[2].count; - } - - /* Adjust amount of rates defined */ - count += 2; - } else { - /* Keep fallback rate at 1Mbps. */ - rates[2] = rates[1]; - - /* Inject 2 transmissions on lowest g-rate */ - rates[1].idx = 4; - rates[1].count = 2; - - /* Adjust amount of rates defined */ - count += 1; - } - } - for (i = 0; i < IEEE80211_TX_MAX_RATES; ++i) { int rateid; u8 count;