Re: [PATCH] 2.6 aacraid: Variable FIB size

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

 



On Tue, 2005-05-10 at 15:22 -0700, Mark Haverkamp wrote:
>  	rcode = fib_send(RequestAdapterInfo,
> -			fibptr, 
> -			sizeof(struct aac_adapter_info),
> -			FsaNormal, 
> -			1, 1, 
> -			NULL, 
> +		fibptr, 
> +		sizeof(*info),
> +		FsaNormal, 
> +		1, 1, 
> +		NULL, 
> +		NULL);

This is a formatting change that makes the driver harder to read.  If
you want one argument per line, they should at least line up with the
opening bracket of the function.

>  		for (i = 0; i < sg_count; i++) {
> -			psg->sg[i].addr = cpu_to_le32(sg_dma_address(sg));
> -			psg->sg[i].count = cpu_to_le32(sg_dma_len(sg));
> -			byte_count += sg_dma_len(sg);
> +			int count = sg_dma_len(sg);
> +			u32 addr = sg_dma_address(sg);
> +			if (host->max_sectors < AAC_MAX_32BIT_SGBCOUNT)
> +			while (count > 65536) {
> +				psg->sg[i].addr = cpu_to_le32(addr);
> +				psg->sg[i].count = cpu_to_le32(65536);
> +				++i;
> +				if (++sg_count > host->sg_tablesize) {
> +					BUG();
> +				}
> +				byte_count += 65536;
> +				addr += 65536;
> +				count -= 65536;
> +			}

This is wrong.  You're basically assuming the block layer is returning
something that goes over your segment descriptor size.

There's no API for this in SCSI, but what you should be doing is

blk_queue_max_segment_size(sdev->request_queue, 65536);

in your slave_configure routine.

James


-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux