From nobody Fri Aug 19 14:55:36 2022 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M8PvV63kYz4ZKX8 for ; Fri, 19 Aug 2022 14:55:50 +0000 (UTC) (envelope-from harris.snyder@gmail.com) Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M8PvV1GWMz4J6N for ; Fri, 19 Aug 2022 14:55:50 +0000 (UTC) (envelope-from harris.snyder@gmail.com) Received: by mail-lf1-x133.google.com with SMTP id u9so6416826lfg.11 for ; Fri, 19 Aug 2022 07:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=a6eEkSQwE0cxin9k30CBrzO5c+5pa987tYg6uravOvA=; b=Sp5QhREpGonMAo4L0/PouFoVEeXQyMhtXT0w6Y8tYbcYcltEoIzDMkaUgUCCSuIacC UjJtqN1xhh3f63Jm1GqHfXXUf0wIGifyWUm3lR4q72p+u7KsFMVM57/pHrTxKmI7a7T9 Z96ADOLUiulO/yHx25iMrQQ8Pi4JEywubYBTp1rC6oyip+RFwvc+yBgVtUcelPyI4gJe 3ceZNTCek2UU9x03hOxGJjdJgm3y+dZKBhUfipJ/gIVGt4oHe+maqINbHwUG38VgoBK9 eyM6GsjjxW+LAO/U7BhBJNUfFQkpHyx+OP3X9srbWiDvOKFkr0mZLaL1L8GXzSHisqtd yzwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=a6eEkSQwE0cxin9k30CBrzO5c+5pa987tYg6uravOvA=; b=om4LsGUaYyu51zYBJm0FSILkElqRiAryOBxe0f4/K4lXEWe5+mNNGO1vMwAJvD2BZl IjA20T7TcO442cJ4bkovEzTYDa5ULFPeksL4VKAd2AmiSN/xgOudKtEaJqAGWF+yUV6/ ORiYcbMYWW0KoRa8nAY07FQ+mfS4sTofjD+53ZMEHDq6GafkP0LJNue+dJZ9rhP4EpUO 6m4Mqa9Pac2bSwnHDN32iA8hvbpGF2YNXa8+ebsmCWyuIAlB7co4vC437HsG2OeRFvWG eWarTMtncDP+B6rrMeJG4UYnGNES95evbYybX4G/dRPgWB+Vylqz+Edex72heO4SeNYa HDFQ== X-Gm-Message-State: ACgBeo0fDFCFu8DGB1Z+n8uTAyMQc3Cfigoy4vnirA0kPnkFOMAnsS8h LZRB4UUQWI+9G7q33CCK/CpKaAGhuViTilq2FMf+B0PwOC8= X-Google-Smtp-Source: AA6agR6v1qubPIj/mO66N8NybVwIy+hVrBz/pXJG7iBrCihZAK9HB7g4RuD9Ar4XGG8h8VncQOsKT5mLdRMTHsXrAmo= X-Received: by 2002:a05:6512:250b:b0:492:c03c:a114 with SMTP id be11-20020a056512250b00b00492c03ca114mr2470410lfb.592.1660920948403; Fri, 19 Aug 2022 07:55:48 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: <2c108a487ff68d38f448dc5e001faad2@FreeBSD.org> In-Reply-To: <2c108a487ff68d38f448dc5e001faad2@FreeBSD.org> From: Harris Snyder Date: Fri, 19 Aug 2022 10:55:36 -0400 Message-ID: Subject: Re: Strange behavior of USB PCIe add-in cards To: Daniel Engberg Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4M8PvV1GWMz4J6N X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=Sp5QhREp; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of harris.snyder@gmail.com designates 2a00:1450:4864:20::133 as permitted sender) smtp.mailfrom=harris.snyder@gmail.com X-Spamd-Result: default: False [-3.94 / 15.00]; NEURAL_HAM_LONG(-1.00)[-0.997]; NEURAL_HAM_SHORT(-0.99)[-0.995]; NEURAL_HAM_MEDIUM(-0.94)[-0.944]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::133:from]; ARC_NA(0.00)[]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Hi Daniel, Thanks very much for your reply. Re-reading my initial email, it's obviously missing some information, for which I apologize. Chiefly, - I do want to go with a PCIe card instead of a hub, because the ultimate goal is to use the card with PCIe passthrough in bhyve. - Also, I am indeed on an AMD x86_64 system (Epyc rather than Ryzen, but very likely suffers from the same issue you've mentioned) I'll definitely search the mailing list for other people's reports of this. The motherboard is a supermicro H11DSi and the CPUs are 2x Epyc 7003. There's no chipset on the motherboard in the traditional sense for desktop PCs. I have ordered a third controller (built around the Renesas uPD720202, which is also on the old side I think) based on several recommendations, so we will see if that chip fares any better. In the meantime, I will try: - Updating the firmware on both of the cards that I have (I'm willing to accept the bricking risk). - Checking the bios for PCI timer latency - Searching the mailing list for reports of usb stuttering on Ryzen systems and possible solutions. Thank you very much for all of your suggestions! Harris On Wed, Aug 17, 2022 at 1:08 PM Daniel Engberg wrote: > > On 2022-08-12 22:34, Harris Snyder wrote: > > Hello everyone, > > > > I have two USB3 PCIe cards (different chipset vendors) that are both > > exhibiting the same symptoms: > > - They are detected and attached to the xhci driver. > > - They sort of work (a usb stick seems to work for file IO) > > - When an interactive device (e.g. USB sound card, mouse, or keyboard) > > is connected, they seem to drop the overwhelming majority of input > > events. For example, the mouse moves jerkily, at intervals of several > > seconds. Most keypresses on a keyboard are missed, and occasionally a > > "key up" event seems to be missed and the same key is typed > > repeatedly. A USB sound card has stutters and hitches in the audio > > output. > > > > Does anybody recognize this behaviour or know of a solution? I have > > tried: > > - A different PCIe slot > > - Two different PCIe USB3 cards from different vendors (and different > > chipset vendors - VIA and ASMedia). One of the cards uses the VIA > > VL806, which some users on the FreeBSD forum have reported working... > > > > I'm using CURRENT, but about 2 weeks behind... > > > > Thanks, > > Harris > > Hi, > > Early USB 3 controllers were quite unstable and unreliable so unless > you're on very old hardware I'd suggest that you look for a decent USB > hub instead if you need more ports. In my experience VIA (Labs) VL817 > works very well in general, one device that uses it is ORICO MH4U-U3 or > at least used to. You might want to go for the newer VL822 controller > however finding out what chipset is used can be a bit hard but according > to the product images this one uses it for example > https://www.amazon.com/HOYOKI-Powered-Adapter-Slippter-Keyboard/dp/B098D7H5XD > . I've also used one hub based on ASMedia ASM1074 which worked fine for > my use case but the quality of the product was very questionable, this > controller doesn't seem to be very common and if you find one it's > usually a very poorly made product overall. There are other vendors too > such as Cypress, Fresco Logic, Genesys Logic etc but when I looked > they're either very rare (Cypress and Fresco Logic) or people have very > mixed experiences (Genesys Logic) however their newer ones might be > better such as GL3590. > > But if you want to give the USB PCIe cards a go the VIA one your > mentioned is very old so I would highly suggest that you try to update > the firmware. Unforunately that usually requires you to search various > forums etc to find the flashing utility and firmware. Having a quick > look this page ( https://github.com/jpmorrison/VL805 ) seems to be > relevent and the other ones it links too. Do keep in mind that you may > brick your card if you flash using wrong firmware or if it process hangs > for whatever reason. This is also true for your ASMedia card, some > controllers even include "easter eggs". See > https://github.com/smx-smx/ASMTool , > https://github.com/cyrozap/asmedia-xhc-re for more information. In some > BIOSes you have a toggle for "PCI Timer Latency" option, usually you > want to keep this at 32 or 64 which usually is the default may also be a > cause. > > Regarding your peripherals, are they known to be working and/or have > your tried using the motherboard chipset controller instead? There are > also reports of stuttering using Ryzen systems which may be what you're > using (search the mailing lists for more information). > > Providing what hardware (mainboard, cpu) are you using and arch (i386, > amd64) would also be helpful in trying to debug your issue. > > Best regards, > Daniel