From patchwork Mon Nov 26 09:33:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Russkikh X-Patchwork-Id: 10697889 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 54FF616B1 for ; Mon, 26 Nov 2018 09:33:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C476B285DA for ; Mon, 26 Nov 2018 09:33:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4A30286AC; Mon, 26 Nov 2018 09:33:32 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 4F94329818 for ; Mon, 26 Nov 2018 09:33:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726458AbeKZU1D (ORCPT ); Mon, 26 Nov 2018 15:27:03 -0500 Received: from mail-eopbgr710077.outbound.protection.outlook.com ([40.107.71.77]:42622 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726279AbeKZU1C (ORCPT ); Mon, 26 Nov 2018 15:27:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/NBRsgV1UZ9yOyDzFCHI/FrZrUNA0g3BjMcL6IohHKI=; b=UD2PZHwX9IBEajUWp48TURA8ydj24fSUqaiP6gXK/GwSwP9ZzUwtiSs6ujkvxYD3hglE6DfSkqowvxYVYQt2c2T5gt7CfSZiuw8riCuKSKg/TG/BFj5NHbu1riT5/zhSdR5cjAXCgzLy5M4PgdWWvtlEte8dNn6vQek3A6iS9Zw= Received: from BY1PR0701MB1660.namprd07.prod.outlook.com (10.162.110.22) by BY1PR0701MB1894.namprd07.prod.outlook.com (10.162.143.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.18; Mon, 26 Nov 2018 09:33:28 +0000 Received: from BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::f8ee:2260:e410:fffd]) by BY1PR0701MB1660.namprd07.prod.outlook.com ([fe80::f8ee:2260:e410:fffd%3]) with mapi id 15.20.1361.019; Mon, 26 Nov 2018 09:33:28 +0000 From: Igor Russkikh To: "linux-usb@vger.kernel.org" , "davem@davemloft.net" , "netdev@vger.kernel.org" CC: "andrew@lunn.ch" , Dmitry Bezrukov , Igor Russkikh Subject: [PATCH v4 net-next 13/21] net: usb: aqc111: Add support for TSO Thread-Topic: [PATCH v4 net-next 13/21] net: usb: aqc111: Add support for TSO Thread-Index: AQHUhWsWW4Fft1GGd0+H/ENJhq53Qw== Date: Mon, 26 Nov 2018 09:33:28 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR03CA0024.eurprd03.prod.outlook.com (2603:10a6:20b::37) To BY1PR0701MB1660.namprd07.prod.outlook.com (2a01:111:e400:522a::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [95.79.108.179] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR0701MB1894;6:7INfbMmHwaIELJadsZr4vjOh4ukOLuZCRLe5IPnRKLZ3ziy997gTucqA4yxQN2llKHE77hf6akCDj/RyXN9hH5O9TD4l/lgKtYAKk8TzMKntXsukvEDu+DNIQEtCqsa1jrCeGz6M2+IkHGbRRFQholPfXBaqgKklFcV1QXcbNYyjhZxxmOriSMJpu4Ape1ZS0RkBSJz9k++cOKMLK5TapHw+mxLiDaVPUWxHg+RxxnHfhwbCenJyRr8kLNf5PyvLcdVfR432x88Y4/2RInDK0i3Ymo4UFBJz7Qkau/djj5lXqzBtlCjo9dZMiQzp00SPY74JSlqpR08GbgW2LYFLOfjw3wE4yfci2q6uq7dnLQf3rlsq28cCnBc9FaergpzbVkyLkVQSF59xMBGE2P2v5s3wF+6KBVSv7BWnQZvGtMMDP9QuYUs0Qbv97NAKLtyTeo+AHeQ8hSPlWhIsBz5NKA==;5:drh1gVxbHxZgwprBi9iDR6H/7seT8Cf+05yuVizBG2rgTcR4RFKCVXdiPti0j9e/o0ZBxkoD1JYWClcquG9Ph3IoQdWcnV6hIy60TZKgtFgw3tQIL2Yd695K+VsxTyIuueWHa1D9u6sxznpy2lzIg4iymhuR/WLovL5IQbFckf0=;7:ImlKcGlhe8L2K63tX3TyR/wthbAUGLI+OCDhnZ++dD07gf9gdCqCcWCQIiiVEJxJXV5sW5U39TwiGh7MylGy908R3XKpoTQYGZwkkuF/IEd1+73uuRUwihxzUUlXbQ8KANP98rh4XYOD71I0+OiFgA== x-ms-office365-filtering-correlation-id: f7485319-6a84-4ce7-363e-08d6538238c9 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BY1PR0701MB1894; x-ms-traffictypediagnostic: BY1PR0701MB1894: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(3231443)(944501410)(52105112)(10201501046)(93006095)(93001095)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:BY1PR0701MB1894;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1894; x-forefront-prvs: 086831DFB4 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39840400004)(376002)(396003)(136003)(366004)(346002)(199004)(189003)(14454004)(102836004)(97736004)(71200400001)(71190400001)(54906003)(6436002)(72206003)(105586002)(110136005)(11346002)(446003)(186003)(486006)(25786009)(2906002)(7736002)(575784001)(86362001)(5660300001)(316002)(305945005)(2201001)(2501003)(53936002)(99286004)(36756003)(52116002)(6506007)(6116002)(76176011)(386003)(4326008)(3846002)(68736007)(6512007)(107886003)(476003)(81166006)(478600001)(118296001)(26005)(106356001)(8676002)(256004)(81156014)(2616005)(6486002)(66066001)(44832011)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:BY1PR0701MB1894;H:BY1PR0701MB1660.namprd07.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Xskb7ugDZx2lXPMHSu7Em33Wi2iSmSUMcu+bk7U9Z7JGdcca9ik8U5+uPA55M3ZVV5euF/6y1eV5YqWjJdjdm/bZA0G4wkselFE7yCKeob/N9lgZkAdTmdyy50U8dnbnPSoocUFH7bxPbTV2NvJxGIJn5jPiazawX41wY36M5b41Vxlk8sSZIC3LYxL8rme8C3fIU8rKbpLx1JbNPtdGSGYgQa3wE0MXleAO0b74+Wi3MB7LvkA7RxM++mGw+tfBbFu8o5LCEzc6y4VUDwZkN+iPFwLVyjLEYlnHxayXpvVPR/ZbE1IZrr3d5xoBKK7Fi56J889e6veCA0u9+DUDk7Qa9HEGYgcPVxcHMB0nmiA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f7485319-6a84-4ce7-363e-08d6538238c9 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Nov 2018 09:33:28.7599 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1894 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Dmitry Bezrukov Signed-off-by: Dmitry Bezrukov Signed-off-by: Igor Russkikh --- drivers/net/usb/aqc111.c | 6 ++++++ drivers/net/usb/aqc111.h | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index 7b69d0a5fc4c..fce2a4f65122 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c @@ -395,6 +395,8 @@ static int aqc111_bind(struct usbnet *dev, struct usb_interface *intf) dev->net->hw_features |= AQ_SUPPORT_HW_FEATURE; dev->net->features |= AQ_SUPPORT_FEATURE; + netif_set_gso_max_size(dev->net, 65535); + aqc111_read_fw_version(dev, aqc111_data); aqc111_data->autoneg = AUTONEG_ENABLE; aqc111_data->advertised_speed = (usb_speed == USB_SPEED_SUPER) ? @@ -832,6 +834,10 @@ static struct sk_buff *aqc111_tx_fixup(struct usbnet *dev, struct sk_buff *skb, /*Length of actual data*/ tx_desc |= skb->len & AQ_TX_DESC_LEN_MASK; + /* TSO MSS */ + tx_desc |= ((u64)(skb_shinfo(skb)->gso_size & AQ_TX_DESC_MSS_MASK)) << + AQ_TX_DESC_MSS_SHIFT; + headroom = (skb->len + sizeof(tx_desc)) % 8; if (headroom != 0) padding_size = 8 - headroom; diff --git a/drivers/net/usb/aqc111.h b/drivers/net/usb/aqc111.h index 165cdb8b022c..a7a333914461 100644 --- a/drivers/net/usb/aqc111.h +++ b/drivers/net/usb/aqc111.h @@ -22,10 +22,12 @@ /* Feature. ********************************************/ #define AQ_SUPPORT_FEATURE (NETIF_F_SG | NETIF_F_IP_CSUM |\ - NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM) + NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |\ + NETIF_F_TSO) #define AQ_SUPPORT_HW_FEATURE (NETIF_F_SG | NETIF_F_IP_CSUM |\ - NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM) + NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |\ + NETIF_F_TSO) /* SFR Reg. ********************************************/ @@ -162,6 +164,8 @@ struct aqc111_data { /* TX Descriptor */ #define AQ_TX_DESC_LEN_MASK 0x1FFFFF #define AQ_TX_DESC_DROP_PADD BIT(28) +#define AQ_TX_DESC_MSS_MASK 0x7FFF +#define AQ_TX_DESC_MSS_SHIFT 0x20 #define AQ_RX_HW_PAD 0x02