From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938953AbcKOHHU (ORCPT ); Tue, 15 Nov 2016 02:07:20 -0500 Received: from mail-by2nam03on0044.outbound.protection.outlook.com ([104.47.42.44]:22202 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751225AbcKOHHS (ORCPT ); Tue, 15 Nov 2016 02:07:18 -0500 X-Greylist: delayed 77680 seconds by postgrey-1.27 at vger.kernel.org; Tue, 15 Nov 2016 02:07:17 EST From: Rafal Ozieblo To: David Miller CC: "nicolas.ferre@atmel.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH net-next v5] cadence: Add LSO support. Thread-Topic: [PATCH net-next v5] cadence: Add LSO support. Thread-Index: AdI+VA3dTNhvIml5RKexccZvT8MvawASMKQAABvyrSA= Date: Tue, 15 Nov 2016 07:07:14 +0000 Message-ID: References: <20161114.123038.1075174354580074536.davem@davemloft.net> In-Reply-To: <20161114.123038.1075174354580074536.davem@davemloft.net> Accept-Language: pl-PL, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rafalo@cadence.com; x-originating-ip: [213.131.238.28] x-microsoft-exchange-diagnostics: 1;BN3PR07MB2513;7:7N1L0qHZARxi83EcD/ictyQOnDHLDaf/Ol4uWgviqu9GzatwQYxP3I6ZteMF1RZ+VUlR9AADABH9282VQV+cvepIgM5EUwnZkcNfoMdOdpAKz1YVIiHrbaxHuFQ9qIAKIvxEGfHig1eIGPen63tUVb2K2ySBePUCqZ+Bt1dS74hfOn4fz7npx/vXq8BNYby1utdNRgoOXdGusHGaIDjjxAbz0EINo1Q1HQ8+CzUMhWGp3rZVH+hpkgwD0ddcSjAaIuB9bLR+Na84T5mx4e/Xd3vuNIAP2Fqsrz/nnN083DrIfFZohD8WH3pmvdA5RBRBV7k81W5y7K5tGtRXUAeDLD4UwKM+sePYQnj7v0yxLE0=;20:KcfokHi0kfqYbkC73YeU0pJ56cPjSvI6qXlOVxBUzSvyOCXzQJ7Lln0y4V81k0IXxsoz/97ZmhZNRoVX+FTCXVR1YSWRz19gHsdy0/THskqZF9qkP5usyNwfbXks3TV2vKZFgGcgIS0sc0w3qJuYaexZDy4Q29nQvSGQZgTrQScmIO9tMWp6khbSiFi9Bwck1mh3XYIyM55UrLI4xhSyBs/8tozjUkixTu5krftSSfpx0iU/DECCefDcKqOFq4xB x-ms-office365-filtering-correlation-id: 33e721f4-425e-4b08-5ebc-08d40d26075c x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:BN3PR07MB2513; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6060326)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6061324);SRVR:BN3PR07MB2513;BCL:0;PCL:0;RULEID:;SRVR:BN3PR07MB2513; x-forefront-prvs: 012792EC17 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(7916002)(189002)(199003)(36092001)(5660300001)(7696004)(3846002)(189998001)(6116002)(6916009)(110136003)(2950100002)(3660700001)(77096005)(74316002)(102836003)(87936001)(81156014)(66066001)(7736002)(86362001)(97736004)(305945005)(81166006)(122556002)(68736007)(33656002)(76576001)(50986999)(7846002)(229853002)(101416001)(9686002)(2900100001)(8936002)(3280700002)(76176999)(4326007)(2906002)(54356999)(8676002)(92566002)(106356001)(99286002)(105586002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR07MB2513;H:BN3PR07MB2516.namprd07.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Nov 2016 07:07:14.7603 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2513 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id uAF77Uco025568 > > > If UFO is in use it should not silently disable UDP checksums. > > > > > > If you cannot support UFO with proper checksumming, then you cannot enable support for that feature. > > > > According Cadence Gigabit Ethernet MAC documentation: > > > > "Hardware will not calculate the UDP checksum or modify the UDP > > checksum field. Therefore software must set a value of zero in the > > checksum field in the UDP header (in the first payload buffer) to indicate to the receiver that the UDP datagram does not include a checksum." > > > > It is hardware requirement. > > I do not doubt that it is a hardware restriction. > > But I am saying that you cannot enable this feature under Linux if this is how it operates on your hardware. Would it be good to enable UFO conditionally with some internal define? Ex.: +#ifdef MACB_ENABLE_UFO +#define MACB_NETIF_LSO (NETIF_F_TSO | NETIF_F_UFO) +#else +#define MACB_NETIF_LSO (NETIF_F_TSO) +#endif I could add precise comment here that ufo is possible only without checksum. Or maybe I could enable it from module_params or device-tree (like: drivers/net/ethernet/neterion/s2io.c).