From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com ([134.134.136.31]:34712 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750980AbcKGMh1 (ORCPT ); Mon, 7 Nov 2016 07:37:27 -0500 From: Felipe Balbi To: Peter Chen Cc: David Miller , Andy Duan , linux-usb@vger.kernel.org, ville.syrjala@linux.intel.com, stable@vger.kernel.org Subject: Re: [PATCH] usb: gadget: u_ether: remove interrupt throttling In-Reply-To: <20161104021126.GD17925@b29397-desktop> References: <20161101112959.19640-1-felipe.balbi@linux.intel.com> <20161102060202.GD28525@b29397-desktop> <20161102.112254.1243059410485662386.davem@davemloft.net> <20161103002300.GA894@b29397-desktop> <87wpglqc15.fsf@linux.intel.com> <20161103090310.GC894@b29397-desktop> <20161103095356.GG894@b29397-desktop> <87ins4n8k7.fsf@linux.intel.com> <20161104021126.GD17925@b29397-desktop> Date: Mon, 07 Nov 2016 14:36:51 +0200 Message-ID: <87a8dbjwkc.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: stable-owner@vger.kernel.org List-ID: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Peter Chen writes: >> Peter Chen writes: >> >> > Peter Chen writes: >> >> > > On Wed, Nov 02, 2016 at 11:22:54AM -0400, David Miller wrote: >> >> > >> From: Peter Chen >> >> > >> Date: Wed, 2 Nov 2016 14:02:02 +0800 >> >> > >>=20 >> >> > >> > Felipe, it may increase cpu utilization since more interrupts = will be there, >> >> > >> > it may affect the SoC which has lower cpu frequency. This code= existed >> >> > >> > many years, why this problem has only reported at dwc3 recentl= y? >> >> > >>=20 >> >> > >> It's a bug, and it's going to cause TCP sockets to potentially h= ang. >> >> > >>=20 >> >> > > >> >> > > For some controllers, it is, so we need to add parameter for user >> >> > > to see if interrupt migration is supported or not. >> >> >=20 >> >> > not for some controller, for ALL networking drivers. >> >> >=20 >> >> > > But just like some ethernet controllers, some USB controllers sup= port >> >> > > hardware timeout mechanism which interrupt will be triggered after >> >> > > some uFrame occurs if the transaction has completed but not requi= red >> >> > > to interrupt, it is used to support interrupt migration like ethe= rnet. >> >> >=20 >> >> > you're missing the point. What Dave Miller is saying is that it's A= LWAYS >> >> > a bug to delay completion of SKBs. The only thing you're doing with >> >> > chipidea is delaying interrupt by up to 125us; which is still a bug= from >> >> > the point of view of the networking layer, but it's more difficult = to >> >> > perceive any problems because of the short time where interrupt is >> >> > delayed. >> >> >=20 >> >>=20 >> >> If it is ALWAYS a bug to delay completion of SKBs, how the local >> >> ethernet driver designs interrupt migration? >> >>=20 >> > >> > Just a quick test, I delete dev_kfree_skb_any at tx_complete, not find >> > any problems by using simple "ping test", just free memory is less and >> > less. David, do you really mean free tx skb buffer with limited time, >> > but not return NETDEV_TX_OK by ->ndo_start_xmit with limited time? >>=20 >> ping *will* work just fine. One easy test to *see* the problem is to SSH >> to a machine using g_ether, then run: >>=20 >> $ while true; do dmesg; done >>=20 >> you will notice it is rather laggy. Now remove throttling and the lags >> are gone. >>=20 > > I have ran the test using ncm, the qmult is 10, but not find the laggy=20 > at the screen, just the pipe will be broken after several minutes. the reason you don't see it is because of your forced per-uFrame interrupt. If you remove that, then you're likely going to have issues. Also, the fact that we're running Super-speed while you're running High-speed can also change things. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYIHVjAAoJEMy+uJnhGpkGaBUQAMLkFZH0Hv5DMSE55vnJdJzw hS6aoH/sxU4cesJP22/wzChneR2S9/eUZahpmwh5z9w7tEVgS7w+WRV31kby9vCw MkQYBEb/EVv7SN8DxWVIVUMguR/QtvDSdCuKrrnBNgpNbUVIM0oRq7yFzWgeC1pT jEuMIalKgQH8A0eJ1zoY50d4T0StueFxjX9SagDYq8DNDeXl7XHGCa9lt+0MebZb SeKtKRdMlbAd9FA4SoCv7kj7hNZrd/1UKkYyG3l/yrq5jsf6P9K7dC5Xr4a2QHDa QFF6OhhHe4AkCzi9PGNnQp/JeANlg6rN5/8yRwJXZgYlW0PuGiclG3OCVDm1y+yx 9Ix2gdywwNQzxmB7IL09GgGtQZ13LdanyYQ2nVB96F3Dgizhdrq0mIo/VSivhFGi aQORX/OcFiTNDq+M0vmL/bXd2hDSLowTK9LcXo44G2xFFG12ZsGJ2G8+PQ60TAaK f5ZUnNp+h6GPGLdXxO6flA1cCGBRHC0zB0F2OrN5stsKBLsh7yVa9aJd/3syP8/O 0hplh2jmOJeQ1qRN/RToING83Kb/rB6Nvvnr7pw2O1jLYwvs2LrRCpSRcRt9x6am K7L3dWSmJxNFmk4N0aLsfYz4eO26WISxLHTvOOgEHeo1fDblgeR83elB6XqQ/MGV CtCaf2fLm13u1egWmgDM =G8x5 -----END PGP SIGNATURE----- --=-=-=--