RE: [PATCH v2 1/2] usbip: vhci number of ports extension

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Why do these numbers have to be static?

Because it is easy to implement.
When event threads are reduced with patch 2/2, I thought it is
acceptable. 

> Why can't we automatically add new controllers when there are no
> more ports available?

It possible.
Some overhead may exist when extending.
I considered dynamic but I selected static.

> Again:  Not sure the existing files can be changed?
> Or can we do that because the userspace implementation is part of the
> kernel source repo?

Sorry my carelessness.
I will fix.

Old binary figures number of ports by counting lines of status file,
so it may check only first vhci.

> Definitely not.  One value per file. Note that the num_controllers
> will be readable as a module parameter by default.

Is it a convention?
Is it OK? : out += sprintf(out, "%d\n", VHCI_NPORTS * num_controllers);

Thank you for your help,

nobuo.iwata
//
> -----Original Message-----
> From: Bjørn Mork [mailto:bjorn@xxxxxxx]
> Sent: Tuesday, January 05, 2016 9:05 PM
> To: fx IWATA NOBUO
> Cc: valentina.manea.m@xxxxxxxxx; shuah.kh@xxxxxxxxxxx;
> gregkh@xxxxxxxxxxxxxxxxxxx; linux-usb@xxxxxxxxxxxxxxx; fx MICHIMURA
> TADAO
> Subject: Re: [PATCH v2 1/2] usbip: vhci number of ports extension
> 
> Nobuo Iwata <nobuo.iwata@xxxxxxxxxxxxxxx> writes:
> 
> > This patch extends number of ports limitation in application (vhci)
> > side.
> >
> > To do so, vhci driver supports multiple host controllers. The number
> > of controllers can be specified as a module parameter 'num_controllers'.
> > The default is 1.
> >
> > ex) # insmod vhci_hcd.ko num_controllers=4
> >
> > Also, ports per controller is changed from 8 to USB_MAXCHILDREN (31).
> > It can be modified with VHCI_NPORTS flag at module compilation.
> 
> Why do these numbers have to be static?  Why can't we automatically add
> new controllers when there are no more ports avilable?
> 
> 
> 
> > So number of ports supported by vhci is 'num_controllers' * 31.
> >
> > Sysfs structure is changes as following.
> > BEFORE:
> >     /sys/devices/platform
> >         +-- vhci
> >             +-- status
> >             +-- attach
> >             +-- detach
> >             +-- usbip_debug
> > AFTER: example for num_controllers=4
> >     /sys/devices/platform
> >         +-- vhci.0
> >         |   +-- nports
> >         |   +-- status.0
> >         |   +-- status.1
> >         |   +-- status.2
> >         |   +-- status.3
> >         |   +-- attach
> >         |   +-- detach
> >         |   +-- usbip_debug
> >         +-- vhci.1
> >         +-- vhci.2
> >         +-- vhci.3
> 
> Again:  Not sure the existing files can be changed?  Or can we do that
> because the userspace implementation is part of the kernel source repo?
> 
> > +static ssize_t nports_show(struct device *dev, struct device_attribute
> *attr,
> > +			   char *out)
> > +{
> > +	char *s = out;
> > +	out += sprintf(out, "%d %d\n", VHCI_NPORTS, num_controllers);
> 
> Definitely not.  One value per file.  Note that the num_controllers will
> be readable as a module parameter by default.
> 
> 
> 
> Bjørn
��.n��������+%������w��{.n�����{���)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux