All of lore.kernel.org
 help / color / mirror / Atom feed
From: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH 0/3] PVUSB update and bugfix
Date: Wed, 07 Oct 2009 16:27:26 +0900	[thread overview]
Message-ID: <4ACC42DE.5030708@jp.fujitsu.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1660 bytes --]

This is the update patch of PVUSB that includes some
enhancement and some bugfixes pointed out on this ML.

Main changes are followings:
- xenbus state flow changed.
  Whole of the flow is changed to be like netback/netfront.
  Reconfiguring/Reconfiguring are removed.

- New RING for hotplug notification added.

- USBIF_MAX_SEGMENTS_PER_REQUEST value is changed (10) to (16).
  According to this change, RING_SIZE is decreased from 32 to 16.
  This affects the performance. My flash drive's read throughput
  was dropped from 29MB/s to 18MB/s in the linux environment.
  However, Windows guest send urb with 64kB buffer(64KB = 4kB * 16).
  This is required.

- New port-setting interface
  xenbus_watch_path2 is added to usbback, port-setting interface
  is moved from sysfs to xenstore.
  Now, the port-rule is directly written to xenstore entry.
  Example.
  # xenstore-write /local/domain/0/backend/vusb/1/0/port/1 “2-1”
    (adding physical bus 2-1 to vusb-1-0 port 1)

- urb dequeue function completed.
  usbfront send unlink-request to usbback, and can cancel the urb
  that is submitted in the backend.

- New USB Spec version (USB1.1/USB2.0) selection support.
  usbfront can act as both USB1.1 and USB2.0 virtual host controller
  according to the xenstore entry key "usb-ver".

- experimental bus_suspend/bus_resume added to usbfront.

- various cleanups, bugfix, refactoring and codestyle-fix.


Attached files are xenstore reference and simple shell-script for
setting up and initializing the xenstore entries.

Current PVUSB has drivers only, but I'm now working on
xm integration and will post by this November.

Regards,
Noboru


[-- Attachment #2: XenStoreRefs_New.txt --]
[-- Type: text/plain, Size: 1158 bytes --]

PVUSB XenStore Reference

Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
5th Oct 2009


/local/domain/<domid>

	backend/
		vusb/		- a directory containing vusb backends
			<domid>/	- a directory vusb's for domid
				<id>/		- a directory for each virtual host controller
					frontend-id	- the domain id of the frontend
					frontend	- the path to the frontend domain
					usb-ver	- USB Spec version (1 = USB1.1, 2 = USB2.0)
					num-ports	- number of root ports (max. 16)
					port/
						1	- physical usb port path the virtual port is attached to
						...
						16
					state		- communication state across XenBus to the frontend.

		device/
			vusb/		- a directory containing the virtual hcd
				<id>/		- a directory containing the virtual hcd id for the domain
					backend-id	- the domain id of the backend
					backend	- the path to the backend domain
					urb-ring-ref	- the grant table reference for the urb request ring queue
					conn-ring-ref	- the grant table reference for the connection request ring queue
					event-channel	- the event channel used for the usb request ring queue
					state		- communication state across XenBus to the backend.
		

[-- Attachment #3: init_xs_new.sh --]
[-- Type: text/plain, Size: 2407 bytes --]

#!/bin/sh
#
# Setup XenStore entry for paravirtualized USB driver.
# 
# Written by Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
#

XSWRITE=/usr/bin/xenstore-write
XSCHMOD=/usr/bin/xenstore-chmod

DEV_NAME=vusb
# Max 16 ports.
NUM_PORTS=8

usage () {
    echo "Usage: `basename $0` <frontend-id> <device-id>"
    echo "    <frontend-id>: the domain id of frontend"
    echo "    <device-id>: the device id of frontend"
    echo ""
    echo "Example:"
    echo "    If you use paravirtual USB driver on Domain ID 1,"
    echo "    simply do"
    echo "    `basename $0` 1 0"
    exit 1
}

[ $# -eq 2 ] || usage

DEV_ID=$2

# Write backend information into the location that frontend look for.
$XSWRITE /local/domain/$1/device/$DEV_NAME/$DEV_ID/backend-id 0
$XSWRITE /local/domain/$1/device/$DEV_NAME/$DEV_ID/backend \
/local/domain/0/backend/$DEV_NAME/$1/$DEV_ID

# Write frontend information into the location that backend look for.
$XSWRITE /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/frontend-id $1
$XSWRITE /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/frontend \
/local/domain/$1/device/$DEV_NAME/$DEV_ID


# Write USB Spec version field.
$XSWRITE /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/usb-ver 2

# Write virtual root hub field.
$XSWRITE /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/num-ports $NUM_PORTS
for i in $(seq 1 $NUM_PORTS)
do
	# Set all port to disconnected state
	$XSWRITE /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/port/$i ""
done

# Set permission
$XSCHMOD /local/domain/$1/device/$DEV_NAME/$DEV_ID n$1 r0
$XSCHMOD /local/domain/$1/device/$DEV_NAME/$DEV_ID/backend-id n$1 r0
$XSCHMOD /local/domain/$1/device/$DEV_NAME/$DEV_ID/backend n$1 r0
$XSCHMOD /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID n0 r$1
$XSCHMOD /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/frontend-id n0 r$1
$XSCHMOD /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/frontend n0 r$1
$XSCHMOD /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/usb-ver n0 r$1
$XSCHMOD /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/num-ports n0 r$1
for i in $(seq 1 $NUM_PORTS)
do
	$XSCHMOD /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/port/$i n0 r0
done

# Set state to XenbusStateInitialising
$XSWRITE /local/domain/$1/device/$DEV_NAME/$DEV_ID/state 1
$XSCHMOD /local/domain/$1/device/$DEV_NAME/$DEV_ID/state n$1 r0
$XSWRITE /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/state 1
$XSCHMOD /local/domain/0/backend/$DEV_NAME/$1/$DEV_ID/state n0 r$1

[-- Attachment #4: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2009-10-07  7:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4ACC42DE.5030708@jp.fujitsu.com \
    --to=n_iwamatsu@jp.fujitsu.com \
    --cc=xen-devel@lists.xensource.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.