From owner-svn-src-stable@freebsd.org Mon Jan 6 09:10:15 2020 Return-Path: Delivered-To: svn-src-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 433AF1FDED3; Mon, 6 Jan 2020 09:10:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47rqTz14nvz4QbK; Mon, 6 Jan 2020 09:10:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2032CC037; Mon, 6 Jan 2020 09:10:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0069AEvG095490; Mon, 6 Jan 2020 09:10:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0069AERf095485; Mon, 6 Jan 2020 09:10:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202001060910.0069AERf095485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 6 Jan 2020 09:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r356395 - in stable/11/sys: dev/usb sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: dev/usb sys X-SVN-Commit-Revision: 356395 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jan 2020 09:10:15 -0000 Author: hselasky Date: Mon Jan 6 09:10:13 2020 New Revision: 356395 URL: https://svnweb.freebsd.org/changeset/base/356395 Log: MFC r356135: Make USB statistics per device instead of per bus. Bump the FreeBSD version due to structure change to force recompilation of external USB modules. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/usb_bus.h stable/11/sys/dev/usb/usb_device.h stable/11/sys/dev/usb/usb_generic.c stable/11/sys/dev/usb/usb_transfer.c stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/usb_bus.h ============================================================================== --- stable/11/sys/dev/usb/usb_bus.h Mon Jan 6 09:07:57 2020 (r356394) +++ stable/11/sys/dev/usb/usb_bus.h Mon Jan 6 09:10:13 2020 (r356395) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2019 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,19 +40,10 @@ struct usb_bus_msg { }; /* - * The following structure defines the USB statistics structure. - */ -struct usb_bus_stat { - uint32_t uds_requests[4]; -}; - -/* * The following structure defines an USB BUS. There is one USB BUS * for every Host or Device controller. */ struct usb_bus { - struct usb_bus_stat stats_err; - struct usb_bus_stat stats_ok; #if USB_HAVE_ROOT_MOUNT_HOLD struct root_hold_token *bus_roothold; #endif Modified: stable/11/sys/dev/usb/usb_device.h ============================================================================== --- stable/11/sys/dev/usb/usb_device.h Mon Jan 6 09:07:57 2020 (r356394) +++ stable/11/sys/dev/usb/usb_device.h Mon Jan 6 09:10:13 2020 (r356395) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2019 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -175,10 +175,21 @@ union usb_device_scratch { }; /* + * Helper structure to keep track of USB device statistics. + */ +struct usb_device_statistics { + uint32_t uds_requests[4]; +}; + +/* * The following structure defines an USB device. There exists one of * these structures for every USB device. */ struct usb_device { + /* statistics */ + struct usb_device_statistics stats_err; + struct usb_device_statistics stats_ok; + /* generic clear stall message */ struct usb_udev_msg cs_msg[2]; struct sx enum_sx; Modified: stable/11/sys/dev/usb/usb_generic.c ============================================================================== --- stable/11/sys/dev/usb/usb_generic.c Mon Jan 6 09:07:57 2020 (r356394) +++ stable/11/sys/dev/usb/usb_generic.c Mon Jan 6 09:10:13 2020 (r356395) @@ -2221,10 +2221,9 @@ ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void * for (n = 0; n != 4; n++) { u.stat->uds_requests_fail[n] = - f->udev->bus->stats_err.uds_requests[n]; - + f->udev->stats_err.uds_requests[n]; u.stat->uds_requests_ok[n] = - f->udev->bus->stats_ok.uds_requests[n]; + f->udev->stats_ok.uds_requests[n]; } break; Modified: stable/11/sys/dev/usb/usb_transfer.c ============================================================================== --- stable/11/sys/dev/usb/usb_transfer.c Mon Jan 6 09:07:57 2020 (r356394) +++ stable/11/sys/dev/usb/usb_transfer.c Mon Jan 6 09:10:13 2020 (r356395) @@ -2593,10 +2593,10 @@ usbd_transfer_done(struct usb_xfer *xfer, usb_error_t #endif /* keep some statistics */ if (xfer->error) { - info->bus->stats_err.uds_requests + info->udev->stats_err.uds_requests [xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE]++; } else { - info->bus->stats_ok.uds_requests + info->udev->stats_ok.uds_requests [xfer->endpoint->edesc->bmAttributes & UE_XFERTYPE]++; } Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Mon Jan 6 09:07:57 2020 (r356394) +++ stable/11/sys/sys/param.h Mon Jan 6 09:10:13 2020 (r356395) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1103505 /* Master, propagated to newvers */ +#define __FreeBSD_version 1103506 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,