From patchwork Tue Jul 19 06:24:51 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: 591818 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 B7601C433EF for ; Tue, 19 Jul 2022 06:25:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235108AbiGSGZS (ORCPT ); Tue, 19 Jul 2022 02:25:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233168AbiGSGZR (ORCPT ); Tue, 19 Jul 2022 02:25:17 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8676DA183; Mon, 18 Jul 2022 23:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YJGR+Q2sYeK+owZlKWugDNItOP93j6z0nSZW1T/6QsnAv2fUh2NoYsdG/+sVl1rZMch57QngXOn3mKNDeHJCy1uNM+1xLSfZrZNRICZ8GVgdLg2G2A8TVuXLrFQJRIszWISSp1k6EYGuVLEFM1TUf0K7Y0WXAX1H+aSoVAg3C/SakH3IxSGsPNnSTfZCweUcMUhW63oFz3IUdu3NfhtdpMYw4D22USd5eAXfyYR9U0oE1Si21VqvhlQW0+QD+zyJ/5FZeDD2gBJv4EvUCAwE1BvXAT40blf69UqXzsyg7pMXqkFytbxNTX759WmUaodmQsEK7HPIio2SYIXYymQjrw== 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=vdTEjQOe4b1GldRvub1MFybVVEWnTdj4aUp+DixfhBE=; b=EX+CgBIWdbXReRuu0b4esOOedeHFJwLWDF3Skq3I7mPguG3NUUHWuYU5DU7q7QoEDZQUmRoXDdhs+U7lEyKzLaEPBgyql5HK4kOLEzk+cXUkQCymzHuLQmDD7OYu9CTm3RpF81jrxiMzSq/F6W+i9QEBBaTde7fG2mh3v7ZnUnZFuGcN8ynW/mcpyfU7faVwEARaiTGiM3dWH3wlFeOcTSf42T9TEHcnoyVSdoaTPcjyrvwzizZPROJriKRainBSRpgZ4dA7pnz/ZU77edeTJrk5vupHtpLl9FhJdyjIxn5RN75EzgOc+yRSXLC5cXwqwVhZr6aOgQAQN2vXrFpBng== 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=vdTEjQOe4b1GldRvub1MFybVVEWnTdj4aUp+DixfhBE=; b=b6h/uI1nKofjNAzSeXJCkWabELdhkiYuTGKwZVXydnR6v6pD1sHvKwUwpFgEo+epLLnIsN6aVwKhLnlorS9OQl9Kd6E6aeBi5HB/X4L9hBfD2aQhEa3nNFHCW69+KcORxxC8rZkW2pGtBYHhxpNs4hsHDtojQhimQ9WkPHrUjUo= 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 MW4PR03MB6650.namprd03.prod.outlook.com (2603:10b6:303:12d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Tue, 19 Jul 2022 06:25:13 +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; Tue, 19 Jul 2022 06:25:13 +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 v4 1/2] net/cdc_ncm: Enable ZLP for DisplayLink ethernet devices Date: Tue, 19 Jul 2022 08:24:51 +0200 Message-Id: <20220719062452.25507-1-lukasz.spintzyk@synaptics.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: X-ClientProxiedBy: BE1P281CA0020.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:15::16) 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: 712ff264-d70d-4b8c-f133-08da694f6fed X-MS-TrafficTypeDiagnostic: MW4PR03MB6650:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4Y1/tY+o6SQmBtGtw5+hXHFRJL3aNNRZv2iHBdXqS5hTwLXZR/0eT44PrgSSrGfKHG7owea5M8fG0wriunWzVz0pmlzmVwTBBhIwpuIJ6wRCxZmYO9kUyWXrwXI39bp+RlSvi3744myanpWm8eI5GN6jWEgD/9zGDUITpn4UTAVniJkSBbLVcrpJUR4NcrZeMFNmTEjPnUUSY2P6MD465qmcGHYeQVtP27xVojWfiYZi92nkOMO5Z9L3f+wOfFmwDFwJikJ94WRHM0WanPEDughRZexiap2Qvv/kCSN5hTAIfZx3QICDjUjqQC/0ZNiz0RpknaEJGHwpQdtO6MZ07Q2MsnWQLrGQiPozHwmjCOCAI1t8rc5O7GJ6jgUMqZBAW+KWiL/fCfBtPkemVa82p+amsst/MsLIDjB/SXvYJrIBebicMM5xbvvL1VK1DtAG0lxYyqf0aOYMrNFbP9uveueg2YYZOlg76DX9qwIVjKhK0xYC/Om1Ph81Oequ1GFI+l0pqR4HKclZfgwbUQiUrztER3GKUT8SflPlQbz9XxSQfh7cjRl2zNQfLLFd3Ur+nKgHfTQS8tijgruQdislnydQ5NW24YtyDE3QK6ULKdfR9kYqDhjaOmCajM0W/hSaC/SyJomCIvVBYlBGal1b1w9CWk9tulqoW23oGyFr4FQZ0Xep5Nm/8c2oVl5ryEruLEo2AMKLsBYEHPNYM1lF6Q4iHnAeOrV49qz54vcz1P0OnUwJjwpn38DdJWinjffNDszA8a6YxattPaUeKN3w6yecFfdKXzsf4mLU853m9p4= 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)(366004)(136003)(376002)(346002)(396003)(36756003)(5660300002)(8936002)(2906002)(86362001)(66556008)(19627235002)(4326008)(66476007)(8676002)(316002)(52116002)(478600001)(41300700001)(6506007)(186003)(1076003)(107886003)(6486002)(6512007)(38350700002)(38100700002)(2616005)(83380400001)(6916009)(6666004)(26005)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?3v02vnC3yfLhwKeUlT+3Zm6qatfB?= =?utf-8?q?PZ8FHQ0SyB6RE3PLzj2UZMCN+uU2KWj0IHFyzSWgVZ1dOly/OO0Zv46VSDrYMO7+N?= =?utf-8?q?SxE/cFxlHyCMNZ7vqemwo1cLpXjH7+D988szDAJXoJX/uIsWfci3cwXFrVuwJWxUW?= =?utf-8?q?dCk1iNLV3j5MKmyEUNtPRkUwWBX63WBk0oBAucRwcR43IxhkJZqZmysJcu2EX5tza?= =?utf-8?q?ivuivH/LyfsjvabcnQ0LNxP1NWSMeBh+QCpiyITsbo3YHtzvA+nIjgrhogrCG1ldY?= =?utf-8?q?yF8HY/7OTrBNbRAjuEV49gVFzfmdcCdMka/z3AMs5f/HMvHvJg+wRQINvJs0sWRer?= =?utf-8?q?hex9HOyjt3zkBZU3QNS6Jou/0kSK05OTVeBWFkpG5FUJj4ezEikh3yLgIuS5ob44W?= =?utf-8?q?yTXoyUW3mDk0/toZJPBs7+eeZQA1QWcrZVpZs85fxusd9JKBujQj6Dp2Gnlo4WqvY?= =?utf-8?q?W4V9a+lPmWkgQRR2DmYll38JCkvidfZhfnB/h5+FzAOJnDrj5ZKGT1Lcy5OLNI1Fz?= =?utf-8?q?A+98Dpz0tsEyy75yGpisHogKcALdeCzjg8iSuZQEcTYE0sOJp7kbnVJ6J4HYt6Fb8?= =?utf-8?q?8O8+qHg3Uj+PY3ovXJWCv55/qpnXs0Z5Z3jZ9up25r5kjZmc4EBJ4YXSQ+bvwgIV3?= =?utf-8?q?p6hqjCZuKV0utVR1hfyU3uUpSc53nuaeLC9syJj8OX3t9JNz9sBa8F46A8gTtxBPY?= =?utf-8?q?0i5B9Y+ENdHVNkaF/KCCcuyGmPF3WsQflKgKMzSnqsOMGWRUp0m1brwz4qIVr5uhB?= =?utf-8?q?GD//S4e7k/Wg7cUXohMfNb9QA5cu51Yd6ZWLmS2WsPfZ1I5vQZcLahagrr1VUtLyc?= =?utf-8?q?tFEFWRs1c7aKxH+l3wRtst0Iruu6CVgWfOTJqm+hMbAYuuN78ziFDJeieu4dX+DZ8?= =?utf-8?q?aKZYho/wXlm8o4kDXsiqFpCR+2qHIjGCll9TJbkGKLV4FNNR63FlvMhDSEODJ3NXZ?= =?utf-8?q?Vr8cX4Knnb94ZiVSRl5FfwjZVG+1nhUzrJu7/XTPzDl42E+qBiOcGPMX2JuFbypF/?= =?utf-8?q?s8/Np/IAMFGyq3H4giuB0BRLJjDOwaAHl+cxLLU4Gk8BL4vvrHicqwSk4/KtHlTpi?= =?utf-8?q?/SP8OznGusQNY2VGiFUEZ5L0gxoNfCJcTVhzsZ0VpuM3f/Cj7o2/RCiE0+7BLt9Ep?= =?utf-8?q?iKYL1JgUI24enD0mUDSG45HJEyJ4OYlW3jWnaMbCUDzDk8wjCQlg3GFMjQbPSZtjW?= =?utf-8?q?KVuG91YdVh0ouAIzDL8OIKLUkuAqPAfMEuSig1tKC4XdIAnq85gvSCUHaMVFNb1pB?= =?utf-8?q?hZ9G8SKgYbPlEDCPa/cCcBbmpr2qU7dCr1tKSHZu8tg3sopJqwRViRwQPkOhuYJaU?= =?utf-8?q?s9acmsF/8UYZMC2Dtjspp5sfSYkax9G5jCwkHkNM6hE8Pp71Xe1K59P5tBhCKbrzX?= =?utf-8?q?YnlDacB3FK5B9AU87PYck2GYyhc2cGlbDC9vld3WhKAi7MKPQa/TblvR/2/NoM4xA?= =?utf-8?q?R3yJZnMVV8VilsqQgbZ4n4wDLkiW3It8UwsaWas5BywpbdGru1aaWvI0QQ4vNXQuZ?= =?utf-8?q?1T9Ar/jisxyX?= X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 712ff264-d70d-4b8c-f133-08da694f6fed X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6533.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2022 06:25:12.9731 (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: UY93sZueJoChmwFnfM4yn5sydYyVfg4lKZv+4ZYOpDaf1qHo+qFxmY6khpBPoBPmeSXgWUU+vHOGemnHL74X8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6650 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 --- drivers/net/usb/cdc_ncm.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c index d55f59ce4a31..af84ac0d65c9 100644 --- a/drivers/net/usb/cdc_ncm.c +++ b/drivers/net/usb/cdc_ncm.c @@ -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 Tue Jul 19 06:24:52 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: 592407 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 2639FCCA485 for ; Tue, 19 Jul 2022 06:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236654AbiGSGZT (ORCPT ); Tue, 19 Jul 2022 02:25:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233598AbiGSGZR (ORCPT ); Tue, 19 Jul 2022 02:25:17 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2386FA1B5; Mon, 18 Jul 2022 23:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ApXCOeIkKgJxjRp0lLt6mEHfDygV/Yul2iafixaz9BvNsHl+2eCFMaGpa2JL7NzhcVs1pu07mwOaDiQl5c55qPejoacl9oHkIO+8pjUuk69p2iw0IbSRaoZxVK8P8+01WbT/Uw6Gr5nwBVgIibPKohxDWrxYsBj1B8Roc98V9vf0rW5CXA6PZMZB6VeDNuS3lkd7QVMlQokNtCZBsHWuIcGcFvaju9ZNpuzOeWxdeBo3PdIrrNd+Ujbzz+TvIP0/sTbgATJIgfLFLP8lN65QSxgZZ7fT6cev5IZa9bx3Ku7b7zh2dUoSIjV6gJPzpfTkZmMCkEZh1Zy3iwMmSmhkAw== 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=n2IpcDyzFRaFkvZWvwNQdH5LIhe54YynUgvUtfShK8s=; b=chneW+EDxMtCS/mDPPNdK5abAQmopxdcMkwmp7/ebVZsbMTIJ7TpyONi8ToR04qK35AFv8iHblj3NTd/voR/9ITDGOrEjTSaqrfABBO40kkWic+7DMF+KZNAdQy3U/60dKYaxJZ5gflVdriBtB+52qa4Nmomq9In0sorZ1jCPx0junJ9ovdAAL9vClJXwANFW3EauUsXvyY4Ov6LhpVkGW22FAdGEbSMNIkGvXbadwDxxnQ9z9U0q/wmz/PWd93HXgWu7SAf0gKi9NJgb/fYuj3MJeidY8zwrAs+UeTVqHNGHXT2ZIu6wJtF6Btt+vpt23MsD6y1q8cp//oOw4AlbQ== 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=n2IpcDyzFRaFkvZWvwNQdH5LIhe54YynUgvUtfShK8s=; b=mYLgxY+4bTRvRSpRsr8hzk6bcwpmUgXE3Ba32CxD3NwYjvdfarv7xP7C62eHBDKAVVM/kkZdSlRMzZ0YTeNH9nr8Ke3vCukSSOHaLYsir/u9K/q8+mVuZvQnQZ0LQxbw81yklFFFk6ELY4EDrEzfqika/bFYhjfsKak17hcAvRQ= 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 MW4PR03MB6650.namprd03.prod.outlook.com (2603:10b6:303:12d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Tue, 19 Jul 2022 06:25:14 +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; Tue, 19 Jul 2022 06:25:14 +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 v4 2/2] net/cdc_ncm: Increase NTB max RX/TX values to 64kb Date: Tue, 19 Jul 2022 08:24:52 +0200 Message-Id: <20220719062452.25507-2-lukasz.spintzyk@synaptics.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220719062452.25507-1-lukasz.spintzyk@synaptics.com> References: <20220719062452.25507-1-lukasz.spintzyk@synaptics.com> X-ClientProxiedBy: BE1P281CA0020.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:15::16) 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: 6625b22a-023e-4d09-7d7c-08da694f7100 X-MS-TrafficTypeDiagnostic: MW4PR03MB6650:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cp4yhXlTvj1urvSzGGdg3eeUVuthSOR8M6uIRMNas520IPadAq7unhd/5sOtGdaIzfTxpPPvjdE10Tcq3z1bN07/1TYjKh/dYax5SRtKbbYNOgh9QXo/HcX34PM2yHy0+zzBVOeko8kvjPqpmKmlCMvR+EJ7VtF4vBlvUpndCtom/X86hZeGN3SgegvhUfP5AUrLfc9v2T6S1D/N7xhydFo2I+VVX9yfUpBEEc4wNG3lyU3v2s6sReBfy29I41ti0zH/TY/pwCD15IqJxVBsMKVgy2Y/6ZLGNXLDLETiudWJC789iJa7AYyqSlfE0GuGFGvabtWNU/MgQk81g1xXTUxBoOjl2UYshBYodV50VvgX7XqckV31Pco/oFwBGd//4eXmuwNyVdiSXMZOJMHYj2JlT9hPXfJuHSsxL/NHGTeW6i71AD7M3gju6rJUiuSb+GFXfUdE5WbICP0KFdLFB4fJ1UF3VFrRZApnrY2ObPu3JY7zuQ6Pj7OlgZdEKEIuSMnjYPeQCivhZ40OI5YxnA1GX7WwZrRmT7dCy07G9m1R/4gdzRSqeF6Lse+ZFhSBjKHLBs6BoJa1jaNG9fUyn6v8RJ9Y+t10U6XjTacDiPWmE8nj9ojbyZkwa/PQClN/hLjF1SdnBYs2Ym7bEQcf+9L9mFCt7jH7Fq0SfYmKr6jk4GEUU22vXXea9/sHtkMn41FiP8N2Sow+uWS0RssWRjuaTNirHIdyUOVX/JpJ7iWjXfjCofnZZYBO2EupH1qZToIiYIIi0EtrEIhLE7jhdrw2DANyFRZr/eSbyfn2veOB6PqYm/e5BbyNo0nZkbEtWp8RAh9Qlsum2eNMG4NcVQ== 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)(366004)(136003)(376002)(346002)(396003)(36756003)(5660300002)(8936002)(2906002)(86362001)(66556008)(4326008)(66476007)(8676002)(316002)(52116002)(478600001)(41300700001)(6506007)(186003)(1076003)(107886003)(6486002)(6512007)(38350700002)(38100700002)(2616005)(83380400001)(6916009)(6666004)(26005)(966005)(66946007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?5vl//4f/n49gqRavIraVCn3u/CY6?= =?utf-8?q?05Yl5AUTeADaYvWiWxk8HPIgIiA6MQ4Tacr7BDMJDmwh95YgLfhFEghquLt0/BLmR?= =?utf-8?q?iYOAZzmwUAyUlzo6OoL6kMjoCN8EdZ6mpllqQ8I8tPL3zs0uXtV5L/8GiT6zac1JP?= =?utf-8?q?clycfMTG7395noWYcc0Y3iAknQHSyF2yjDUIs6Qu1r3V9hqIze0MX0znthG1HUDR0?= =?utf-8?q?oOiw1qIQ6PkZoOS8htRGrPx+njlalZAXZF+6Gp8/15kO8az6RNSGu28P91Xw3SO/t?= =?utf-8?q?JwPSg28ojmKaYZVgKKHR1gkF2siOHoWrC0WnfogDVuNdOAnGeJytXk7Yu4twp/BKi?= =?utf-8?q?1ZbzTZu0MIUO1yRqFQdULgxxbEqC4WfdYgkFs9bYuz1F3EZosGi7uscA+E5LZE7hm?= =?utf-8?q?5brWeswn5UmctT+GVue+q8STm95xtEAdPp/pdTCHDJnXvCVOeRIRY6U6o8nmAVnLB?= =?utf-8?q?L/+LW8O6tatfjXU2WmkWFCKUF1e9EDWoQDgyr/zmaAg6TWpS9t4qlLUoSWsMmJtS0?= =?utf-8?q?IP9fw2WwpPggxn3px4wU167nReVph+KHyeKj/dnnw7c4aRiJVNeRnwXdIFvkT6m0i?= =?utf-8?q?O7jV/i6aTC1g7CuazrOuSIIIw3Wh0xFCrwntw1qkSU+NEGIXMynaB++uZVN5f7ds5?= =?utf-8?q?DtXblHU5U7MTDtYxda9TwIsd9Fv+2kkHKJje7T6SW84lO86NJLgoF5Dn2JuvZUPjG?= =?utf-8?q?m0c3YaJYP5RO7wwlef43GQT/WYbendftTpSBhs66ZztMnE5Qm7oOE4l7zjhssBhFV?= =?utf-8?q?0fX6sDZ9l42ohNpqMLZBfguLVw9M8sKzoozN1FH4ch4i0qN/Yrqq+hnO8wtrf9pFI?= =?utf-8?q?jDP9QGD5/ssqjQSmD/nSrTCdTKG11JFLMyOxvslZEMcHqSgGPgbwS7vKohWc8TL1l?= =?utf-8?q?kvrpPG/aYwKFYsTwXcMxvWylZGrauM8/u/13EBvfGuW9RxH2V1fAUwaA6V+VUP/0+?= =?utf-8?q?DaGMDdxWPH4+D4eFO2yTnfMQhZCywD5f+1ptm3IGUkzfI29j6blOooEzx7MoXSARj?= =?utf-8?q?Dtr/XujEYs6CSL2TWzorcXmi/VY7fMREiJhVp7GbQJMaKfUyee9oB91fzX7Bn9gpN?= =?utf-8?q?eu7PvlukQrTaFcLGis1FUNe12/E01eDS0JcQYJdYBXVNt6Yw9qUij4Cw7OwnB3Y6X?= =?utf-8?q?sJXGo6SHhNZRRUmHajZ/zfnbb5tSbVMiQPZo5fW5VMbaDLsxtkKBnzG/BcN1ScayL?= =?utf-8?q?fCpuSEIPwCSg20q3DKq4/gjMVisbs7zeXDGVv7T054d4JB8OEXSkulAc7uNHMBgGI?= =?utf-8?q?nVGMSr/OgAA8NiVnJ+DlZIwOWbhsEumFpECjgDmQcufVDwLkeAuwjlcPWetHaw0Bt?= =?utf-8?q?jDS1bd0cAtMI2JZfWS8yJush4k/nQMkGrZIvArIFrzqTMt83aWVIpdfygWkeYmSxX?= =?utf-8?q?UNl5mVEfoDIhgaXiZ4vw+vPlV/uXwifRsqL09nJHU+a4d+aOCr3zgBnIHA0+z5tHj?= =?utf-8?q?a1ZtIXkJPHiwGpcEkb+JoZ7HPUV//+9ii1JN0EDkaqYxfF8LqKgvLkaS8XKEK2NRc?= =?utf-8?q?Pxe0MXmzvouD?= X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6625b22a-023e-4d09-7d7c-08da694f7100 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6533.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2022 06:25:14.7099 (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: GjxFngDLKql08c2xmwHwcE40PXbKFgkr+cZVpPvmy5VP6zheCWyLDBbUwDRjYQwGgbq3tUF+pdKrBtHvXi+WYw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR03MB6650 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 --- v4: Added Acked-by from link https://lore.kernel.org/netdev/YtAKEyplVDC85EKV@kroah.com/#t Greg, Hopefully this is what you meant about missing "Reviewed-by". Many thanks for help! 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 */