Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2735022pxb; Mon, 31 Jan 2022 03:12:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpSFkBiQpsVXCc0nu9933Bzd/DahkWSp1EOEQNdZ+f7TFZL+uqD91j3LeIvwvmmHMx1T5U X-Received: by 2002:a17:902:e547:: with SMTP id n7mr19687860plf.118.1643627540090; Mon, 31 Jan 2022 03:12:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643627540; cv=none; d=google.com; s=arc-20160816; b=O38hV2pIsXKLvJeqKKaNhjB35SMzjdjYunYw5jWKSnEIkjZ6X925WDjSfifaydFrSv 87p2RYyJOabtfVlsMCrtyvRBBftL00gxPLM8s5cVw6qjpTIlfi2yIt63BrtSCWM5G37A Keo8WDBGJo1o7r5kvLZzrhGQaHcD3iYJEzy4EkZRaTOuyTh6YooGeldMCUJa1mkBitaU dgdy0uBa3mpTs2LHPQ8x6EaXbLczYrIqygNZurG+ohcToYBZMYcvrsGVRUI1XtQ1NjhR i7E1ejRwncxkvz7wco3sW1Rkeinu4doNE8AXEzqKqEDuKkj2nN2VslHsJTIrNNRfxH+G x6wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HudZyrNZHFA6NiIlfR75TkpALGVgTV9QsmdMR2kml78=; b=pZtlXGTa98V8Gu2bsbrFrnelig8CBSmV8knNuzgoIA84GkFAhfufZyFj7Au+Jw8fsv rjh56YZVtagklVvb4tyD7oNiqMAUjB1cHk3ynKPvK7qU73M+1WXcty+mDm00f3ygWXbd zrFZ15jatddGsQJx4N5cfjBx7GdyRxbds2KJc1WTv9XDXjnuT+ffcfJR/eBr22J/eksI xAWuC1u1nwA31XVkPy4Vtrjo3pvRQL5xacGLwWi2kMN+SasJ4sAk9GPnS7S9/wsb2oUH kEGA6WhhFUsO7DmXRhlJTIorKdlNZVFUX5WAh1QgQpQRjLLWid3714mI4b6jccihCtVq i+fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a70si13197645pge.666.2022.01.31.03.12.08; Mon, 31 Jan 2022 03:12:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349582AbiA1PdO (ORCPT + 99 others); Fri, 28 Jan 2022 10:33:14 -0500 Received: from netrider.rowland.org ([192.131.102.5]:33713 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S236220AbiA1PdN (ORCPT ); Fri, 28 Jan 2022 10:33:13 -0500 Received: (qmail 206926 invoked by uid 1000); 28 Jan 2022 10:33:12 -0500 Date: Fri, 28 Jan 2022 10:33:12 -0500 From: Alan Stern To: Oleksij Rempel Cc: Greg KH , Oliver Neukum , "David S. Miller" , Jakub Kicinski , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next v1 1/1] usbnet: add devlink support Message-ID: References: <20220127110742.922752-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 28, 2022 at 12:27:06PM +0100, Oleksij Rempel wrote: > On Thu, Jan 27, 2022 at 12:00:44PM -0500, Alan Stern wrote: > > On Thu, Jan 27, 2022 at 12:13:53PM +0100, Greg KH wrote: > > > On Thu, Jan 27, 2022 at 12:07:42PM +0100, Oleksij Rempel wrote: > > > > To provide generic way to detect USB issues or HW issues on different > > > > levels we need to make use of devlink. > > > > > > Please make this generic to all USB devices, usbnet is not special here > > > at all. > > > > Even more basic question: How is the kernel supposed to tell the > > difference between a USB issue and a HW issue? That is, by what > > criterion do you decide which category a particular issue falls under? > > In case of networking device, from user space perspective, we have a > communication issue with some external device over the Ethernet. > So, depending on the health state of following chain: > cpu->hcd->USB cable->ethernet_controller->ethernet_cable-<... > > We need to decide what to do, and what can be done automatically by > device itself, "Device"? Do you mean "driver"? I wouldn't expect the device to do much of anything by itself. > for example Mars rover :) The user space should get as > much information as possible what's going on in the system, to decide > the proper measures to fix or mitigate the problem. I disagree. What you're talking about is a debugging facility. Normally users do not want to get that much information. Particularly since most of it is usually useless. > System designers > usually (hopefully) find out during testing what URB status and IP > uplink status for that hardware means and how to fix that. System designers generally have much different requirements from ordinary users. But let's go back to the chain you mentioned: cpu->hcd->USB cable->ethernet_controller->ethernet_cable-> ... In general there is no way to tell at what stage something went wrong. For example, if the kernel does not receive a response to an URB, the program could be in the CPU, the HCD, the USB cable, or the ethernet controller, with no way to tell where it really is. (And that's assuming the problem is a hardware failure, not a software bug!) All we can do in the real world is record error responses. At the moment we don't have any unified way of reporting them to userspace, partly because nobody has asked for it and partly because error responses don't always mean that something has failed. (For example, they might mean that the system has asked to a device to perform an action it doesn't support, or they might mean the user has suddenly unplugged a USB cable.) Greg's suggestion that you try it out and see how much signal you get among all the noise is a good idea. Alan Stern