mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Salvador Fandino <salva@qindel.com>
To: linux-usb@vger.kernel.org
Cc: gregkh@linuxfoundation.org, valentina.manea.m@gmail.com,
	shuah@kernel.org, linux-kernel@vger.kernel.org,
	"Salvador Fandiño" <salva@qindel.com>
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	[thread overview]
Message-ID: <20180130083630.26501-5-salva@qindel.com> (raw)
In-Reply-To: <20180130083630.26501-1-salva@qindel.com>

From: Salvador Fandiño <salva@qindel.com>

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 <salva@qindel.com>
---
 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

  parent reply	other threads:[~2018-01-30  8:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30  8:36 [PATH 0/4] usbip: make vhci_hcd.* objects independent of vhci_hcd.0 Salvador Fandino
2018-01-30  8:36 ` [PATCH 1/4] " Salvador Fandino
2018-01-30  8:36 ` [PATCH 2/4] libusbip: use per vhci_hcd controller attributes Salvador Fandino
2018-01-30  8:36 ` [PATCH 3/4] usbip tools: " Salvador Fandino
2018-01-30  8:36 ` Salvador Fandino [this message]
2018-02-05 15:16 ` [PATH 0/4] usbip: make vhci_hcd.* objects independent of vhci_hcd.0 Shuah Khan
2018-02-21  0:35 ` Shuah Khan
2018-03-05  9:00   ` Salvador Fandiño
2018-03-06  0:03     ` Shuah Khan
2018-03-06  8:35       ` Salvador Fandiño
2018-03-06 20:58         ` Shuah Khan
2018-03-08 12:45           ` Salvador Fandiño
2018-09-24  7:17             ` Salvador Fandino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180130083630.26501-5-salva@qindel.com \
    --to=salva@qindel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=valentina.manea.m@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®