Skip to contentSkip to conversation

SII SATA request size limit

DISCUSSION CASINO_E 4 participants 5 messages Sep 15, 2003

lore
Share & tools
lore

CASINO_E

author
#0 lore raw

Forgive me if I'm saying something stupid but, do you mean a special case for this controller in ide-dma.c:ide_build_dmatable()?

In this case, should not segment size and boundary be included in hwif so we can have a generic ide_build_dmatable() without dealing explicitly with special cases? We could initialize to the default for most controllers and set the values for the exceptions inside each particular driver.

----- Mensaje Original -----
De: Jens Axboe <[email protected]>
Fecha: Lunes, Septiembre 15, 2003 10:47 am
Asunto: Re: SII SATA request size limit

Quoted 29 lines · Eduardo Casino
Quoted 3 lines

Hi All,

I had a look at the NetBSD pciide.c driver and found this

interesting> bit of code:

Quoted 12 lines
	
	/*
	 * Rev. <= 0x01 of the 3112 have a bug that can cause data
	 * corruption if DMA transfers cross an 8K boundary.  This is
	 * apparently hard to tickle, but we'll go ahead and play it
	 * safe.
	 */
	if (PCI_REVISION(pa->pa_class) <= 0x01) {
	        sc->sc_dma_maxsegsz = 8192;
	        sc->sc_dma_boundary = 8192;
	}
Quoted 1 line

This is basically the same as setting hwif->rqsize to 15, but

the NetBSD

You can do much much better than that, it's pretty simply to just restrict the segment size and boundary if you have a controller with such a bug. And then you get the benefit of the larger requests too, it's basically not a performance hit at that point.

Signature · 1 line
Jens Axboe
#1 lore raw
Quoted 2 lines · CASINO_E

Forgive me if I'm saying something stupid but, do you mean a special case for this controller in ide-dma.c:ide_build_dmatable()?

No that's not stupid at all. In 2.4 that would be how you do it, in 2.6 I was referring to the possibility of letting the drive queues that hang off that controller be naturally limited. So you would do something ala

	if (hwif->dma_boundary)
		blk_queue_segment_boundary(drive->queue, 0x1fff);

and then no segment would be >= 8192 (or cross it, naturally) by default.

Quoted 5 lines

In this case, should not segment size and boundary be included in hwif so we can have a generic ide_build_dmatable() without dealing explicitly with special cases? We could initialize to the default for most controllers and set the values for the exceptions inside each particular driver.

Of course. But that is implementation detail, I was just worried that someone would clamp on a nasty work around like 15 sectors (which would in reality be just a 4kb request, nasty!) when you could get nice 128kb requests with just the right segment limiting instead.

But basically I don't understand why the work-around was _ever_ in sectors, if that is the bug in the hardware dma engine. Two
explanations: it's not really that bug and NetBSD is wrong, or the person who did the work-around didn't know a better solution existed (don't laugh, I wouldn't be surprised if something like that came down from a vendor :)

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 25 lines · Jens Axboe
Quoted 2 lines · CASINO_E

Forgive me if I'm saying something stupid but, do you mean a special case for this controller in ide-dma.c:ide_build_dmatable()?

No that's not stupid at all. In 2.4 that would be how you do it, in 2.6 I was referring to the possibility of letting the drive queues that hang off that controller be naturally limited. So you would do something ala

	if (hwif->dma_boundary)
		blk_queue_segment_boundary(drive->queue, 0x1fff);

and then no segment would be >= 8192 (or cross it, naturally) by default.

Quoted 5 lines

In this case, should not segment size and boundary be included in hwif so we can have a generic ide_build_dmatable() without dealing explicitly with special cases? We could initialize to the default for most controllers and set the values for the exceptions inside each particular driver.

Of course. But that is implementation detail, I was just worried that someone would clamp on a nasty work around like 15 sectors (which would in reality be just a 4kb request, nasty!) when you could get nice 128kb requests with just the right segment limiting instead.

Quoted 6 lines

But basically I don't understand why the work-around was _ever_ in sectors, if that is the bug in the hardware dma engine. Two
explanations: it's not really that bug and NetBSD is wrong, or the person who did the work-around didn't know a better solution existed (don't laugh, I wouldn't be surprised if something like that came down from a vendor :)

Unfortunately the bug isnt exactly this (apparently) and is only revealed under NDA (see Alan Cox's mail).

justin

#3 lore raw
Quoted 33 lines · Justin Cormack
Quoted 25 lines · Jens Axboe
Quoted 2 lines · CASINO_E

Forgive me if I'm saying something stupid but, do you mean a special case for this controller in ide-dma.c:ide_build_dmatable()?

No that's not stupid at all. In 2.4 that would be how you do it, in 2.6 I was referring to the possibility of letting the drive queues that hang off that controller be naturally limited. So you would do something ala

	if (hwif->dma_boundary)
		blk_queue_segment_boundary(drive->queue, 0x1fff);

and then no segment would be >= 8192 (or cross it, naturally) by default.

Quoted 5 lines

In this case, should not segment size and boundary be included in hwif so we can have a generic ide_build_dmatable() without dealing explicitly with special cases? We could initialize to the default for most controllers and set the values for the exceptions inside each particular driver.

Of course. But that is implementation detail, I was just worried that someone would clamp on a nasty work around like 15 sectors (which would in reality be just a 4kb request, nasty!) when you could get nice 128kb requests with just the right segment limiting instead.

Quoted 6 lines

But basically I don't understand why the work-around was _ever_ in sectors, if that is the bug in the hardware dma engine. Two
explanations: it's not really that bug and NetBSD is wrong, or the person who did the work-around didn't know a better solution existed (don't laugh, I wouldn't be surprised if something like that came down from a vendor :)

Quoted 2 lines

Unfortunately the bug isnt exactly this (apparently) and is only revealed under NDA (see Alan Cox's mail).

Just read Alans mails, doesn't really explain anything. But the segment patch must be close, if limiting max transfer size to 7.5K works. Which (in spirit, at least) is identical to the NetBSD work-around.

And why you would want to keep a work around like this under NDA (for a bug that completely cripples the hardware) I don't understand at all, seems pretty damn stupid to me. "Thanks for buying our hardware, yes it's buggy and we wont tell you what the bug is. Please come again!"

Signature · 1 line
Jens Axboe
#4 lore raw
In reply to Jens Axboe
Quoted 2 lines · Jens Axboe

But basically I don't understand why the work-around was _ever_ in sectors, if that is the bug in the hardware dma engine.

It is not a bug in the DMA engine. You will have to sign an SI NDA to find out more.