2005-09-07 03:02:22

by Anton Blanchard

[permalink] [raw]
Subject: Re: [RFC] SCSI target for IBM Power5 LPAR


Hi Dave,

> This device driver provides the SCSI target side of the "virtual
> SCSI" on IBM Power5 systems. The initiator side has been in mainline
> for a while now (drivers/scsi/ibmvscsi/ibmvscsi.c.) Targets already
> exist for AIX and OS/400.

Good stuff. Got a couple of small suggestions.

+/* Allocate a buffer with a dma_address. Don't use dma_alloc_coherent
+ * since that uses GFP_ATOMIC internally and we can tollerate a delay
+ */
+static void *alloc_coherent_buffer(struct server_adapter *adapter, size_t size,
+ dma_addr_t *dma_handle)
+{
+ void *buffer = kmalloc(size, GFP_KERNEL);
+
+ if (buffer) {
+ *dma_handle = dma_map_single(adapter->dev, buffer, size,
+ DMA_BIDIRECTIONAL);
+
+ if (dma_mapping_error(*dma_handle)) {
+ kfree(buffer);
+ buffer = NULL;
+ }
+ }
+
+ return buffer;
+}

This should be fixed in mainline, on ppc64 we no longer build the dma_*
ops on top of the pci_* ops. This means we actually look at the flags :)

+ adapter->max_sectors = MAX_SECTORS;

Does this mean we are limited to 128kB transfers? Would it be OK to
bump the default?

Anton


2005-09-07 14:57:54

by Santiago Leon

[permalink] [raw]
Subject: Re: [RFC] SCSI target for IBM Power5 LPAR

Hi Anton,

> + adapter->max_sectors = MAX_SECTORS;
>
> Does this mean we are limited to 128kB transfers? Would it be OK to
> bump the default?

We use MAX_SECTORS (which is actually 127.5kB) because that's the
max_sectors of the loopback device (we have a lot of users that like the
flexibility of using loopback with the ibmvscsis driver)... It can be
bumped up without any problems because there is code that splits
requests if they are larger than the target's max_sectors...

What would you recommend? 256kB?

--
Santiago A. Leon
Power Linux Development
IBM Linux Technology Center

2005-09-13 15:32:36

by Anton Blanchard

[permalink] [raw]
Subject: Re: [RFC] SCSI target for IBM Power5 LPAR


Hi,

> We use MAX_SECTORS (which is actually 127.5kB) because that's the
> max_sectors of the loopback device (we have a lot of users that like the
> flexibility of using loopback with the ibmvscsis driver)... It can be
> bumped up without any problems because there is code that splits
> requests if they are larger than the target's max_sectors...
>
> What would you recommend? 256kB?

~256kB sounds reasonable to me and I notice that other VIO server is
setting it to 256kB :)

Anton