From patchwork Mon Jul 18 12:36: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: 12921211 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 8887FC43334 for ; Mon, 18 Jul 2022 12:36:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234573AbiGRMgk (ORCPT ); Mon, 18 Jul 2022 08:36:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234537AbiGRMgj (ORCPT ); Mon, 18 Jul 2022 08:36:39 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2087.outbound.protection.outlook.com [40.107.223.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8ED3E0DC; Mon, 18 Jul 2022 05:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kU00M/HfGiP1yqslaH3a5jqMsNlAaNWUJhkj1MDviMnHhpF8P1tK0dqvcsm7jTckneMh7k/CAFSXP6xMg5XKgLPTvIchkMTxypQykWLAGexQ8Okx+0ga+AgW/y1zPyIDb8l05IPd3Ub3LjvoQGjedUTdSReEDM03F2BdfsjZpQjCIhRCfk/yTwb0gAYjjmkQCCcWyTJCVzPmvK1o4Kr1txg+WpJodNywuKeoGDteUEvjeA6eQ6oEW+PLAzkBNEX8Nqd50zP2TF9CS+99FvrQ3LHmjJMZlNGPKDBPC3Yeb7TCGdZuYT+MdS9O1OtMBBlqFKVTvynkReyV5Usc1/dfkg== 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=wIBA6SaIQDgiyX43ZMoL5ZRp1ZT0Wv8JGx7bz03IrU0=; b=MGzhEHqKvx+EDQ6i9bjEplA+OZGZEF6hn0BqCcSB6kvangGXBhKF7zLOfk7SXcGnCEPvd47fmmZ5ak4cMWwRvlKhtCmUE09smUMfaS6S2UIX4H0OVttEKQs2NCW6huq0znPnHBJpeeqqjfqgiNeevMYXtTBFb0CkQuwJRMww1ROZY2Bk01gzNBNFNnVi87qxnf+7emt6ukPI5NpBMUDbS8K/aff9F9BotzHQnnwBCXj1J+QAZ950PtL+CopDgnezzvvsW1IofyK5Br+ejCO22bKlHuJyxP3vHfSF4QNHa3aa99QlE2ObjnMWPKyLKYWgybFoRF7cRJBYQ/ZpQ05C/w== 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=wIBA6SaIQDgiyX43ZMoL5ZRp1ZT0Wv8JGx7bz03IrU0=; b=NbeTPfz7oc40lVD/7wka3R7UkxP86gDKtmb6CGAngEm4tjSOQAB6AqUUlPsLKzx8C15uqy9hm38uMnfDm5P4Rv8sgVlO3xudtOA37bQpZEUxEod2YeqXVgX6lNyxJEmmSvqWtYtC3qPFJ+dwPMAq7NBeTnhq1qRWd7FRmX/eFhU= 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 BN9PR03MB6171.namprd03.prod.outlook.com (2603:10b6:408:100::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17; Mon, 18 Jul 2022 12:36:36 +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; Mon, 18 Jul 2022 12:36:35 +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 v3 1/2] net/cdc_ncm: Enable ZLP for DisplayLink ethernet devices Date: Mon, 18 Jul 2022 14:36:17 +0200 Message-Id: <20220718123618.7410-1-lukasz.spintzyk@synaptics.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: References: X-ClientProxiedBy: BE1P281CA0019.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:15::12) 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: 952cc97e-ba51-4685-68c8-08da68ba2738 X-MS-TrafficTypeDiagnostic: BN9PR03MB6171:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9MqeVEQ65/ixowCjxpd6EcHQ1iupctc1+3flhRfyF27QxKQNB5OM2s/+Tf8Irjgskgt2sE/muqXW+a1EGlsrfkmFqmblbXs+mNOK9OSUBlFl4Ihn/3tQeQR87kvNxpCU7/e2yPBMI5XuCuXG8meSSj7xIqN3foKLXrH+YH6rsHpoVO/bAc59iA6IrZqGzhOLFdR53BCtbyzsj7s3rVlfVdsqI9DaIdtPaFkvdmqsDBtwyr3feojBKfRbN3nGO3Z9KkWi/IvJylf3dlHlpiaJkC4Y3tJMiWVrh1bM6yYKEMksbbm2Lszmm5fyPcMH76k7B2zPn348QL9XII6unuk/6prMmJKbnT6PRX7Ri7adjJoq0EbkX+Tgno09VJxDC72iE6rWRRgH7bleplQzI73UNQyVzMiSY8P1ZAL/UkoYlHquueBzpSK1aq26B5ANZtKnJCEICNgSZPgciiI7h5bfEvMKB3OS3slDb/25NZ0VhOIwkKU5FBsRatHkr37hj2w7dRH2kBS8Ly+EHV5nwGI3KqMAjw42Mb9F/wkKWXYlwMnbSr9fOxKjBiNcadhlx8sW+fkns3XIaq/6osp34j8q+paXDO9Pk7MY15sveUdeolHxI3LxWdOGynJ9AkznhI9ur+B69ky4eLKXWBw5q6V5cToAal75BdbtqUu0NZOVMW7HtRQ/hUSscHj3udhCRuuqdYqfyBiKGrabFAaI3FcvlaXmihkQtRjkpZQiM9zM03KBUFenfh32KlLl29JwOBYgpwFXStI1FQAxO6kmOIpV2xRRjKau8dvAHF+5BYcfUEPzAQSpua+y++gx504/UO0C 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)(366004)(376002)(39860400002)(396003)(346002)(136003)(6916009)(38350700002)(19627235002)(38100700002)(316002)(36756003)(66556008)(66946007)(4326008)(8676002)(66476007)(26005)(41300700001)(2906002)(6666004)(186003)(6512007)(83380400001)(86362001)(5660300002)(2616005)(6486002)(478600001)(8936002)(107886003)(6506007)(52116002)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?sTUZG1QkBYotEqErJ57FMB6BqLP5?= =?utf-8?q?8mMBcwPU6pxxGbO2SJieOsldkcm4xAhJW+o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LQKDkWNPW?= =?utf-8?q?+BWH3Pa4k0kUFTJs7ZoTxbNKfDrLlXto4Q56KP76oK8alvHQRbiwMA53/rJj0hdPP?= =?utf-8?q?52GLhM2/21GFc8oH/KTb2d2n9vJeRhpRyZ5L9aOqs6SAsny3R9Lv/mxk9RWDtBq73?= =?utf-8?q?Jr/yrUJWNYkRTV8IBvShYjwpjIzFXYP7M43ZvYOF4EvdXPWo5eW2EHXX0uhzqmaVr?= =?utf-8?q?Bc04lqL45+27WUQMf/Ukk0pd2+hUj2BVHeoLOXhIcUf51FbZE3ArGH47hChVFimWL?= =?utf-8?q?COyrnr6kcPz5gBsl6dfacQE6pmZ+OgpQzyEeq2Eg4UC7BigEp30BV8FEv2lMx5kvC?= =?utf-8?q?koTt/Y8o8D1ve+xiEz5LBvxdHH8thewEPzmFvbP04AjLftjOG6zmj8fBAxhcJFVfY?= =?utf-8?q?I9jE4ZYxFd6lWug3lOVpu4rRR/8D1nn9dz7oYfOGy1j5SB7LQoSyzUwK5s0zJ6uhH?= =?utf-8?q?uF3HBL/sOgQHwsjs1weSt1m6x7p1SMOaZr8FugypCMZLzJ0pemVY+sF13AdVB8hiZ?= =?utf-8?q?OIqALVSzeVYotU6jIJp98FaRIX3vFLPQNKL5XfE5qijECYwjgCevCaMM6IU7IkH/6?= =?utf-8?q?79KWRMvnqbttUcj72Hfsraf6drE7Mg4RAg=3D=3D?= X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 952cc97e-ba51-4685-68c8-08da68ba2738 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6533.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2022 12:36:35.8966 (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: NNckzpqMgvyRa/aYyqinQutdo0SfcHxfcjUtmrt+TWyIxO900+ny2HhiGl1SQOF9MgOgHyBoHvearlGp1dIJbw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR03MB6171 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 --- v3: We have decided to remove that copyright as this is not really necessary. This is v3 revision of the patch series. Please forgive me it is wrongly resubmitted with git-send-mail. drivers/net/usb/cdc_ncm.c ssary +++++++++++++++++++++++ 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 Mon Jul 18 12:36: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: 12921212 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 037CDC433EF for ; Mon, 18 Jul 2022 12:36:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234621AbiGRMgm (ORCPT ); Mon, 18 Jul 2022 08:36:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234562AbiGRMgk (ORCPT ); Mon, 18 Jul 2022 08:36:40 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2087.outbound.protection.outlook.com [40.107.223.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8FFD1208B; Mon, 18 Jul 2022 05:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TV+/+Ej+VEtEcoNDUaQtBXc2q46RE4p8y+nnRGwhKfZjbqr5db4F6gSaP7K7BZsShQyaATY6oGrR45PJum4SaUwHhT68YjxIGjYYcJcUz4CkSTb8rxv4LJTrxxFuZ8QjkZuA680myEH9mdaGmVNa+mdDrTdol5jW6SzP7aq4UotdSWstewUp6L72iFzggnNQpFevwgQPysL8iFI0SDOdEBg/hRcDAM+VVa6rKqpqWrk2DzMxvyv8UrCilJY3n5Ad9TsKl+c+PQC5J/0md7MqZFP0Nd4NMGaWU5KNJlRi6rJ192Fp7QalTGK9tQklrKPOGyGan+5N8bKfGhBxMzGTJw== 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=pJQI0hAmhexuLXkjWH3+ocOV3WjwbED2k1JAaTmwf4g=; b=aWoX8hjoWniO+B+w4WS4FvGwQ9kpLtEJLF7PK5lc2DEC3GO3S8v/SziSDpsBepDk08FrCRueUZdC1Tup8SpPzxFLuUk+j4N7otqgVKzlojkEkq9uzVW8VSG6wHHMXWxffTgqNpkDd05YnOa7uLkpiAWBpsg1f2FdAI+dNnK2Vv11MUfhUCoa7/oHMb+W5DMnJKJQ44tRiTNBLS5B44zy3VRLaAP1pBXia5Fc2RFUhfRt6bDT9UOloXZ6v/I0UmgZ5zB6FCF0rVRkIyWrWupHIhxB2AEgh5AJbsQSnBrkTF59wHrwGBVdmx6DyEjL5i0RsyA++7gC/jOk/R1QZ6Npew== 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=pJQI0hAmhexuLXkjWH3+ocOV3WjwbED2k1JAaTmwf4g=; b=MO93sdu/Nod9zCb5RRBjRbK9LgL2JdlYqXqRmc+07bDBFz6+Z2I6RNbb/8cinRbbURutw+FBSSqjwGqywd/uvVBtHmRnhegkZmoNJeC17KwAyrwtbKZCbIcuILfDA9zmUEk3j8vxyKNBzMDOaEzqAeAt/KhWuCJd631bXjicdr0= 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 BN9PR03MB6171.namprd03.prod.outlook.com (2603:10b6:408:100::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17; Mon, 18 Jul 2022 12:36:37 +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; Mon, 18 Jul 2022 12:36:37 +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 v3 2/2] net/cdc_ncm: Increase NTB max RX/TX values to 64kb Date: Mon, 18 Jul 2022 14:36:18 +0200 Message-Id: <20220718123618.7410-2-lukasz.spintzyk@synaptics.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220718123618.7410-1-lukasz.spintzyk@synaptics.com> References: <20220718123618.7410-1-lukasz.spintzyk@synaptics.com> X-ClientProxiedBy: BE1P281CA0019.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:15::12) 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: 503eaf02-1267-44ee-d5b6-08da68ba2845 X-MS-TrafficTypeDiagnostic: BN9PR03MB6171:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XEDKVlIQyUbMsoBgrIHvBRZh0dfg5Br9P3Xzqk7TTo3wS0JcRTYPq1g0MDuKkAS0IMvJ+72oSvJrt0ghWSXCKdpZRlFXFe8lRjUTy3y7rM119c5hFXMsfx+HCiCCYXWBLP9O0Hwd0KIH+U//5bRJP5WZQYEM4UHRUJ2sJ+G0wybK42s4fuVOmKm8wPyvacQBMgbc0Kh4Ol6dhVNt5IljHY9L2RvS2Th2zeE171vLbsxZbGlnJaH0s/xIWpLKIBMiX4jmPLIC8+5FEyJDVlZ9vgYw3Lf+8pHBTfWo1pkooAfvvifxMlSVxbqq596265uLMx8LA+dYg6Exznq7IE/MD90qYKn0DOTihnkMVZEqFWEsRoH2uHbrsLDtUiwuddYzcvVPQsnsdU6EJKskRsDATY/j0kN5a4PIH7UsRHyIEHpN/dajUJMZRjW5FZEUu8CstenLFb5uPoFaKiaf0E4gLhxqyz5nDwNDVdgbFrPQt9mJt9oeLrLnuHJpAJAyL6TzC7l4WlCuHcpqVHyKP5J+XZTVazRacd3AXawp6BgLPg2IfBxOH5yEkTlOLwCNRIR+VC4Zj+D1Tbyu59cE63vWS9RVBmv3D8sbMt6heiJVqIy3ytOiIet6PKVA/icgDQLMEGPD36vSCnusBMcxlXPOVGRkufZ+EO/OZaV4wLANcha0pIKQRvLueCS2ECES8IBF+lEn8fCyxdCPAczMEO7saHIlhUNCotaxHr5VhtvMYJooU0SgFnLIixFayjPoBKeGCCyv9zKHPZeyg+RJNGz8yfeGmU56w/HALwI5YUT5D0iLjfHdRBQOPdxx+v55sHpptI86LRbVamugSnFqN1+DuQ== 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)(366004)(376002)(39860400002)(396003)(346002)(136003)(6916009)(38350700002)(38100700002)(316002)(36756003)(66556008)(66946007)(4326008)(8676002)(66476007)(26005)(41300700001)(2906002)(6666004)(186003)(6512007)(83380400001)(86362001)(5660300002)(2616005)(966005)(6486002)(478600001)(8936002)(107886003)(6506007)(52116002)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?6D5h0lyv4h7kVP8ehrUntySOxzTd?= =?utf-8?q?uqP1yPaCItXm0FxqTVlYoZ/wVUIaYoRvbVcT7OSvGwdyfttnLbKuEfbB0PxBGEYRb?= =?utf-8?q?8xbnhS7igIqTMqjv2itKl6XZ3vIMDRt0zPU4QNxVI+znSAAJxz/ogeU1FPOBfTsgO?= =?utf-8?q?Ydxqvqx96XhdA3izvSIQ23nHyJibvmVQus9Yf7y9BTElLSFfe2zIq7iz0HPNVWIxJ?= =?utf-8?q?4i1sYKjM4GVZSobSIOdqwoImnl2sVXWectIBcu2e9mxs3ZKIYWA3P0BGnyPtzw7ha?= =?utf-8?q?WIEongFperSDOpzgrr4+GRv1bZ0sVrTmxAZfjFQ/S/v786EbWFqqnXn4nt2pS5ag/?= =?utf-8?q?WffULkgOl6c4cYaV1yzpTum7+Rr3ZJCw2tSCM+GFK8tkK5+gGc/tR4ZEayg4koh0N?= =?utf-8?q?xT/oqpuXKfniFrdwFBfG5x4UzGqZy/xiJvl6tTu2xElik3JjND8IYBGSxObVjfMhU?= =?utf-8?q?mfkyo+u26PI8EBVzn4gIPPC/llgcaMp5EGz/ZwIk3QL/OPJSKl+Pi25JKwOptSmnE?= =?utf-8?q?7s7jMs5nw+JUvqZOqOZ/8J+tnt/BD49oHryb4pfrQH+w34WqwMAEBcieilHVm1Wt9?= =?utf-8?q?V7XowsnDOp1JEKxzKmhPcg+2DkX25UJsZ0Qk6K9gkzogo8Vt9nOShHFSa3b8b6W7N?= =?utf-8?q?SPcz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ptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 503eaf02-1267-44ee-d5b6-08da68ba2845 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6533.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2022 12:36:37.6623 (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: +Wht0JAiiGQBybE5g1rjb7ESF9VXhlN4Z0zQALn0aE1sym6bzwZvfMiHeZmVElOfdqoPW/AoYjalt41nzU4scw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR03MB6171 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 --- v3: No new changes to v2 2/2. It is just rebase on top of changed v3 1/2 patch 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 */