From patchwork Wed Jul 20 06:05:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Spintzyk?= X-Patchwork-Id: 592096 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3FB9C43334 for ; Wed, 20 Jul 2022 06:06:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238900AbiGTGG2 (ORCPT ); Wed, 20 Jul 2022 02:06:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbiGTGG2 (ORCPT ); Wed, 20 Jul 2022 02:06:28 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2045.outbound.protection.outlook.com [40.107.96.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CB7367CB9; Tue, 19 Jul 2022 23:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e8eOemyxXAlcTXGv8Undy/jkTqwwMor3W+P6kLqjlTbiWY8qmprdlLS6ND96AnODL7Y+uxVsXO1C1SPZm4axaG5fOAA51IOChwUnE8wvJKgwwKAFB2wXsSbM/eeo8tjy2QZtxY3rRNHd/b1OCAKdVz8p3iQZ+Tpm9o5ouXz2C4+T9MrhanM1eEfxwir0f00wFt+4/qPljvfnob3N2loebdyaRWEd0dcX2USDNXq8MmnqqeriE8d2YuIlIJO8EAm7dBOcfbiHtYQiwoJejXpd89cWc2sKlW5gfoCgAi4niCES6h3p9tDT4o5l619osEAGtm70259hHN/NoqwgtoBhmA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=w4vnW+5mJiQYQyp+6YA7OE0Yp8BZa5Anbx9H5BioudI=; b=Vi0hPgI3eb1k26WoYvIJ2NbbcV+TADWt3F0Xa4CsVH2HR7B5alxn8L7MkER+oiyOjb2/J0E+f1gcKp4c2iCxXaui0jSTnsjVlUOsdWcx/RuCjEM88jws2iUPYMt0K+fgXjObzDqwMwi66PWr0zsvW2nZab0SNDCSn+yNK0kd7WRLIpUZOS6G5f2zut5n1laxreDvRF1ZyXUZoO2HszS/sr14AlAJ66jIIDU7V8jw8KDEsd5pihvru1fxDWF6ETUU7X81rRm2XdmR+qVABsrKh7FmycJcC0mqEOTicEArwbLy+4GfNCmmf4La+9zNtUMrCXbJ9NzVCpkQVhGFDv1fIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w4vnW+5mJiQYQyp+6YA7OE0Yp8BZa5Anbx9H5BioudI=; b=hligcmSIdfKNxp9rPkWLq0FDZhfV8y31ix9wWDvXFG72lJMEhooWmLN+/ol+QK2oFxV4VAXeewWvfCXGPdmSAAJlJxyarFijx6aFWagfULhoMxKRtoBLSC2YQcZIIghd60FjD/RtN0TPDvT260VcM4ravjyM/InAqbuYLhcKwYo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=synaptics.com; Received: from SJ0PR03MB6533.namprd03.prod.outlook.com (2603:10b6:a03:386::12) by BN9PR03MB6025.namprd03.prod.outlook.com (2603:10b6:408:136::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17; Wed, 20 Jul 2022 06:06:25 +0000 Received: from SJ0PR03MB6533.namprd03.prod.outlook.com ([fe80::d52:5cb7:8c3b:f666]) by SJ0PR03MB6533.namprd03.prod.outlook.com ([fe80::d52:5cb7:8c3b:f666%7]) with mapi id 15.20.5438.023; Wed, 20 Jul 2022 06:06:25 +0000 From: =?utf-8?q?=C5=81ukasz_Spintzyk?= To: netdev@vger.kernel.org Cc: linux-usb@vger.kernel.org, oliver@neukum.org, kuba@kernel.org, ppd-posix@synaptics.com, Bernice.Chen@synaptics.com Subject: [PATCH v5 1/2] net/cdc_ncm: Enable ZLP for DisplayLink ethernet devices Date: Wed, 20 Jul 2022 08:05:17 +0200 Message-Id: <20220720060518.541-1-lukasz.spintzyk@synaptics.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <4e061614-851e-0dd4-59b2-7110b1a4c339@suse.com> References: <4e061614-851e-0dd4-59b2-7110b1a4c339@suse.com> X-ClientProxiedBy: BE1P281CA0027.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:15::18) To SJ0PR03MB6533.namprd03.prod.outlook.com (2603:10b6:a03:386::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e19eac5c-ef63-47e8-f83e-08da6a15f9fe X-MS-TrafficTypeDiagnostic: BN9PR03MB6025:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KPIj5Web+U+3u/fvl0xwz8icKcmMqnwCESgSoFr98x+1QTmQZgvTSWIUuGFWrE/U1jmU4qQgNOkutuknDIpEjQJxuVrqfNdTE2X8uLT+0YyS7MIZ2pTAi7aNEdekbfjkz+A5kgUCzARohoV9lq1cz2GBK7YpGjDV7woxNaEAy+uLdL/auxc77//bCosYZkCtkoAU2BMAijBn6pusIwwb8m1tujp5iD8eRRtnqIgNm5Z8ysAPE7GX0i3i2R+Im67LeWP1r/vVc1+C+tl39RrK1VJewTCQFx2eqcVmheUnE2yJjwUtqNY4fsMU9nxGBL9JRqrRJ1/vd9sImDVNU17zHXVRbnWAtNPrrfLj4YZVh9CeaN3yy7Mo215i/3kaLe+0JVG1T6ooUv7ew82xsyyWBKMuqLDrTWBYpB/tQtDedhMQ1Y1XQabqe929EVz9tznm3xwTPP+9qckhInvksnpJ+nwlngtgMGf3F371N/OPdJBIxmEiH8N1dl/hBSgigP2bB32jjHMa+JSvWCpKhkYra4hxSCRl77r31NLgAV3aahtbgcRIygZm7XDD9cF5ttivkZVYKnoEeUGfAbD0ynoH/O769Xk3i2h9Q7fPR53JGFHh++bIzBtWFfZJ87jWGAcHvUgtXlLLxxt9VpmixjkBfFJiLy0x5nd/q0n/ZJeYMH+z5fztWCEjW51Ise6tfKRch9k0wg4vmpO4tkhrANyxY2MbyM1ElMJfV8R1x2CqFk4fJ2YYUo/tOrzcgPMfDjXuLOCo268z/tbh/3us7FdLa8MpH+q5hl+k3xlLxoO0JQA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR03MB6533.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(376002)(346002)(366004)(396003)(136003)(4326008)(1076003)(66476007)(478600001)(2616005)(8676002)(8936002)(186003)(66556008)(26005)(52116002)(36756003)(6506007)(6486002)(107886003)(41300700001)(6512007)(6666004)(19627235002)(316002)(5660300002)(6916009)(38100700002)(83380400001)(38350700002)(2906002)(86362001)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?dBIVNmz/dGvQNHMkPLigKciGxDVA?= =?utf-8?q?ZRt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MfTSohRd3o628c20vIysD0tM6gW53ND+LSDV7D19j1uQ6HrF3Kz22XL6S7ORu?= =?utf-8?q?n41OdrN7LtQdx481FM34iU0i+9yEfE3Mej+91q8ZqEK7S+sH9qErl7iuIvhbHrWos?= =?utf-8?q?ouqFBxgM7I6662Inws/nTW6tsdpEDTy5/MEJZpLAFI9JyXkN8DBEZlkRXg0fVHFnf?= =?utf-8?q?MCUIrMFJk1sqMEChNBmTWzAUHxhbbvToVWkDahZHriQ9uv0Gn8CB070GK96k0OMtA?= =?utf-8?q?vqzJEyyMfjOs8HEiuMwPm3gDMM+AD+TJJhegEgc7iuAvTf2RdIzM2Pl6AmVlsyNwF?= =?utf-8?q?TNevqWNY5VJ7o7lgu7HIjTljyB85FmVwXxk427JE2WObG4NyDhCSIfU1ZaPz8JGXS?= =?utf-8?q?T8BuoQXUG3LZyfCPbgPEXw4NHQZJ1OlTpGODad7s0XvJCR1REkF1tCF9nJjQPxfAZ?= =?utf-8?q?W9V7814+Sf+5gkJT4X3QaslG1tKOb4yCH0vzRBH3VlyE2vaGtJ1hq/XHtdY0E+D4a?= =?utf-8?q?3s0EqEylTu7tV2QFPKNJJjRtUcGc8fbKTOSOdvLP3Ee9940Nh7fVz/0Q6lr3WiXM/?= =?utf-8?q?AtFkRJLK1fNfQQhnYJj44L3ut6oM40oGExqb61YpPFxKcUvi9WvWBWcH+udb4FBn6?= =?utf-8?q?+Gg87SUpPYaR?= X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: e19eac5c-ef63-47e8-f83e-08da6a15f9fe X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6533.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2022 06:06:24.9002 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8rlKlxsrE5Rg//kt5gMt87bBoJ/faEihso8YY6XNlV2qb3vqwCjW1IOBgrugQIjMKl5BVE6/zhuMXC/9SmLDmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR03MB6025 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Dominik Czerwik This improves performance and stability of DL-3xxx/DL-5xxx/DL-6xxx device series. Specifically prevents device from temporary network dropouts when playing video from the web and network traffic going through is high. Signed-off-by: Dominik Czerwik Signed-off-by: Łukasz Spintzyk --- v2: Added Sign-off-by: Bernice Chen as company lawyer. v3: - Remove copyright as this is not really necessary. - Removed Sign-off-by: Bernice Chen v4: No new changes, just resubmit with changed [PATCH v4 2/2] v5: As asked by Oliver Neukum. Mark in original cdc_ncm_info description that it does not send ZLP drivers/net/usb/cdc_ncm.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index d55f59ce4a31..8d5cbda33f66 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -1892,7 +1892,7 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb) } static const struct driver_info cdc_ncm_info = { - .description = "CDC NCM", + .description = "CDC NCM (NO ZLP)", .flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT | FLAG_MULTI_PACKET | FLAG_LINK_INTR | FLAG_ETHER, .bind = cdc_ncm_bind, @@ -1904,6 +1904,19 @@ static const struct driver_info cdc_ncm_info = { .set_rx_mode = usbnet_cdc_update_filter, }; +/* Same as cdc_ncm_info, but with FLAG_SEND_ZLP */ +static const struct driver_info cdc_ncm_zlp_info = { + .description = "CDC NCM (SEND ZLP)", + .flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT | FLAG_MULTI_PACKET + | FLAG_LINK_INTR | FLAG_ETHER | FLAG_SEND_ZLP, + .bind = cdc_ncm_bind, + .unbind = cdc_ncm_unbind, + .manage_power = usbnet_manage_power, + .status = cdc_ncm_status, + .rx_fixup = cdc_ncm_rx_fixup, + .tx_fixup = cdc_ncm_tx_fixup, +}; + /* Same as cdc_ncm_info, but with FLAG_WWAN */ static const struct driver_info wwan_info = { .description = "Mobile Broadband Network Device", @@ -2010,6 +2023,16 @@ static const struct usb_device_id cdc_devs[] = { .driver_info = (unsigned long)&wwan_info, }, + /* DisplayLink docking stations */ + { .match_flags = USB_DEVICE_ID_MATCH_INT_INFO + | USB_DEVICE_ID_MATCH_VENDOR, + .idVendor = 0x17e9, + .bInterfaceClass = USB_CLASS_COMM, + .bInterfaceSubClass = USB_CDC_SUBCLASS_NCM, + .bInterfaceProtocol = USB_CDC_PROTO_NONE, + .driver_info = (unsigned long)&cdc_ncm_zlp_info, + }, + /* Generic CDC-NCM devices */ { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_NCM, USB_CDC_PROTO_NONE), From patchwork Wed Jul 20 06:05:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Spintzyk?= X-Patchwork-Id: 592403 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56E31C43334 for ; Wed, 20 Jul 2022 06:06:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238985AbiGTGGa (ORCPT ); Wed, 20 Jul 2022 02:06:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238931AbiGTGG2 (ORCPT ); Wed, 20 Jul 2022 02:06:28 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2045.outbound.protection.outlook.com [40.107.96.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 112BD67CBB; Tue, 19 Jul 2022 23:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JV+CsYj2W8PZyi+xZsdN7SbODMDlkm4cDVKDYp5A9dwo2Z+A1Gbi+WFtdLIOEyCid6pdxLV3M8pslf9uFXxVP4Ycg6KQ7YqZBggiGgArBcLmTnljaTQPWYpiBw2DH4gOFLJ2NXnobaxNmTnIIjXIQlPyEqn1zoZqwub/ZVflYJU5PjdY9QXMCyPza0StEFQsw/yqZxIpV2vOpztVwcZZNVGGqUng5WBpbr8a945QuDWz3vUPu+XpvI1o/aWc8ishUQMKxEqKMAQzZpGJa+/GyLqoLGSyC1cdIv7zrWAlaSjR6KueNwCvu5fFdvpQ4nwA3c406FCeKu5A0kVtnfYyVA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZOk1n7XcFNbm/4UcUnSQxjfjxcEgSVMPACpvRo+C/Ik=; b=fgwuJeBi/aMk0phsalJw+iU8Kf26i42m9fs0LwNANGaG9KZChQ5xDbVaAhcYLFk3W/znNlEkvK3u1AJIk246sSXZC8z43dSuI49DC4qlvDMcDivLEvEorMfBBVA84WIQDvYX55SHhPSrorYky7QEbjPuYWeOC1deT4zTNS9XKnrF53VDxkUAXhNOujWC2TpY8BCKf/arWSHuj+XHpHPjjN85FtXeRDb8jpTRItqohWyci5kSvEq9wCa5mtJ4XMx7nbBxchvwTp8SyFcWDTnh7Wpd/tg4vJW/5sPOJErP/aKG8U9p4NYcHGiVOdQmwwbUw34Us8eK2NXcSxI0iX9rlw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=synaptics.com; dmarc=pass action=none header.from=synaptics.com; dkim=pass header.d=synaptics.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector2-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZOk1n7XcFNbm/4UcUnSQxjfjxcEgSVMPACpvRo+C/Ik=; b=SOwfPmFF6BjqBomo0Gg26tMFecYFi6wkQBKdLY12G9MWk7R8vjwSkOZ8Il4QwD745ChfwZOViT0QzQN7zVxwxeOyXTtTun+LgoDxkE/9XBjFKTpxdqzZ7csq6bP3QQ2iTQWlRSO+YUKSC6hp/1BHMkeb92M+E3I8Rutln9AlU+Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=synaptics.com; Received: from SJ0PR03MB6533.namprd03.prod.outlook.com (2603:10b6:a03:386::12) by BN9PR03MB6025.namprd03.prod.outlook.com (2603:10b6:408:136::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17; Wed, 20 Jul 2022 06:06:26 +0000 Received: from SJ0PR03MB6533.namprd03.prod.outlook.com ([fe80::d52:5cb7:8c3b:f666]) by SJ0PR03MB6533.namprd03.prod.outlook.com ([fe80::d52:5cb7:8c3b:f666%7]) with mapi id 15.20.5438.023; Wed, 20 Jul 2022 06:06:26 +0000 From: =?utf-8?q?=C5=81ukasz_Spintzyk?= To: netdev@vger.kernel.org Cc: linux-usb@vger.kernel.org, oliver@neukum.org, kuba@kernel.org, ppd-posix@synaptics.com, Bernice.Chen@synaptics.com Subject: [PATCH v5 2/2] net/cdc_ncm: Increase NTB max RX/TX values to 64kb Date: Wed, 20 Jul 2022 08:05:18 +0200 Message-Id: <20220720060518.541-2-lukasz.spintzyk@synaptics.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220720060518.541-1-lukasz.spintzyk@synaptics.com> References: <4e061614-851e-0dd4-59b2-7110b1a4c339@suse.com> <20220720060518.541-1-lukasz.spintzyk@synaptics.com> X-ClientProxiedBy: BE1P281CA0027.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:15::18) To SJ0PR03MB6533.namprd03.prod.outlook.com (2603:10b6:a03:386::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 787c2499-b609-4ea8-4a1d-08da6a15fb11 X-MS-TrafficTypeDiagnostic: BN9PR03MB6025:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fAdbhW8H4AKPDtmDxELLzoDtNqQra9U3M1/qu4yqY7By6kB1qyia6Q+ae6NE6DKWsqvr/uPOE4WD91MBX5+Zx/FKjTOj2MejG9kCU8fAgJpsBHg+zH4rrjBK65yHuQmkEqDptVMdDL5AfRl1ukInMOMk1F1LGbnPNNamN5KeTiTnFEVI9mjlLIOFwT9+ydvvY2e6A1B2Q5Mdn5ift6xFVZ3hcGzz26TT5Rgy/sLAfRSOSf7RKJzC/BKQQIAyXsO+Kgy9melLK6mAlneSNRjsvO2S/TU73A7wm2L4kpRbfFaJb4TMZ2b/pfjuSJOkYawgxxih9Z78Cps1/ly12w4CY5qcoS511ZQx3wixBrh42g0G4Wr4Cv9EyZSQOZEI0zfF/1cGdbm+SZm+3OOoeYXe5IaNKDCMvbtwd5jjBfq9rEdVtxbvcBBbJgcvVGOoumOUSvxqg3srIMdvQaKxb5QF9gyALSIJmGdqRMo9mxNs/mSb5+cGhPnNpaRSeiXFnukaKsTfAvuGLvsVH+/pDn2exuPBotVvDXT8ah3mCHISnPT4YyRUUsQ/bPtkQ9Ll+YQnGtv/sKptByJiIL6ILhXZvYsLThrJbsuDdwXUr46EhDMzD/tzBuyo1oKIr9KVIC979XLyN0zV2pSDbtw6srtS9jf2+0Fy4QTUdsDSxStaQG/M60quYPzZqsmHffrzI6FE3HG17zra95i/B4e9x1s+pm9RKRcSHoHrdHQhlKp5Nt3Y/eMps0d9y05M2kfDG9A2h59tpW/8EXsY48amFLtGvJE3yGky2T7jCaOQDkJ/goRDS2a4npExxQxAV/2YRygnjX/HY1OxZMwN53UMAz+X1g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR03MB6533.namprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(39860400002)(376002)(346002)(366004)(396003)(136003)(4326008)(1076003)(66476007)(478600001)(2616005)(8676002)(8936002)(186003)(66556008)(966005)(26005)(52116002)(36756003)(6506007)(6486002)(107886003)(41300700001)(6512007)(6666004)(316002)(5660300002)(6916009)(38100700002)(83380400001)(38350700002)(2906002)(86362001)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?FdNLffyMGNHtFzx+n1DTvpgk+3lz?= =?utf-8?q?4y2bXSad6Wp2oU6pTag8+QYngv4y8kdafIr/9lixFpb3/IvapLWmZVBzZYVoXbNGI?= =?utf-8?q?dazxiU9yqr45ZOmYgQX8Qbx0C9Wnwlk7UOp3vP4xoAT+JOJnUnXS3GmewcoJjf70C?= =?utf-8?q?gkwnVdI0BmeTlew0Ujz/GnbvHW91higBXOXo0qOKNyFBxum9rh4gGzdnExA+DBcU0?= =?utf-8?q?cucKX10BamrxiGUqTFRtVAxCJAd9+HBPQbL9+4G8ZSFt+QBjGTEP5EeugIJj5kFHf?= =?utf-8?q?+rffhlGr++PK/zAN8LdyWKjhLxkeEw4QYKV9YOfPGouU2OoFnWEYWojNgANDrYUw7?= =?utf-8?q?MckjSLa12UfT1S8yWT8yjVzEAEF/jvjTNbJEewHqsrneyomfiX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dXe8DgPs8+gV?= =?utf-8?q?Trpavn9Ss8p6CcIix7zRtcxOKq2AbZTlL5l4NTzFQYtIB3GqPd5/QLdzJKKBYg+tE?= =?utf-8?q?RusQE8D+dLXM+CB19ZM60v/Bp/lhL+45PMAC2+HfpDHDEUyvmZc4Yvl3XLaujuUY2?= =?utf-8?q?Tn9v62E+7x9GE61DPZKcqu/JkyNwMtE8EIj2mHf4JUUJgq+ap5lWVxjTd0IHW8kk+?= =?utf-8?q?GM4iQRBaPw0Vn9LkJ9e7iEDM306rq9K3dPEUHVAdN/WSeCCmUKuSbhj23yWH1bMB6?= =?utf-8?q?iMXN6y477IvR?= X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 787c2499-b609-4ea8-4a1d-08da6a15fb11 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6533.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2022 06:06:26.6998 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: urUHVXebrHl9tKKmKknglP8yRLBsUGv2hTn/D3B4WnCmkDgST3hA4c4mLLiISlgMw/Bs/uweveFIy/wVljtoyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR03MB6025 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org DisplayLink ethernet devices require NTB buffers larger then 32kb in order to run with highest performance. This patch is changing upper limit of the rx and tx buffers. Those buffers are initialized with CDC_NCM_NTB_DEF_SIZE_RX and CDC_NCM_NTB_DEF_SIZE_TX which is 16kb so by default no device is affected by increased limit. Rx and tx buffer is increased under two conditions: - Device need to advertise that it supports higher buffer size in dwNtbMaxInMaxSize and dwNtbMaxOutMaxSize. - cdc_ncm/rx_max and cdc_ncm/tx_max driver parameters must be adjusted with udev rule or ethtool. Summary of testing and performance results: Tests were performed on following devices: - DisplayLink DL-3xxx family device - DisplayLink DL-6xxx family device - ASUS USB-C2500 2.5G USB3 ethernet adapter - Plugable USB3 1G USB3 ethernet adapter - EDIMAX EU-4307 USB-C ethernet adapter - Dell DBQBCBC064 USB-C ethernet adapter Performance measurements were done with: - iperf3 between two linux boxes - http://openspeedtest.com/ instance running on local test machine Insights from tests results: - All except one from third party usb adapters were not affected by increased buffer size to their advertised dwNtbOutMaxSize and dwNtbInMaxSize. Devices were generally reaching 912-940Mbps both download and upload. Only EDIMAX adapter experienced decreased download size from 929Mbps to 827Mbps with iper3, with openspeedtest decrease was from 968Mbps to 886Mbps. - DisplayLink DL-3xxx family devices experienced performance increase with iperf3 download from 300Mbps to 870Mbps and upload from 782Mbps to 844Mbps. With openspeedtest download increased from 556Mbps to 873Mbps and upload from 727Mbps to 973Mbps - DiplayLink DL-6xxx family devices are not affected by increased buffer size. Signed-off-by: Łukasz Spintzyk Acked-by: Greg Kroah-Hartman --- v2: - Information how to change tx,rx buffer size - Added performance tests results to the commit description. v3: No new changes to v2 2/2. It is just rebase on top of changed [PATCH v3 1/2] v4: Added Acked-by from link https://lore.kernel.org/netdev/YtAKEyplVDC85EKV@kroah.com/#t v5: No new changes to v4 2/2. It is just rebase on top of changed [PATCH v5 1/2] include/linux/usb/cdc_ncm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index f7cb3ddce7fb..2d207cb4837d 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h @@ -53,8 +53,8 @@ #define USB_CDC_NCM_NDP32_LENGTH_MIN 0x20 /* Maximum NTB length */ -#define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */ -#define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */ +#define CDC_NCM_NTB_MAX_SIZE_TX 65536 /* bytes */ +#define CDC_NCM_NTB_MAX_SIZE_RX 65536 /* bytes */ /* Initial NTB length */ #define CDC_NCM_NTB_DEF_SIZE_TX 16384 /* bytes */