Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752369AbdI2JOd convert rfc822-to-8bit (ORCPT ); Fri, 29 Sep 2017 05:14:33 -0400 Received: from smtp-out6.electric.net ([192.162.217.192]:50247 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752065AbdI2JOa (ORCPT ); Fri, 29 Sep 2017 05:14:30 -0400 From: David Laight To: "'Andrew Lunn'" , "Tristram.Ha@microchip.com" CC: "muvarov@gmail.com" , "pavel@ucw.cz" , "nathan.leigh.conrad@gmail.com" , "vivien.didelot@savoirfairelinux.com" , "f.fainelli@gmail.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Woojung.Huh@microchip.com" Subject: RE: [PATCH RFC 3/5] Add KSZ8795 switch driver Thread-Topic: [PATCH RFC 3/5] Add KSZ8795 switch driver Thread-Index: AQHTOJDPlP6ChEAuCUy7qr2HuLws76LLlACA Date: Fri, 29 Sep 2017 09:14:26 +0000 Message-ID: <063D6719AE5E284EB5DD2968C1650D6DD0084EDC@AcuExch.aculab.com> References: <93AF473E2DA327428DE3D46B72B1E9FD41121A87@CHN-SV-EXMX02.mchp-main.com> <20170907223625.GW11248@lunn.ch> <93AF473E2DA327428DE3D46B72B1E9FD41124D5A@CHN-SV-EXMX02.mchp-main.com> <20170928193416.GH14940@lunn.ch> In-Reply-To: <20170928193416.GH14940@lunn.ch> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuExch.aculab.com X-TLS: TLSv1:AES128-SHA:128 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 699 Lines: 21 From: Andrew Lunn > Sent: 28 September 2017 20:34 ... > > There are 34 counters. In normal case using generic bus I/O or PCI to read them > > is very quick, but the switch is mostly accessed using SPI, or even I2C. As the SPI > > access is very slow. > > How slow is it? The Marvell switches all use MDIO. It is probably a > bit faster than I2C, but it is a lot slower than MMIO or PCI. > > ethtool -S lan0 takes about 25ms. Is the SPI access software bit-banged? Doing that with software delays isn't friendly to the rest of the system. (Hardware guys please note...) One possibility is to rate-limit the stats reading. Then an application cannot completely 'hog' the SPI bandwidth. David