From: Samuel Kvasnica <bugreports@list.ims.co.at>
To: "Pasi Kärkkäinen" <pasik@iki.fi>
Cc: kama@jp.fujitsu.com, t.horikoshi@jp.fujitsu.com,
xen-devel@lists.xensource.com
Subject: Re: vscsi 2TB patches
Date: Tue, 4 Jan 2011 12:24:07 +0100 [thread overview]
Message-ID: <4D230357.3070604@list.ims.co.at> (raw)
In-Reply-To: <20110103230621.GP2754@reaktio.net>
[-- Attachment #1: Type: text/plain, Size: 1744 bytes --]
Hello Pasi,
On 01/04/2011 12:06 AM, Pasi Kärkkäinen wrote:
> Which kernels did you test this against? I assume this should be
this is thoroughly tested against opensuse 2.6.31.x-xen - 2.6.34.7-xen
with paravirtualized domU, xen 4.0.1.
> applied to linux-2.6.18-xen tree.
Huh ??? 2.6.18 ? I remember that was ~5 years ago, cannot imagine even
boot it up
on current hardware. But as long as scsi constant names did not change, the
patch should be compatible, there is nothing kernel-specific.
Btw, I'm still confused, why did the original author exclude so many
scsi commands from passthrough.
> Note that pvops kernels don't have pvscsi drivers yet!
> (Noone ported them yet from Xenlinux kernels).
Hmm, so why does it work at all, did suse people port it secretly ?
Correct me if I'm wrong,
but actually, I cannot imagine the vscsi drivers have anything special
related to pvops,
its just a simple passthrough layer for scsi commands. Or do you mean a
real paravirt
scsi driver implementation is planned ? The current vscsi works actually
pretty well,
I'm getting native performance, much better than using xvd.
There some are other glitches with the vscsi python xend code in current
4.0.x -
scsi devices are not found on "xm create" due to mismatch with lsscsi
interface and
some deprecated python stuff. But I don´t have a clean patch, just
workaround,
maybe I submit another bugreport to suse.
> Also two minor things:
> - Please send patches made with "diff -u" (unified diffs)
> - Include Signed-Off-By line
Ok, I'm attaching the changed patch, hope the format is correct now.
I'm also adding the Fujitsu authors to cc: as Jan kindly googled out
somewhere their emails.
regards,
Sam
[-- Attachment #2: vscsi_2TB.patch --]
[-- Type: text/plain, Size: 9689 bytes --]
From: Samuel Kvasnica <bugreports@list.ims.co.at>
Subject: vscsi >2TB patch
This patch fixes current 2TB limitation of the xen vscsi driver.
Both frontend (command size) and backend (missing READ_16/WRITE_16 commands)
driver need a fix. Also an scsi command added to support ALUA.
Tested thoroughly on 4TB external RAID.
I also enabled some more commands to allow operating LTO tape
drives and autoloaders (tested on HP Ultrium 1/8 + Bacula).
Still more scsi commands might be missing for other specific devices
(why not to enable all scsi commands by default ?).
This patch was tested on opensuse xenified kernels 2.6.31-2.6.34.7
in paravirtualized domU.
Signed-off-by: Samuel Kvasnica <samuel.kvasnica@ims.co.at>
---
diff -rup ./scsiback.orig/emulate.c scsiback/emulate.c
--- ./scsiback.orig/emulate.c 2010-10-30 07:05:01.000000000 +0200
+++ scsiback/emulate.c 2011-01-03 20:41:19.890669438 +0100
@@ -28,6 +28,11 @@
* IN THE SOFTWARE.
*/
+/*
+* Patched to support >2TB drives + allow tape & autoloader operations
+* 2010, Samuel Kvasnica, IMS Nanofabrication AG
+*/
+
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
@@ -381,85 +386,88 @@ void scsiback_emulation_init(void)
/*
Following commands do not require emulation.
*/
- NO_EMULATE(TEST_UNIT_READY); /*0x00*/
- NO_EMULATE(REZERO_UNIT); /*0x01*/
+ NO_EMULATE(TEST_UNIT_READY); /*0x00*/ /* sd,st */
+ NO_EMULATE(REZERO_UNIT); /*0x01*/ /* st */
NO_EMULATE(REQUEST_SENSE); /*0x03*/
NO_EMULATE(FORMAT_UNIT); /*0x04*/
- NO_EMULATE(READ_BLOCK_LIMITS); /*0x05*/
+ NO_EMULATE(READ_BLOCK_LIMITS); /*0x05*/ /* st */
/*NO_EMULATE(REASSIGN_BLOCKS); *//*0x07*/
- /*NO_EMULATE(INITIALIZE_ELEMENT_STATUS); *//*0x07*/
- NO_EMULATE(READ_6); /*0x08*/
- NO_EMULATE(WRITE_6); /*0x0a*/
- /*NO_EMULATE(SEEK_6); *//*0x0b*/
+ NO_EMULATE(INITIALIZE_ELEMENT_STATUS); /*0x07*/ /* ch */
+ NO_EMULATE(READ_6); /*0x08*/ /* sd,st */
+ NO_EMULATE(WRITE_6); /*0x0a*/ /* sd,st */
+ NO_EMULATE(SEEK_6); /*0x0b*/
/*NO_EMULATE(READ_REVERSE); *//*0x0f*/
- NO_EMULATE(WRITE_FILEMARKS); /*0x10*/
- NO_EMULATE(SPACE); /*0x11*/
+ NO_EMULATE(WRITE_FILEMARKS); /*0x10*/ /* st */
+ NO_EMULATE(SPACE); /*0x11*/ /* st */
NO_EMULATE(INQUIRY); /*0x12*/
/*NO_EMULATE(RECOVER_BUFFERED_DATA); *//*0x14*/
- /*NO_EMULATE(MODE_SELECT); *//*0x15*/
+ NO_EMULATE(MODE_SELECT); /*0x15*/ /* st */
/*NO_EMULATE(RESERVE); *//*0x16*/
/*NO_EMULATE(RELEASE); *//*0x17*/
/*NO_EMULATE(COPY); *//*0x18*/
- NO_EMULATE(ERASE); /*0x19*/
- NO_EMULATE(MODE_SENSE); /*0x1a*/
- /*NO_EMULATE(START_STOP); *//*0x1b*/
- /*NO_EMULATE(RECEIVE_DIAGNOSTIC); *//*0x1c*/
+ NO_EMULATE(ERASE); /*0x19*/ /* st */
+ NO_EMULATE(MODE_SENSE); /*0x1a*/ /* st */
+ NO_EMULATE(START_STOP); /*0x1b*/ /* sd,st */
+ NO_EMULATE(RECEIVE_DIAGNOSTIC); /*0x1c*/
NO_EMULATE(SEND_DIAGNOSTIC); /*0x1d*/
- /*NO_EMULATE(ALLOW_MEDIUM_REMOVAL); *//*0x1e*/
+ NO_EMULATE(ALLOW_MEDIUM_REMOVAL); /*0x1e*/
/*NO_EMULATE(SET_WINDOW); *//*0x24*/
- NO_EMULATE(READ_CAPACITY); /*0x25*/
- NO_EMULATE(READ_10); /*0x28*/
- NO_EMULATE(WRITE_10); /*0x2a*/
- /*NO_EMULATE(SEEK_10); *//*0x2b*/
- /*NO_EMULATE(POSITION_TO_ELEMENT); *//*0x2b*/
+ NO_EMULATE(READ_CAPACITY); /*0x25*/ /* sd */
+ NO_EMULATE(READ_10); /*0x28*/ /* sd */
+ NO_EMULATE(WRITE_10); /*0x2a*/ /* sd */
+ NO_EMULATE(SEEK_10); /*0x2b*/ /* st */
+ NO_EMULATE(POSITION_TO_ELEMENT); /*0x2b*/ /* ch */
/*NO_EMULATE(WRITE_VERIFY); *//*0x2e*/
/*NO_EMULATE(VERIFY); *//*0x2f*/
/*NO_EMULATE(SEARCH_HIGH); *//*0x30*/
/*NO_EMULATE(SEARCH_EQUAL); *//*0x31*/
/*NO_EMULATE(SEARCH_LOW); *//*0x32*/
- /*NO_EMULATE(SET_LIMITS); *//*0x33*/
- /*NO_EMULATE(PRE_FETCH); *//*0x34*/
- /*NO_EMULATE(READ_POSITION); *//*0x34*/
- /*NO_EMULATE(SYNCHRONIZE_CACHE); *//*0x35*/
- /*NO_EMULATE(LOCK_UNLOCK_CACHE); *//*0x36*/
- /*NO_EMULATE(READ_DEFECT_DATA); *//*0x37*/
- /*NO_EMULATE(MEDIUM_SCAN); *//*0x38*/
+ NO_EMULATE(SET_LIMITS); /*0x33*/
+ NO_EMULATE(PRE_FETCH); /*0x34*/ /* st! */
+ NO_EMULATE(READ_POSITION); /*0x34*/ /* st */
+ NO_EMULATE(SYNCHRONIZE_CACHE); /*0x35*/ /* sd */
+ NO_EMULATE(LOCK_UNLOCK_CACHE); /*0x36*/
+ NO_EMULATE(READ_DEFECT_DATA); /*0x37*/
+ NO_EMULATE(MEDIUM_SCAN); /*0x38*/
/*NO_EMULATE(COMPARE); *//*0x39*/
/*NO_EMULATE(COPY_VERIFY); *//*0x3a*/
- /*NO_EMULATE(WRITE_BUFFER); *//*0x3b*/
- /*NO_EMULATE(READ_BUFFER); *//*0x3c*/
+ NO_EMULATE(WRITE_BUFFER); /*0x3b*/
+ NO_EMULATE(READ_BUFFER); /*0x3c*/ /* osst */
/*NO_EMULATE(UPDATE_BLOCK); *//*0x3d*/
/*NO_EMULATE(READ_LONG); *//*0x3e*/
/*NO_EMULATE(WRITE_LONG); *//*0x3f*/
/*NO_EMULATE(CHANGE_DEFINITION); *//*0x40*/
/*NO_EMULATE(WRITE_SAME); *//*0x41*/
- /*NO_EMULATE(READ_TOC); *//*0x43*/
- /*NO_EMULATE(LOG_SELECT); *//*0x4c*/
- /*NO_EMULATE(LOG_SENSE); *//*0x4d*/
+ NO_EMULATE(READ_TOC); /*0x43*/ /* sr */
+ NO_EMULATE(LOG_SELECT); /*0x4c*/
+ NO_EMULATE(LOG_SENSE); /*0x4d*/ /* st! */
/*NO_EMULATE(MODE_SELECT_10); *//*0x55*/
/*NO_EMULATE(RESERVE_10); *//*0x56*/
/*NO_EMULATE(RELEASE_10); *//*0x57*/
- /*NO_EMULATE(MODE_SENSE_10); *//*0x5a*/
+ NO_EMULATE(MODE_SENSE_10); /*0x5a*/ /* scsi_lib */
/*NO_EMULATE(PERSISTENT_RESERVE_IN); *//*0x5e*/
/*NO_EMULATE(PERSISTENT_RESERVE_OUT); *//*0x5f*/
/* REPORT_LUNS *//*0xa0*//*Full emulaiton*/
- /*NO_EMULATE(MOVE_MEDIUM); *//*0xa5*/
- /*NO_EMULATE(EXCHANGE_MEDIUM); *//*0xa6*/
+ NO_EMULATE(MAINTENANCE_IN); /*0xa3*/ /* IFT alua */
+ NO_EMULATE(MAINTENANCE_OUT); /*0xa4*/ /* IFT alua */
+ NO_EMULATE(MOVE_MEDIUM); /*0xa5*/ /* ch */
+ NO_EMULATE(EXCHANGE_MEDIUM); /*0xa6*/ /* ch */
/*NO_EMULATE(READ_12); *//*0xa8*/
/*NO_EMULATE(WRITE_12); *//*0xaa*/
/*NO_EMULATE(WRITE_VERIFY_12); *//*0xae*/
/*NO_EMULATE(SEARCH_HIGH_12); *//*0xb0*/
/*NO_EMULATE(SEARCH_EQUAL_12); *//*0xb1*/
/*NO_EMULATE(SEARCH_LOW_12); *//*0xb2*/
- /*NO_EMULATE(READ_ELEMENT_STATUS); *//*0xb8*/
- /*NO_EMULATE(SEND_VOLUME_TAG); *//*0xb6*/
+ NO_EMULATE(READ_ELEMENT_STATUS); /*0xb8*/ /* ch */
+ NO_EMULATE(SEND_VOLUME_TAG); /*0xb6*/ /* ch */
/*NO_EMULATE(WRITE_LONG_2); *//*0xea*/
- /*NO_EMULATE(READ_16); *//*0x88*/
- /*NO_EMULATE(WRITE_16); *//*0x8a*/
- /*NO_EMULATE(VERIFY_16); *//*0x8f*/
- /*NO_EMULATE(SERVICE_ACTION_IN); *//*0x9e*/
+ NO_EMULATE(READ_16); /*0x88*/ /* sd >2TB */
+ NO_EMULATE(WRITE_16); /*0x8a*/ /* sd >2TB */
+ NO_EMULATE(VERIFY_16); /*0x8f*/
+ NO_EMULATE(SERVICE_ACTION_IN); /*0x9e*/ /* sd >2TB */
+/* st: QFA_REQUEST_BLOCK, QFA_SEEK_BLOCK might be needed ? */
/*
Following commands require emulation.
*/
diff -rup ./scsifront.orig/scsifront.c ./scsifront/scsifront.c
--- ./scsifront.orig/scsifront.c 2010-10-30 07:05:01.000000000 +0200
+++ ./scsifront/scsifront.c 2010-07-24 16:00:59.000000000 +0200
@@ -94,7 +94,6 @@ static void scsifront_do_request(struct
struct vscsiif_front_ring *ring = &(info->ring);
unsigned int irq = info->irq;
int notify;
-
RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(ring, notify);
if (notify)
notify_remote_via_irq(irq);
@@ -137,6 +136,7 @@ static void scsifront_cdb_cmd_done(struc
uint32_t id;
uint8_t sense_len;
+
id = ring_res->rqid;
sc = (struct scsi_cmnd *)info->shadow[id].req_scsi_cmnd;
@@ -324,6 +324,11 @@ static int scsifront_queuecommand(struct
int ref_cnt;
uint16_t rqid;
+/* printk(KERN_INFO "scsicmd: len=%i, 0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x,0x%x",sc->cmd_len,
+ sc->cmnd[0],sc->cmnd[1],sc->cmnd[2],sc->cmnd[3],sc->cmnd[4],
+ sc->cmnd[5],sc->cmnd[6],sc->cmnd[7],sc->cmnd[8],sc->cmnd[9]
+ );
+*/
if (RING_FULL(&info->ring)) {
goto out_host_busy;
}
@@ -342,6 +347,7 @@ static int scsifront_queuecommand(struct
BUG_ON(sc->cmd_len > VSCSIIF_MAX_COMMAND_SIZE);
+
if ( sc->cmd_len )
memcpy(ring_req->cmnd, sc->cmnd, sc->cmd_len);
else
diff -rup ./scsifront.orig/xenbus.c ./scsifront/xenbus.c
--- ./scsifront.orig/xenbus.c 2010-10-30 07:05:01.000000000 +0200
+++ ./scsifront/xenbus.c 2011-01-03 20:41:40.562665612 +0100
@@ -27,7 +27,11 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
-
+
+/*
+* Patched to support >2TB drives
+* 2010, Samuel Kvasnica, IMS Nanofabrication AG
+*/
#include <linux/version.h>
#include <linux/slab.h>
@@ -122,7 +126,6 @@ static int scsifront_init_ring(struct vs
int err;
DPRINTK("%s\n",__FUNCTION__);
-
err = scsifront_alloc_ring(info);
if (err)
return err;
@@ -220,6 +223,7 @@ static int scsifront_probe(struct xenbus
host->max_channel = 0;
host->max_lun = VSCSIIF_MAX_LUN;
host->max_sectors = (VSCSIIF_SG_TABLESIZE - 1) * PAGE_SIZE / 512;
+ host->max_cmd_len = VSCSIIF_MAX_COMMAND_SIZE;
err = scsi_add_host(host, &dev->dev);
if (err) {
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2011-01-04 11:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-03 20:11 vscsi 2TB patches Samuel Kvasnica
2011-01-03 23:06 ` Pasi Kärkkäinen
2011-01-04 11:24 ` Samuel Kvasnica [this message]
2011-01-04 11:44 ` Jan Beulich
[not found] ` <4D231A46.2000209@list.ims.co.at>
[not found] ` <4D232ADB020000780002A33B@vpn.id2.novell.com>
[not found] ` <4D2321DE.9030706@list.ims.co.at>
[not found] ` <4D233968020000780002A36E@vpn.id2.novell.com>
2011-01-04 14:46 ` Samuel Kvasnica
2011-01-04 14:55 ` Jan Beulich
2011-01-04 11:47 ` Jan Beulich
2011-01-04 13:03 ` Samuel Kvasnica
2011-01-04 13:07 ` Jan Beulich
2011-01-04 13:23 ` Samuel Kvasnica
2011-01-04 14:06 ` Jan Beulich
2011-01-11 16:26 ` Jan Beulich
2011-01-18 11:45 ` Jan Beulich
2011-01-24 12:24 ` Samuel Kvasnica
2011-01-04 9:47 ` Jan Beulich
2011-01-04 12:57 ` Samuel Kvasnica
2011-01-04 13:01 ` Jan Beulich
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=4D230357.3070604@list.ims.co.at \
--to=bugreports@list.ims.co.at \
--cc=kama@jp.fujitsu.com \
--cc=pasik@iki.fi \
--cc=t.horikoshi@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.