From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B2DB2741A0 for ; Wed, 22 Apr 2026 06:32:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776839549; cv=none; b=ngCZleDihnRvwVA1eHYhFmnZ43s5Q06xe4QLcSSVzRgr3/4t9bDrskkwnOh6wz7HVRwa9uVCTP37r2RWfGkUje1ncWxTl63FFQjUCtobe3qvBLDCEakgkLfgxzNmsBhS4RK+bOxTrLpBrUY6CRX3IB4fq1VR1j7H8mQIe3V5/Vo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776839549; c=relaxed/simple; bh=3iOyTR/MublZ4bNRrzWq8mXLj6V5hKH98v5xaj+esQU=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=goxgJ0gbr9OO/hsen3L2VMuQ1vPjt4WhgDjdEpvgFyi5sj2ksn3mWpxq5xq7BHvfFqGrYu/Dc1HJB3EsgBBnNQoT+uk/Q/WDO/ss/ZpemxAJNVbnxGpyq25TkO2jjvqYd0TWzHQfiUkM+vfh7JHQHkcMKFH8jk+LunqpIb5USIc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ssiSkdJW; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ssiSkdJW" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-38ccde812ecso48392941fa.0 for ; Tue, 21 Apr 2026 23:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776839546; x=1777444346; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=TOqXVDelbvAoyd3d9KoHbGtT5EJ76+AAF0dA5yLn2vs=; b=ssiSkdJWd8FTpc1w8Ura0zfdrpqCNUWwcfXODSRoyUoJ4FUOjtTB8yEXQRyRgvv4KJ Ev00SGCTEb/ZfprnFZENhv+flGpPds049/SZlP8sEvQHejvAWyZutfnJ1NEkP09+Ope4 /YDF9enkPywt4qD3dPYyEMh1c2MZgf06oMtGI3LDokXrI8FNRIDDwVnmXHRtholDBrkB /AfJ2XIyOc7eZ8Hy5F6826vqIh2lQcfYvawXCreuvY8aUNK5PaPZknJzkmsLNSyKNhc1 T9l98iA6H1F7lFsT9wBjhAbJiBXa0rE1ezf2J6GApL/WcBmuYoTR8EmH8GoiM9Jt+4cq QKUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776839546; x=1777444346; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=TOqXVDelbvAoyd3d9KoHbGtT5EJ76+AAF0dA5yLn2vs=; b=TN0YJC/izIuhiG+Vswzd14KX7ayjCDZrCGj2c/3elOve5S4QkGOC1XL2ZG0XhOe6S2 6NdFj3yh5jzNBpYvvRzpDaxnR1VzojLTAIUdafYr9edGNKYIjtOKW5jG7syG2fC8lAGm g4wskJTsnfGptVnSzwwKdqiEIEpN2qEs6J/dmL5tvflDz/D7q7lHJ4d4B3xwEZwor87L oWrFidUa+Rupk98bLhkGhQiuascw9bBDJPiKhzeVR5ou611DHDCGGSnLgTCK1GzJOlIR pLulsIBcfpVdHx/zsSW4e4ZXzInaMZG0vCwogm/rSK2wnTvZybvodQICNb/Jh1VGqmSO SqtQ== X-Forwarded-Encrypted: i=1; AFNElJ+Mn5oBdJlj6xIZc/XO73IESFbl6z9fB1u8Ya/n66SJMkz3pABOL+umBBamSca0kpHdS9owOvIsMAEEdgY=@vger.kernel.org X-Gm-Message-State: AOJu0YzFSFl/9kNpzUT9g6Ul+fO8Y0UhK8qnvdT6jxqEmtdzvaEklAD4 E8Xwa99mXKWkLAoflxaPm7WliGO3F5o9ZcE3KV4bQgpzYqI5nWziGGd1ASEY3Q== X-Gm-Gg: AeBDietX1e1lSFu9ysKg4zagwwCNlowYOsPmlBhc4ev++mMVe2anNctOpQuccI5cxid i0wZgx3FhRYQNSdDyVcvSg6g8G2f+gM9O54BAQr+ie+FlNBzUAW8Uc346/XHPUiKjMFdjAJ6T5g 4BK2eFzEZXp92TA1SMYAnSfqKiuYYR0d/FRuqei7+cQt9KBXTHm4CWfKUI7R4NdLoE+UZhS8LY7 fjjgnzH6yqZEpDyUMY3I/5NBRP6oNYIoCwEX6Zgz4eKB3zxVUs4S7s5wwCwBQBSpIoachgCv/IG ydDk9GRyhRbSGfkKysN5/w/gX1OOCT2x4LMfepZBsrosvaXS9JXvpdTmAcMipOHIaG7hEFZ27RY E0aXOt+92DqtpAfo2BdYYysiStPqEo5hWA50biwpXt4kMnOaoHtQG7nH6NcmFUt3AupwhJz7IPm LgYiIkCKd5odsMiUgEg5aleOMYv+CPOb3VvraTXYI1l9U= X-Received: by 2002:a2e:a494:0:b0:38c:c0de:d58f with SMTP id 38308e7fff4ca-38ec949347cmr49949991fa.14.1776839546202; Tue, 21 Apr 2026 23:32:26 -0700 (PDT) Received: from foxbook (bfh75.neoplus.adsl.tpnet.pl. [83.28.45.75]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-38ecb5f65absm33791991fa.11.2026.04.21.23.32.25 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 21 Apr 2026 23:32:25 -0700 (PDT) Date: Wed, 22 Apr 2026 08:32:21 +0200 From: Michal Pecio To: "Xuetao (kirin)" Cc: , , , , Subject: Re: [PATCH] usb: core: Fix bandwidth for devices with invalid wBytesPerInterval Message-ID: <20260422083221.5b5e4a48.michal.pecio@gmail.com> In-Reply-To: <20260403091621.5a685d6e.michal.pecio@gmail.com> References: <20260402021400.28853-1-xuetao09@huawei.com> <20260402114421.738e375a.michal.pecio@gmail.com> <85ad518a-f87f-4ca6-a11c-1ccc37d60bd1@huawei.com> <20260403091621.5a685d6e.michal.pecio@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 3 Apr 2026 09:16:21 +0200, Michal Pecio wrote: > On Thu, 2 Apr 2026 19:55:16 +0800, Xuetao (kirin) wrote: > > > Any other examples besides AX88179? > > > > We tested 18 different USB 3.0 docks, but they only contained two > > different types of USB 3.0 Ethernet devices based on VID/PID. > > The dwc3 controller works fine with all of the devices mentioned > > above. The other USB host controller works fine with all 12 Realtek > > devices, but fails with all 6 ASIX devices. I think this issue hasn't been solved yet? > > 1. Realtek USB 10/100/1000 LAN (12 devices) > > All 12 devices share the same VID/PID and descriptor values. > > > > VID = 0x0BDA, PID = 0x8153 > > wMaxPacketSize = 0x10 > > bMaxBurst = 0 > > wBytesPerInterval = 0x8 > > My RTL8153 has this endpoint for its default proprietary configuration: > > bEndpointAddress 0x83 EP 3 IN > bmAttributes 3 > Transfer Type Interrupt > Synch Type None > Usage Type Data > wMaxPacketSize 0x0002 1x 2 bytes > bInterval 8 > bMaxBurst 0 > wBytesPerInterval 2 > > which should be problem-free, and this for its CDC configuration: > > bEndpointAddress 0x83 EP 3 IN > bmAttributes 3 > Transfer Type Interrupt > Synch Type None > Usage Type Data > wMaxPacketSize 0x0010 1x 16 bytes > bInterval 8 > bMaxBurst 0 > wBytesPerInterval 8 > > The CDC configuration needs to be enabled with a patch, I'm not sure > if there is any other way. It will then use the r8153_ecm driver. I have done some experimentation with RTL8153 CDC configuration and found that it responds with 8 and 16 byte packets alternately: # modprobe usbmon # cat /sys/kernel/debug/usb/usbmon/0u # ifconfig eth1 up [...] ffff88812bcc1600 364545038 S Ii:11:007:3 -115:128 16 < ffff88812bcc1600 364577011 C Ii:11:007:3 0:128 8 = a1000000 01000000 ffff88812bcc1600 364577037 S Ii:11:007:3 -115:128 16 < ffff88812bcc1600 364608979 C Ii:11:007:3 0:128 16 = a12a0000 01000800 00000000 00000000 I'm curious how your HC would treat this, because technically it should interpret the first packet of wBytesPerInterval size as a partial transfer and continue the same URB in the next interval, then complete it with babble due to 16B packet exceeding both wBPI and URB capacity. Other HCs work like that if I do the opposite and reduce wMaxPacketSize to match wBytesPerInterval. We would need to perform this alternative fixup for devices where wBytesPerInterval is correct and 16B transfers are sent as two 8B packets oven two intervals, while wMaxPacketSize is more than wBPI. I hope no such insane devices exist. Currently, they wouldn't work on the vast majority of HCs. > > 2. ASIX AX88179 USB 3.0 to Gigabit Ethernet Adapter (6 devices) > > All 6 devices share the same VID/PID. > > > > VID = 0x0B95, PID = 0x1790 > > (a) 4 devices: > > wMaxPacketSize = 0x10 > > bMaxBurst = 0 > > wBytesPerInterval = 0x0 > > This looks like my AX88179 and it's obviously broken. > > > (b) 2 devices: > > wMaxPacketSize = 0x10 > > bMaxBurst = 0 > > wBytesPerInterval = 0x8 > > But this is odd. When I use mine, I see that the driver submits 8 byte > URBs and they complete successfully with 8 bytes received, no babble. My driver submits 8B URBs because my AX88179 has wMaxPacketSize of 8. On your device usbnet would submit 16B URBs. So I'm curious, how much does your AX88179 send in response to those URBs? Regards, Michal