Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753985AbdLDQGU (ORCPT ); Mon, 4 Dec 2017 11:06:20 -0500 Received: from mail-eopbgr10058.outbound.protection.outlook.com ([40.107.1.58]:53792 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753940AbdLDQGM (ORCPT ); Mon, 4 Dec 2017 11:06:12 -0500 From: Claudiu Manoil To: Zumeng Chen , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "davem@davemloft.net" Subject: RE: [PATCH 1/1] gianfar: fix a flooded alignment reports because of padding issue. Thread-Topic: [PATCH 1/1] gianfar: fix a flooded alignment reports because of padding issue. Thread-Index: AQHTbK3JlkX1F5k68EKvMuES9+QQnKMzTx6A Date: Mon, 4 Dec 2017 16:06:09 +0000 Message-ID: References: <1512357722-12124-1-git-send-email-zumeng.chen@gmail.com> In-Reply-To: <1512357722-12124-1-git-send-email-zumeng.chen@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=claudiu.manoil@nxp.com; x-originating-ip: [86.34.165.90] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM5PR0401MB2564;6:APfBmfZQbkOTBiFmdflBYZq2xFuAoetFp46vWREWH5i9DYgQYmKVnl98Uj3itdHFU/cOcsJ/ET0YkfxMHW2L4A6nVycChBE5aO61bfhj86RsPdyU9kXh5YsjzUaE8/FudrO8rNjE5AaqkBZomj5fik8v97/ac7Qi5PvNsiRy2POaQLeB3g9tA9J9r3ED07aZuJb1lve4eb0FAYxxutZoNqh1VUsnMOZAwC+yOl1RCv2/qZvUH2C4HBzsaD7nYjrIbiFFoLZaYO0Y532gGxJXfP+VF2fuCUMR+FY2eV6OEsbt21mJedxLnyiv2iM1ZtqeIt3VrRBYOAiFtvuN03CTtIT6ueyWz9CgnXnaoJXrmY0=;5:VArekQprRNy5GSM6nhOT/1hcT5tpZwOhhOPNBHYnYn+7FE37KgHphxNs/wEbPaNgFE7lS2kgJCPyigJn2K4lJbNiVm8SKBjPx8ZxvtYAGdbX705tCxOwCM0MlAhKWGjt0trOOn1GiyatqxeF9VNuCZEkdK4fYqGVEdNp+v398Ss=;24:THTIS6rXnOUFuaU4FrzrIJVUXzJ05cf3thMq/p6o5ijnIGh7DaGar+C4/lSDs9m7CfH+wtqeUAF54Pu9CYsWdx4TpicYEbR3Rt04CamJw1Y=;7:wUGFHIcI86WCo+UgEEwd++vdzCs98CcGzavNLH1eIfMuoqR+R54NSTqqqsw8LFFrEs1KkcA77zL0N0FkgA5q+VStZHdJj8f4pIZ6G3iBK/eMRAo295LxG2gl0NIoE7+wXIfEnRM/vd6AoSfPzxDZVPEVJG18C1SoVKBY9zv7Ae1y0792NVDXx+xatvM5PSfqTiXgR4N9ufxejaYVu9JGTeUyZEI3gd7J5cub44bAwAcfJcBK81yqwJ7InXPQcHpW x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 2fee7dcc-5f42-42e1-ab15-08d53b30ef37 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603286);SRVR:AM5PR0401MB2564; x-ms-traffictypediagnostic: AM5PR0401MB2564: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(20558992708506)(9452136761055)(185117386973197); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(3231022)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123564025)(20161123555025)(6072148)(201708071742011);SRVR:AM5PR0401MB2564;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:AM5PR0401MB2564; x-forefront-prvs: 051158ECBB x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(376002)(346002)(366004)(39860400002)(13464003)(199003)(189002)(86362001)(8936002)(305945005)(81156014)(106356001)(2201001)(2906002)(2950100002)(97736004)(3660700001)(14454004)(66066001)(478600001)(3280700002)(2501003)(8676002)(101416001)(81166006)(99286004)(5660300001)(53936002)(25786009)(54356011)(102836003)(4326008)(74316002)(7696005)(39060400002)(189998001)(229853002)(9686003)(7736002)(3846002)(5250100002)(6436002)(6506006)(76176011)(105586002)(110136005)(55016002)(316002)(68736007)(2900100001)(6116002)(6246003)(33656002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0401MB2564;H:AM5PR0401MB2561.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fee7dcc-5f42-42e1-ab15-08d53b30ef37 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Dec 2017 16:06:09.9727 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0401MB2564 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 nfs id vB4G6ieN022126 Content-Length: 2471 Lines: 72 >-----Original Message----- >From: Zumeng Chen [mailto:zumeng.chen@gmail.com] >Sent: Monday, December 04, 2017 5:22 AM >To: netdev@vger.kernel.org; linux-kernel@vger.kernel.org >Cc: Claudiu Manoil ; davem@davemloft.net >Subject: [PATCH 1/1] gianfar: fix a flooded alignment reports because of padding >issue. > >According to LS1021A RM, the value of PAL can be set so that the start of the >IP header in the receive data buffer is aligned to a 32-bit boundary. Normally, >setting PAL = 2 provides minimal padding to ensure such alignment of the IP >header. > >However every incoming packet's 8-byte time stamp will be inserted into the >packet data buffer as padding alignment bytes when hardware time stamping is >enabled. > >So we set the padding 8+2 here to avoid the flooded alignment faults: > >root@128:~# cat /proc/cpu/alignment >User: 0 >System: 17539 (inet_gro_receive+0x114/0x2c0) >Skipped: 0 >Half: 0 >Word: 0 >DWord: 0 >Multi: 17539 >User faults: 2 (fixup) > [...] > > drivers/net/ethernet/freescale/gianfar.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/drivers/net/ethernet/freescale/gianfar.c >b/drivers/net/ethernet/freescale/gianfar.c >index e616b71..e47945f 100644 >--- a/drivers/net/ethernet/freescale/gianfar.c >+++ b/drivers/net/ethernet/freescale/gianfar.c >@@ -1413,9 +1413,11 @@ static int gfar_probe(struct platform_device *ofdev) > > gfar_init_addr_hash_table(priv); > >- /* Insert receive time stamps into padding alignment bytes */ >+ /* Insert receive time stamps into padding alignment bytes, and >+ * plus 2 bytes padding to ensure the cpu alignment. >+ */ > if (priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER) >- priv->padding = 8; >+ priv->padding = 8 + DEFAULT_PADDING; > > if (dev->features & NETIF_F_IP_CSUM || > priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER) >-- >2.5.0 Why handle only the rx timestamp path (HAS_TIMER) when the issue, as presented by you, should be applicable to the default path as well? The code change according to the patch description should be more likely: + priv->padding = DEFAULT_PADDING; /* Insert receive time stamps into padding alignment bytes */ if (priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER) - priv->padding = 8; + priv->padding += 8; Do you have any performance numbers for this change? Thanks, Claudiu