Received: by 10.223.176.5 with SMTP id f5csp4030967wra; Tue, 30 Jan 2018 00:45:22 -0800 (PST) X-Google-Smtp-Source: AH8x226QkxPD0kqlvwBIcUPY56NN3g8FzGoVMCLD+qHb3QCFVfzwb58VPQ79ZFQdS7wAJOAMSTV2 X-Received: by 10.98.58.194 with SMTP id v63mr29710099pfj.36.1517301922061; Tue, 30 Jan 2018 00:45:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517301922; cv=none; d=google.com; s=arc-20160816; b=t9sD3q7wjsqqAm8R/x7Q9iQv7tBxwZbHuu6ZpB1rZbUQ2q2EZdX6ErnhoVcrB6P6U6 AmDV/0nH2Yxm4WjVyOIysSu6sBS/bV5SHHpdMv45Pglb/1yi2e8KInckTbT5y4CvEVD3 kgvUjxe6WD1lfsY+SYKmVRQ0UUE1RYIDJ3IoEs4vBiLScPXFrTO4J5shTCfgPWX5yqKB f/EZy73QtJ8cEqyzYvpCGy7+7Mg858cC36TrTFBOdSnbjEXDaAl4x5lryk2kjIgOUwsY uhBd9BOOQ0v+x1fQwq4yaYYj+906eWC6gNsCTP5tL0Z0U9S+a5pXz4hFeXnWdL1KgS2x DmVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=vbEamOS448/S3Dt6Q6mMG9QGQdBwyA0PRxmFu6NuV9E=; b=xof4l7ZpruO5yIEg3EIbTYIk/W4AOkD/+vlHy5u/qqA2wddhIPRHLCMkCesKXWAfd9 CRmAtzzN1MRrKFujGcRTHUgP7fo0kk9QBDHRekjbg/dk2juxUjrGIwCdpmLjdRkwG9GC YKZeOtHs+xV+WyyBugtAJR0b1i/IK/RJZLtui7fK3xalIVa7kMGWzIkgUw3NuayhIzgZ y5EVG5cP0+fE1WpwhDdViU9vZ+szzW9rGYvkFV+6NkGezKkoa82/2YF+BG7RqkCsTOCN rHZbFsoMrTFPvYpOMwqxYyeWu4QSzWt9KRPoNK7W9M5dgp0xKN7VqCb2UFzfBuz5L8lA MqOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x75si3364226pfa.144.2018.01.30.00.45.07; Tue, 30 Jan 2018 00:45:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751946AbeA3IoQ convert rfc822-to-8bit (ORCPT + 99 others); Tue, 30 Jan 2018 03:44:16 -0500 Received: from smtp.qindel.com ([89.140.90.34]:59716 "EHLO thor.qindel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751642AbeA3IoN (ORCPT ); Tue, 30 Jan 2018 03:44:13 -0500 Received: from localhost (localhost [127.0.0.1]) by thor.qindel.com (Postfix) with ESMTP id 1A281601F6; Tue, 30 Jan 2018 09:37:44 +0100 (CET) Received: from thor.qindel.com ([127.0.0.1]) by localhost (thor.qindel.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id TnySuL0JT1dP; Tue, 30 Jan 2018 09:37:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by thor.qindel.com (Postfix) with ESMTP id E2D0A601F7; Tue, 30 Jan 2018 09:37:43 +0100 (CET) X-Virus-Scanned: amavisd-new at thor.qindel.com Received: from thor.qindel.com ([127.0.0.1]) by localhost (thor.qindel.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Oe2C88U-veHJ; Tue, 30 Jan 2018 09:37:43 +0100 (CET) Received: from atun.int.qindel.com (unknown [172.26.9.84]) by thor.qindel.com (Postfix) with ESMTP id 9B0FC601F6; Tue, 30 Jan 2018 09:37:36 +0100 (CET) From: Salvador Fandino To: linux-usb@vger.kernel.org Cc: gregkh@linuxfoundation.org, valentina.manea.m@gmail.com, shuah@kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Salvador=20Fandi=C3=B1o?= Subject: [PATCH 4/4] config: make USB_MAXBUS configurable and adjust VHCI_NR_HCS top limit Date: Tue, 30 Jan 2018 09:36:30 +0100 Message-Id: <20180130083630.26501-5-salva@qindel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180130083630.26501-1-salva@qindel.com> References: <20180130083630.26501-1-salva@qindel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Salvador Fandiño The maximum number of USB host controllers supported by the kernel had a hard-coded limit of 64. In some scenarios that limit may be not enough. For instance, in my particular case, I have systems with thousands of containers running and would like to provide a VHCI (USBIP host controller) device to every one of them but can't because of this limit. This patch adds a new configuration entry for USB_MAXBUS and also increases the top limit for USBIP_VHCI_NR_HCS (number of VHCI controllers) accordingly. Signed-off-by: Salvador Fandiño --- drivers/usb/Kconfig | 9 +++++++++ drivers/usb/core/hcd.c | 2 +- drivers/usb/usbip/Kconfig | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index f699abab1787..78b3e2805d8f 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig @@ -72,6 +72,15 @@ config USB To compile this driver as a module, choose M here: the module will be called usbcore. +config USB_MAXBUS + int "Maximum number of USB host controllers" + range 1 4096 + default 64 + ---help--- + This defines the number of USB host controllers that would be + available, both physical and virtual (for instance, those + used by USB/IP). + config USB_PCI bool "PCI based USB host interface" depends on PCI diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index fc32391a34d5..e1589e950b86 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -83,7 +83,7 @@ DEFINE_IDR (usb_bus_idr); EXPORT_SYMBOL_GPL (usb_bus_idr); /* used when allocating bus numbers */ -#define USB_MAXBUS 64 +#define USB_MAXBUS CONFIG_USB_MAXBUS /* used when updating list of hcds */ DEFINE_MUTEX(usb_bus_idr_lock); /* exported only for usbfs */ diff --git a/drivers/usb/usbip/Kconfig b/drivers/usb/usbip/Kconfig index eeefa29f8aa2..cb87bec9dbbb 100644 --- a/drivers/usb/usbip/Kconfig +++ b/drivers/usb/usbip/Kconfig @@ -37,7 +37,7 @@ config USBIP_VHCI_HC_PORTS config USBIP_VHCI_NR_HCS int "Number of USB/IP virtual host controllers" - range 1 128 + range 1 2048 default 1 depends on USBIP_VHCI_HCD ---help--- @@ -46,6 +46,9 @@ config USBIP_VHCI_NR_HCS virtual host controllers as if adding physical host controllers. + Note that the number of host controllers is also limited by + USB_MAXBUS. + config USBIP_HOST tristate "Host driver" depends on USBIP_CORE && USB -- 2.14.1