RE: [PATCH v4 00/11] usbip: features to USB over WebSocket

2015-07-16 Thread fx IWATA NOBUO
Dear Valentina,

I'm preparing 2 sets of patches.

1) cleanups, fixings and workarounds to WebSocket patch set and 
previous code.
   - no critical modification included.

2) number of ports extension in vhci side
   - I think it was talked in 'usbredir' e-mail thread.

I wrote these on WebSocket patch set.

Will the WebSocket patch set be merged?

Could I send new sets above as patches to WebSocket patch set?

Please, give some advice.

Thank you,

n.iwata
//

 -Original Message-
 From: Valentina Manea [mailto:valentina.mane...@gmail.com]
 Sent: Friday, June 05, 2015 10:40 PM
 To: fx IWATA NOBUO
 Cc: Shuah Khan; Greg KH; linux-usb@vger.kernel.org; fx MICHIMURA TADAO
 Subject: Re: [PATCH v4 00/11] usbip: features to USB over WebSocket

--- snip ---

 Acked-by: Valentina Manea valentina.mane...@gmail.com
 mailto:valentina.mane...@gmail.com 


Re: [PATCH v4 00/11] usbip: features to USB over WebSocket

2015-05-28 Thread Oliver Neukum
On Thu, 2015-05-28 at 14:56 +0900, Nobuo Iwata wrote:
 Dear all,
 
 This series of patches introduces WebSocket to USB/IP. 

Hi,

how do you avoid deadlocking under memory pressure?
It seems to me that under these semantics you can no
longer guarantee GFP_NOIO if usb-storage or UAS are used,
because you have no control over memory allocations user
space makes.

Regards
Oliver


--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v4 00/11] usbip: features to USB over WebSocket

2015-05-28 Thread fx IWATA NOBUO
Hi,

 how do you avoid deadlocking under memory pressure?
 It seems to me that under these semantics you can no
 longer guarantee GFP_NOIO if usb-storage or UAS are used,
 because you have no control over memory allocations user
 space makes.

Sorry, I haven't cared the case.
I found GFP_NOIO allocation in usbip_common.c:usbip_recv().
It is used for kernel mode transfer in existing code before this series.
It is not used when switched to userspace transfer introduced by this 
series.

Outside this series, I will study the reason why GFP_NOIO is used.

Thank you,

n.iwata
//
N�r��yb�X��ǧv�^�)޺{.n�+{��^n�r���z���h����G���h�(�階�ݢj���m��z�ޖ���f���h���~�m�

[PATCH v4 00/11] usbip: features to USB over WebSocket

2015-05-27 Thread Nobuo Iwata
Dear all,

This series of patches introduces WebSocket to USB/IP. 

0. Version info

v4)
# Fixed regression of usbip list --remote

v3)
# Coding style for goto err labels are fixed.
# Defined magic numbers for open_hc_device() argument.
# Corrected include .../uapi/linux/usbip_ux.h as linux/usbip_ux.h.
# Modified parameter notation in manuals not to use '='.
# Fixed inappropriate version definition in 
tools/.../websocket/configure.ac.
# Remved unnecessary COPYING and AUTHORS fil from tools/.../websocket/.
# Added -version-info to libraries in tools/.../src.

v2)
# Formatted patches from linux-next.
# Fixed change log word wrapping.
# Removed SSL patches.
# Fixed a bug that vendor and product names are not shown by 'usbws 
list -l' because usbip_names_init() was not called in libusbip.la.

1. Features included

It also includes some independent features effective in themselves.

1) Exporting devices

Export request and response PDU had been defined in a header but not 
been used.
Now it works!
   
Also, it supports senarios, for example, connect ubiquetous devices to 
a Linux based cloud service.
In this senario, it's needed to establish connection from a device 
inside of firewall to a service outside. Exporting is suit for the 
senario.

2) User space transmission

USB/IP transfer URBs in kernel space. It's better for performance but 
difficult to introduce application protocols.

Like fuse for file systems, it allows to transfer URBs in user space.

When usbip_ux.ko is loaded, it replaces kernel_sendmsg() and 
kernel_recvmsg() with user spcace interface. When USB/IP utilities find 
usbip_ux.ko, they start threads to read/write PDUs from/to usbip_ux.ko 
and send/recv them.

3) Replaceable protocols

Both transmission(send/receive) and connection establishment are 
replaceable.

4) a WebSocket implementation

It's made with Poco C++. DNS and proxy client are supported.

I published scripts I used while developed the patches.
http://linux-usbip-additions.blogspot.jp/2015/03/scripts-to-patch-and-ma
ke-locally.html
http://linux-usbip-additions.blogspot.jp/2015/03/test-scripts.html

2. Why WebSocket?

It allows to use USB/IP in internet. WebSocket is widely used to 
encapsulate packets in HTTP and to carry them through firewall using 
HTTP port numbers.

Assumed use case is a system that service in internet serves 
distributes devices in home or office networks. Service may be called 
as cloud and devices as ubiquitous.

   Home/SOHO/IntranetInternet  
 ++++
 +--+   +--+ |Router, ||Internet|
+|device|---|Linux |-|proxy,  ||service |
|+--+   +--+ |firewall||on Linux|
+--+   controller++++
ex)
Device  Service 
 sensors ... environment analysis 
 cameras ... monitoring, recording
 ID/biometric readers .. authentication

3. Why userspace transmission?

Userspace transmission and APIs provided by this series allow to apply 
application protocols to USB/IP.
 
Why not use usbfs or libusb?
a) Not only device(usbip-host) side, application(vhci-hcd) side must be 
handled.
b) In device side, if using usbfs or libusb, many parts of usbip-common 
and usbip-host driver must be copied to userspace. It's not good for 
maintainability. 

Tunneling daemons can wrap TCP/IP with application protocol. They pass 
packets through loopback so this series has certain advantage regarding 
performance.

4. Why exporting devices?

Connection from outside firewall is usually blocked.
So existing import request sent with attach command doesn't work.

# usbipd (blocked)|| - # usbip attach

Firewall opens some ports, usually HTTP(80) and HTTPS(443), from inside.
Then export request sent with new connect command works.

# usbip connect  - # usbipa
 (passed)

Thank you,

Nobuo Iwata nobuo.iw...@fujixerox.co.jp
//

*** BLURB HERE ***

Nobuo Iwata (11):
  usbip: exporting devices
  usbip: readme and manuals about exporting devices
  usbip: safe completion against usb_kill_urb()
  usbip: kernel module for userspace URBs transmission
  usbip: tools for userspace URBs transmission
  usbip: readme about user space URBs transmission
  usbip: letting send and receive replaceable
  usbip: letting connection establishment replaceable
  usbip: deriving functions as libraries
  usbip: added const qualifier to arguments of some functions
  usbip: USB over WebSocket

 drivers/usb/usbip/Kconfig |  10 +
 drivers/usb/usbip/Makefile|   3 +
 drivers/usb/usbip/stub_dev.c  |  16 +-
 drivers/usb/usbip/stub_rx.c   |   3 +-
 drivers/usb/usbip/stub_tx.c   |   9 +-
 drivers/usb/usbip/usbip_common.c  |  79 ++-