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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XZ?= =?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),