From patchwork Mon Oct 29 10:27:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 10659061 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 534DB14DE for ; Mon, 29 Oct 2018 10:27:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 414AE29565 for ; Mon, 29 Oct 2018 10:27:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 357C9296B6; Mon, 29 Oct 2018 10:27:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA41629565 for ; Mon, 29 Oct 2018 10:27:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729746AbeJ2TPV (ORCPT ); Mon, 29 Oct 2018 15:15:21 -0400 Received: from mail-cys01nam02on0099.outbound.protection.outlook.com ([104.47.37.99]:12800 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729343AbeJ2TPU (ORCPT ); Mon, 29 Oct 2018 15:15:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8MIw5v4RwwWBVyczMTCb0mEDlc3uPnCC2Wvd0eLrsNU=; b=CCYd2o8uTBqX5DbgoMUKB36/NikSHTMh/EL5xDxKkxGirnKluIDrA3MP+OiNBI57dLj4xhkQ9q9DQiLZFLZtaaiCorJk/BQc/ZnIHO+FZ/Q16ScA7Iz9F2AzoydsWe0tHXHK+qlKEwNosopQ3Z6wAido4mCZ1W62qWpDbKzcz0c= Received: from BYAPR06MB3992.namprd06.prod.outlook.com (52.135.200.22) by BYAPR06MB5303.namprd06.prod.outlook.com (20.178.50.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.24; Mon, 29 Oct 2018 10:27:15 +0000 Received: from BYAPR06MB3992.namprd06.prod.outlook.com ([fe80::e059:d46e:4de6:4bae]) by BYAPR06MB3992.namprd06.prod.outlook.com ([fe80::e059:d46e:4de6:4bae%2]) with mapi id 15.20.1273.027; Mon, 29 Oct 2018 10:27:15 +0000 From: Wright Feng To: "linux-wireless@vger.kernel.org" CC: Wright Feng , "arend.vanspriel@broadcom.com" , "franky.lin@broadcom.com" , "hante.meuleman@broadcom.com" , "kvalo@codeaurora.org" , Chi-Hsien Lin , "brcm80211-dev-list.pdl@broadcom.com" Subject: [PATCH 1/3] brcmfmac: calling skb_orphan before sending skb to SDIO bus Thread-Topic: [PATCH 1/3] brcmfmac: calling skb_orphan before sending skb to SDIO bus Thread-Index: AQHUb3H2+mORDXs3gE6Xp6/NyHTPOA== Date: Mon, 29 Oct 2018 10:27:15 +0000 Message-ID: <1540808552-28738-2-git-send-email-wright.feng@cypress.com> References: <1540808552-28738-1-git-send-email-wright.feng@cypress.com> In-Reply-To: <1540808552-28738-1-git-send-email-wright.feng@cypress.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: OSAPR01CA0097.jpnprd01.prod.outlook.com (2603:1096:604:e::13) To BYAPR06MB3992.namprd06.prod.outlook.com (2603:10b6:a02:90::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wright.Feng@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [61.222.14.99] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR06MB5303;6:FyjRf/VJEcDUpPYniaHWs63lJDL3gHlWHFl6cvf4/6o7Wwi9aEvVwCtSiZoIVWaPHJHk1hgnWCm/g+Tym1rI8D1/uW05+af63BIzGMJjGs5eIDFfHsiwDHbYesejLinsptkvO4rZDuoup+Cto/R3erIH9YROASxgjseyDZ+EwAoVPh+65VGwV4Dbnq+oYzzbu0p/a6m+qYqhhni6gLV1kumg9SbTYqZ5l/NHE+rWN1ZjL0l/Yrhc8wPQpDrqG13+wAlrLWKYu6J7ZE6RU48d9d5c7+JIwukc3FHilVRc1Bc1RkTjMM6zOWwhr1rwy/78OvQWqp9KGzIL0sLSsV7+5TTV4yRKTE8wJrPRLhRui8yKNC3Tsk3cHnnDiiJhtMj4P9sN8hs3ryi/Ux7y66EQez6lifwFDCbHE4qJhpBE+6S+vcPN5Y67eI99lJCbBzHOrVuSJG6rFI+NnmXV5tFGGg==;5:P+pJpeKez8PLC7p9bzv+MQAdq5qz8XeKh4nq0+wvyff1N/YGrxrL3PqcAUCBYEzemnveOCbY/nhCCluezyCAO0wvjvi7BjXpfFfp+35ytLPzdNtKhOdlSaAEFwWm5Ge+UKDyYqYpJYa9iUIUQragDUJFB4ayUm7WKelF1KflR/c=;7:klefBSkux3x2/aIav12qpyHjpySX3n6wGrIPUgOt6PzyWtjYz3V2nJxBWiHRSzaikrABxpaml6l3rATXxwKOuL9/a6/5obKYKM89ATSc0TLMmuC9rG3PoQEvOYwQ54sSLVA7fFP2SgGzRbelp0H0Lg== x-ms-office365-filtering-correlation-id: e58610a2-14eb-47fc-4cfa-08d63d891887 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BYAPR06MB5303; x-ms-traffictypediagnostic: BYAPR06MB5303: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(60795455431006)(258095267146985); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:BYAPR06MB5303;BCL:0;PCL:0;RULEID:;SRVR:BYAPR06MB5303; x-forefront-prvs: 084080FC15 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(396003)(346002)(39860400002)(366004)(376002)(199004)(189003)(305945005)(71200400001)(26005)(71190400001)(2900100001)(2501003)(72206003)(6916009)(105586002)(5250100002)(7736002)(5660300001)(86362001)(2351001)(68736007)(106356001)(476003)(2616005)(11346002)(486006)(6436002)(8936002)(99286004)(36756003)(2906002)(256004)(81166006)(81156014)(8676002)(316002)(14444005)(5640700003)(6486002)(54906003)(4326008)(6506007)(76176011)(44832011)(25786009)(386003)(478600001)(102836004)(446003)(14454004)(53936002)(186003)(6512007)(97736004)(3846002)(66066001)(52116002)(6116002);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR06MB5303;H:BYAPR06MB3992.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: QOHY/kQCedhNg3mIb/5sqSpnw5hAio0r78cmiDRE9QC4DUuvo6/aFlUMbOkchJF51txpKp5qgsJss6QJWEUDaGKb2jNJ0QAokGDeFjLzI5dd8ckmCrThaCtY4M8b/jrMJDk/K9+dOYETsrhrGe7SLyC1fCYSqJ3KC+uO/owD1PXI6k0yeJCuEr4D1wHvozRoNx5e0rognFqVwjGCarBbrxGgM0ABr/8KZ56qLVKnc/a39hCyHJ2aY9+HSDlOq97vCJJkUnl3hLQrOwBniu+gLhkC4+JbhUmhM1NMbs0CM4fYrGWEbktpAqxQ3M0VnD2mQaB0zPzuPUvxGurr5lTQKttsIA+QT3ZcaMstrbLD8QM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: e58610a2-14eb-47fc-4cfa-08d63d891887 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2018 10:27:15.2869 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5303 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Linux 3.6 introduces TSQ which has a per socket threshold for TCP Tx packets to reduce latency. In fcmode 1 and fcmode 2, host driver enqueues skb in hanger and TCP doesn't push new skb until host frees the skb when receiving fwstatus event. So using skb_orphan before sending skb to bus will make the skb removing the ownership of socket. With this patch, we are able to get better throughput in fcmode 1 and fcmode 2. Tested 43455 TCP throughput in 20 MHz bandwidth with / without this patch. fcmode 0: 59.5 / 59.6 (mbps) fcmode 1: 59.3 / 23.4 (mbps) fcmode 2: 59.6 / 21.5 (mbps) Signed-off-by: Wright Feng --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index b2e1ab5..519b25d 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -2298,6 +2298,7 @@ static uint brcmf_sdio_sendfromq(struct brcmf_sdio *bus, uint maxframes) &prec_out); if (pkt == NULL) break; + skb_orphan(pkt); __skb_queue_tail(&pktq, pkt); } spin_unlock_bh(&bus->txq_lock); From patchwork Mon Oct 29 10:27:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 10659063 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C2D5714DE for ; Mon, 29 Oct 2018 10:27:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B084929565 for ; Mon, 29 Oct 2018 10:27:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5267296B6; Mon, 29 Oct 2018 10:27:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3067229565 for ; Mon, 29 Oct 2018 10:27:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729755AbeJ2TP2 (ORCPT ); Mon, 29 Oct 2018 15:15:28 -0400 Received: from mail-cys01nam02on0105.outbound.protection.outlook.com ([104.47.37.105]:34496 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729602AbeJ2TP2 (ORCPT ); Mon, 29 Oct 2018 15:15:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pxtaMbL0MmM02vbaZiD1cBAcAtxCsGMO3pG1bWFq7zo=; b=N6+tG9iLLCqh1idwKON8xXlBbycS4yr6TQZ6Vt3lsdH1cYw7n6UZ00O5cKNq7kIekmMuTfddeMvWVEp+PVr1c8hXbtR+13LYWc8hyDU1zz+SMpNwyFrAPnz9Dfh4+YSzaxW7TZo5q4nZ7a/Bz8aiJ1oyNm53GCZddoz3G8O01lA= Received: from BYAPR06MB3992.namprd06.prod.outlook.com (52.135.200.22) by BYAPR06MB5303.namprd06.prod.outlook.com (20.178.50.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.24; Mon, 29 Oct 2018 10:27:21 +0000 Received: from BYAPR06MB3992.namprd06.prod.outlook.com ([fe80::e059:d46e:4de6:4bae]) by BYAPR06MB3992.namprd06.prod.outlook.com ([fe80::e059:d46e:4de6:4bae%2]) with mapi id 15.20.1273.027; Mon, 29 Oct 2018 10:27:21 +0000 From: Wright Feng To: "linux-wireless@vger.kernel.org" CC: Wright Feng , "arend.vanspriel@broadcom.com" , "franky.lin@broadcom.com" , "hante.meuleman@broadcom.com" , "kvalo@codeaurora.org" , Chi-Hsien Lin , "brcm80211-dev-list.pdl@broadcom.com" Subject: [PATCH 2/3] brcmfmac: add credit numbers updating support Thread-Topic: [PATCH 2/3] brcmfmac: add credit numbers updating support Thread-Index: AQHUb3H6UjCqWYxoE0WZE4qJFjplhg== Date: Mon, 29 Oct 2018 10:27:21 +0000 Message-ID: <1540808552-28738-3-git-send-email-wright.feng@cypress.com> References: <1540808552-28738-1-git-send-email-wright.feng@cypress.com> In-Reply-To: <1540808552-28738-1-git-send-email-wright.feng@cypress.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TYAPR01CA0025.jpnprd01.prod.outlook.com (2603:1096:404:28::13) To BYAPR06MB3992.namprd06.prod.outlook.com (2603:10b6:a02:90::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wright.Feng@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [61.222.14.99] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR06MB5303;6:jZ3pA9pMhKwtJp8bfn/XlXP7WAksODduY01l1+vmkFoM0xgML+W/h2Bhjw7xcdkCXkxup/aWBNEl9HDsVWaRKnIFu8gttLz2nPbzxp7KBa+eSfF0jLFWXkDDk199VIPcpXuKyzYN4Zs8Osme4WXDO8oupoleILx7o4v9rnm/rL1n+VoXWLhT6odSu/M18GgA/W2XHrAl3geco05cLtYB4LV+HwcqT4FufLSN8j/x5ysYLBg74LIAdTPmVZ0nJ08Fh5FxSOKtQZJrVXUTPGVKqlXb6Zapp3ViH8YmhyK/NMxhQnhnFJIF82LYJlgFXFBCY3OcSjNWFm3wMQ9FsGy2jvMLTsCId/f7VtQbzTTFufAFuG95oqev+3DKrWZEO6PP/QeNsg/UevVJHEtMUrZqZ24mfGXLa8SsojEYKz6Gy6BxBAtV1qFtr2+bFGyDJOI5qFts/15xpn4M7IGFzW2oqQ==;5:7cOxdQ+5GvhTd7CotcNRHggXtmUgjIIe89JkgwGXWxguq93fN+Q9Ld/XLP6Dd3XjP6+w0nXrenkNcLM/X1lgk1USX/hppgjglhBX4wk57pGx1Slef7/L6ROtSruqDON09TVby9NpfzFOKRALj8mNBeZ46nfWsuAw4BleqWepk30=;7:SBXdEw1As+mpUc2cQpBMu2D16LBsRjqyGHi6NWcmb52OqlFEK8SPUscEIJu2l5C+w+ht/WEjm9hsRamvXWcCEjR0xV4C+n7TI6EhXtZ1gKbVjQTGpfPRHuS08bTWmwaK/r+czJwUz7FQ5u5/Y6YluA== x-ms-office365-filtering-correlation-id: 56d493e2-c05e-4763-99bd-08d63d891c5d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:BYAPR06MB5303; x-ms-traffictypediagnostic: BYAPR06MB5303: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(258095267146985); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:BYAPR06MB5303;BCL:0;PCL:0;RULEID:;SRVR:BYAPR06MB5303; x-forefront-prvs: 084080FC15 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(396003)(346002)(39860400002)(366004)(376002)(199004)(189003)(305945005)(71200400001)(26005)(71190400001)(2900100001)(2501003)(72206003)(6916009)(105586002)(5250100002)(7736002)(5660300001)(86362001)(2351001)(68736007)(106356001)(476003)(2616005)(11346002)(486006)(6436002)(8936002)(99286004)(36756003)(2906002)(256004)(81166006)(81156014)(8676002)(316002)(14444005)(5640700003)(6486002)(54906003)(4326008)(6506007)(76176011)(44832011)(25786009)(386003)(478600001)(102836004)(446003)(14454004)(53936002)(186003)(6512007)(97736004)(3846002)(66066001)(52116002)(6116002);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR06MB5303;H:BYAPR06MB3992.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: l2qI3fnM27j8vqBS6Z4YTP0/+WgC9UIN8UzUWWVu8FcolAUFhAAdFa1GGGYGMK2KAW3NNB1BvSuhYRgwbZxJkhAtKLqI5H7bc8NAlfHl6516fmdTqrUXJrJc0r3609VwhbaBZ1Xo5qw8KCsagP41muFPJdjyyu20Z6ZCJCsV+In6NcDEacLhPDl7mvbTtNYkh/bNv4ZMx6xS77u0+6iZjYe061MTC4DkEuFi+napzCVw+EKtPVejJrxGCQhmfWQSa0zHijjCdgZE0uDFeVw17Ycj33E5nix8UI0+Y3IgQ537yMZ9xluFOhxBNWelyZFtPjqD8804+L+2jzQtg0XxFosLodIULiuL0hzOqx5pDgc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56d493e2-c05e-4763-99bd-08d63d891c5d X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2018 10:27:21.8026 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB5303 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The credit numbers are static and tunable per chip in firmware side. However the credit number may be changed that is based on packet pool length and will send BRCMF_E_FIFO_CREDIT_MAP event to notify host driver updates the credit numbers during interface up. The purpose of this patch is making host driver has ability of updating the credit numbers when receiving the BRCMF_E_FIFO_CREDIT_MAP event. Signed-off-by: Wright Feng Reviewed-by: Arend van Spriel --- .../broadcom/brcm80211/brcmfmac/fwsignal.c | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c index f3cbf78..e0910c5 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c @@ -511,6 +511,7 @@ struct brcmf_fws_info { struct work_struct fws_dequeue_work; u32 fifo_enqpkt[BRCMF_FWS_FIFO_COUNT]; int fifo_credit[BRCMF_FWS_FIFO_COUNT]; + int init_fifo_credit[BRCMF_FWS_FIFO_COUNT]; int credits_borrowed[BRCMF_FWS_FIFO_AC_VO + 1]; int deq_node_pos[BRCMF_FWS_FIFO_COUNT]; u32 fifo_credit_map; @@ -1237,6 +1238,9 @@ static void brcmf_fws_return_credits(struct brcmf_fws_info *fws, } fws->fifo_credit[fifo] += credits; + if (fws->fifo_credit[fifo] > fws->init_fifo_credit[fifo]) + fws->fifo_credit[fifo] = fws->init_fifo_credit[fifo]; + } static void brcmf_fws_schedule_deq(struct brcmf_fws_info *fws) @@ -1595,19 +1599,21 @@ static int brcmf_fws_notify_credit_map(struct brcmf_if *ifp, brcmf_err("event payload too small (%d)\n", e->datalen); return -EINVAL; } - if (fws->creditmap_received) - return 0; fws->creditmap_received = true; brcmf_dbg(TRACE, "enter: credits %pM\n", credits); brcmf_fws_lock(fws); for (i = 0; i < ARRAY_SIZE(fws->fifo_credit); i++) { - if (*credits) + fws->fifo_credit[i] += credits[i] - fws->init_fifo_credit[i]; + fws->init_fifo_credit[i] = credits[i]; + if (fws->fifo_credit[i] > 0) fws->fifo_credit_map |= 1 << i; else fws->fifo_credit_map &= ~(1 << i); - fws->fifo_credit[i] = *credits++; + if (fws->fifo_credit[i] < 0) + brcmf_err("fifo_credit[%d] value is negative(%d)\n", + i, fws->fifo_credit[i]); } brcmf_fws_schedule_deq(fws); brcmf_fws_unlock(fws); @@ -2013,7 +2019,7 @@ static int brcmf_fws_borrow_credit(struct brcmf_fws_info *fws) } for (lender_ac = 0; lender_ac <= BRCMF_FWS_FIFO_AC_VO; lender_ac++) { - if (fws->fifo_credit[lender_ac]) { + if (fws->fifo_credit[lender_ac] > 0) { fws->credits_borrowed[lender_ac]++; fws->fifo_credit[lender_ac]--; if (fws->fifo_credit[lender_ac] == 0) @@ -2210,8 +2216,9 @@ static void brcmf_fws_dequeue_worker(struct work_struct *worker) } continue; } - while ((fws->fifo_credit[fifo]) || ((!fws->bcmc_credit_check) && - (fifo == BRCMF_FWS_FIFO_BCMC))) { + while ((fws->fifo_credit[fifo] > 0) || + ((!fws->bcmc_credit_check) && + (fifo == BRCMF_FWS_FIFO_BCMC))) { skb = brcmf_fws_deq(fws, fifo); if (!skb) break; @@ -2222,7 +2229,7 @@ static void brcmf_fws_dequeue_worker(struct work_struct *worker) break; } if ((fifo == BRCMF_FWS_FIFO_AC_BE) && - (fws->fifo_credit[fifo] == 0) && + (fws->fifo_credit[fifo] <= 0) && (!fws->bus_flow_blocked)) { while (brcmf_fws_borrow_credit(fws) == 0) { skb = brcmf_fws_deq(fws, fifo); From patchwork Mon Oct 29 10:27:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 10659065 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6F9614E2 for ; Mon, 29 Oct 2018 10:27:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C449929565 for ; Mon, 29 Oct 2018 10:27:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B873A296B6; Mon, 29 Oct 2018 10:27:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DB1B29565 for ; Mon, 29 Oct 2018 10:27:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729762AbeJ2TPg (ORCPT ); Mon, 29 Oct 2018 15:15:36 -0400 Received: from mail-bn3nam01on0121.outbound.protection.outlook.com ([104.47.33.121]:15424 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729602AbeJ2TPg (ORCPT ); Mon, 29 Oct 2018 15:15:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0aVUu4aYhp4PpaLN/HmUyNAP9gkS7Wzn0G+3+ZktQtY=; b=mqExlnUmuDqoxSrvcvhE/NL0dsQgd9oimLA9p3JhzCJE1Jld4/gsHdA/1cCIjyiJIRHKdwq79dwofU8wcchz7z/J6rXO25Wc0u0YwtPXQSTLcbTHZhKYWUkFo7TlxMrIEShT0l8t1qPRKOkrUrVSlQh5LBa4Y6l4NVcbviAxMX8= Received: from BYAPR06MB3992.namprd06.prod.outlook.com (52.135.200.22) by BYAPR06MB4518.namprd06.prod.outlook.com (52.135.233.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Mon, 29 Oct 2018 10:27:28 +0000 Received: from BYAPR06MB3992.namprd06.prod.outlook.com ([fe80::e059:d46e:4de6:4bae]) by BYAPR06MB3992.namprd06.prod.outlook.com ([fe80::e059:d46e:4de6:4bae%2]) with mapi id 15.20.1273.027; Mon, 29 Oct 2018 10:27:28 +0000 From: Wright Feng To: "linux-wireless@vger.kernel.org" CC: Wright Feng , "arend.vanspriel@broadcom.com" , "franky.lin@broadcom.com" , "hante.meuleman@broadcom.com" , "kvalo@codeaurora.org" , Chi-Hsien Lin , "brcm80211-dev-list.pdl@broadcom.com" Subject: [PATCH 3/3] brcmfmac: make firmware frameburst mode a module parameter Thread-Topic: [PATCH 3/3] brcmfmac: make firmware frameburst mode a module parameter Thread-Index: AQHUb3H+Fs3IQIbeVESAT2P4l9cing== Date: Mon, 29 Oct 2018 10:27:28 +0000 Message-ID: <1540808552-28738-4-git-send-email-wright.feng@cypress.com> References: <1540808552-28738-1-git-send-email-wright.feng@cypress.com> In-Reply-To: <1540808552-28738-1-git-send-email-wright.feng@cypress.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: TYAPR01CA0116.jpnprd01.prod.outlook.com (2603:1096:404:2a::32) To BYAPR06MB3992.namprd06.prod.outlook.com (2603:10b6:a02:90::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Wright.Feng@cypress.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [61.222.14.99] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BYAPR06MB4518;6:w3wuN3lkgFHe/uA9X0jCa6eZQH0Cg7K8ML3B7J6QmTLJthLsO74KyI+iaQgZdKPlziT+qn53mJofixeBTqZK/ZZlz4JkZZFO8wWF7HsfrdGSKp/ac2ZqEE0O+3oB43Ptau58Z8CX22Idu/UYwtdZfbmGQSxTvPh49A3PWv4CFx/HnT+HwyeiP1RpGa6DnjOb4+K2BrqYp4wWSUUhhPZItMU9PlNyGRYwMxZb4CRpib+YmSy/EqTD7cyjwac9yl08nK80dse54AB0tdzXK1CioQbgNjBptbPXb0/BWu3KLxglYSKLw4Z+qTp8MyISJGMPhKl0+DPBtaR8qgG/sPj4T7es4lTFs75xbyWDBuvgOlMECoNIbrjyTJCb2tatZoS1dcY3KNOcwBbRSym6HpzSL2XP5QUq8fiazo5GaIHeP9FHM7kjzMy7nfhdFZT1lY/ftR1DzKJY+r5jRaMkfo7YLQ==;5:WZk7L2LZ3hyFBmFvc+JaPLr1SXaqCLghDBzY1VNp6HxoRW66Ofjep0afownGb5onQ9IVLuy5Yez5fjxY3uPXUbauXXQmYeWgYU5sxUKX5fSLFLiZsaWf6h7wTk6AdnqDWynLnt616MpQ2oJkFjFxJ0MMGaWeAS9xyc+lwhKwSRk=;7:F8DCHZsI5jLG82eHoApNgDacdqWm5z5ccaKmhmwmU+wTCWSDo/UeA9RgozgtytdRH58abpVcXr0TYMBggNuOCfcJxkJOM/n+INKZj2zJV3LDzupObLJD85PywQuOTdN0M0gwBNLuynSjP+yahbb2JA== x-ms-office365-filtering-correlation-id: af094f70-ff2a-4421-0afd-08d63d892079 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:BYAPR06MB4518; x-ms-traffictypediagnostic: BYAPR06MB4518: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(258095267146985); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:BYAPR06MB4518;BCL:0;PCL:0;RULEID:;SRVR:BYAPR06MB4518; x-forefront-prvs: 084080FC15 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39860400002)(376002)(346002)(136003)(366004)(199004)(189003)(478600001)(4326008)(86362001)(305945005)(52116002)(6916009)(71190400001)(6116002)(71200400001)(105586002)(72206003)(3846002)(14454004)(54906003)(102836004)(6506007)(386003)(106356001)(25786009)(7736002)(5660300001)(26005)(36756003)(2351001)(76176011)(476003)(53936002)(2906002)(316002)(11346002)(486006)(2616005)(2501003)(5250100002)(186003)(5640700003)(6436002)(99286004)(8676002)(66066001)(97736004)(81156014)(446003)(68736007)(81166006)(14444005)(8936002)(6486002)(256004)(2900100001)(6512007)(44832011)(309714004);DIR:OUT;SFP:1102;SCL:1;SRVR:BYAPR06MB4518;H:BYAPR06MB3992.namprd06.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: cypress.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 9na9xIi/GMnABaEtb0hueSajwIS/Xrpo7CXevhgiymFeaxzlLOIhDOtVHEsa4VhPdGv0qXMpsRlugUxXa9MhePhEsaLAVtMLEDlPugEAQtHkU8S48wVl+CU5QjPAHQfMkK539SmoR0/vL4jNsy2dSg/2zymmZN3ay6R9rYlQjnruYHV4tWGzlpFi58A2EuCDJ1e4sSAh2n/2EBJ6Jkm3VuRm3IoDWJLuV4vvlmXroalj40E8QY8KD0X2GCWcENrcOm5lXIkj05sNTDLxt6xzADjB6WhWgkcYnQFLslJk3d+MvfSH2dwdHVgJne4wnaZFHKMLiWrCaAJEnDoFCISWryHNeu61SRhlKUbilu6Ff4E= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: af094f70-ff2a-4421-0afd-08d63d892079 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2018 10:27:28.6933 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR06MB4518 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch is for adding a new module parameter "frameburst". With setting "frameburst=1" in module parameters, firmware frameburst mode will be enabled. The feature can enable per-packet framebursting in firmware side and get higher TX throughput in High Throughput(HT) mode. Signed-off-by: Wright Feng --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 +++++++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 5 +++++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h | 2 ++ drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h | 1 + 4 files changed, 15 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 230a378..4a05d3f 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -6638,6 +6638,13 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) brcmf_configure_arp_nd_offload(ifp, true); + if (ifp->drvr->settings->frameburst) { + err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_FAKEFRAG, 1); + if (err) + brcmf_info("setting frameburst mode failed\n"); + brcmf_dbg(INFO, "frameburst mode enabled\n"); + } + cfg->dongle_up = true; default_conf_out: diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c index 94044a7..0ad4c31 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c @@ -78,6 +78,10 @@ module_param_named(iapp, brcmf_iapp_enable, int, 0); MODULE_PARM_DESC(iapp, "Enable partial support for the obsoleted Inter-Access Point Protocol"); +static int brcmf_frameburst; +module_param_named(frameburst, brcmf_frameburst, int, 0); +MODULE_PARM_DESC(frameburst, "Enable firmware frameburst feature"); + #ifdef DEBUG /* always succeed brcmf_bus_started() */ static int brcmf_ignore_probe_fail; @@ -419,6 +423,7 @@ struct brcmf_mp_device *brcmf_get_module_param(struct device *dev, settings->fcmode = brcmf_fcmode; settings->roamoff = !!brcmf_roamoff; settings->iapp = !!brcmf_iapp_enable; + settings->frameburst = !!brcmf_frameburst; #ifdef DEBUG settings->ignore_probe_fail = !!brcmf_ignore_probe_fail; #endif diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h index a34642c..b919752 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h @@ -47,6 +47,7 @@ struct brcmf_mp_global_t { * @feature_disable: Feature_disable bitmask. * @fcmode: FWS flow control. * @roamoff: Firmware roaming off? + * @frameburst: Firmware frame burst mode. * @ignore_probe_fail: Ignore probe failure. * @country_codes: If available, pointer to struct for translating country codes * @bus: Bus specific platform data. Only SDIO at the mmoment. @@ -57,6 +58,7 @@ struct brcmf_mp_device { int fcmode; bool roamoff; bool iapp; + bool frameburst; bool ignore_probe_fail; struct brcmfmac_pd_cc *country_codes; union { diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h index 63b1287..b6b183b 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil.h @@ -80,6 +80,7 @@ #define BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON 201 #define BRCMF_C_SET_ASSOC_PREFER 205 #define BRCMF_C_GET_VALID_CHANNELS 217 +#define BRCMF_C_SET_FAKEFRAG 219 #define BRCMF_C_GET_KEY_PRIMARY 235 #define BRCMF_C_SET_KEY_PRIMARY 236 #define BRCMF_C_SET_SCAN_PASSIVE_TIME 258