# Intel 6300ESB PATA/SATA VERY slow.

## nic01

Hi there. 

I'm installing gentoo on a Intel SE7210TP1-E server with some sort of ICH ide controller. The problem is, that the transfer rate is REALLY slow, 11 MB/s on the PATA controller and around 5 MB/s on the SATA controller with two brand new disks. 

Does anybody have any idear about what driver I should use, the Intel PIIXn?

I'm using kernel 2.6.6-mm3.

Here is my hdparm /dev/hda output:

```

/dev/hda:

 multcount    = 16 (on)

 IO_support   =  0 (default 16-bit)

 unmaskirq    =  0 (off)

 using_dma    =  1 (on)

 keepsettings =  0 (off)

 readonly     =  0 (off)

 readahead    = 256 (on)

 geometry     = 65535/16/63, sectors = 78165360, start = 0

```

And dmegs:

```

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

ICH5: IDE controller at PCI slot 0000:00:1f.1

ICH5: chipset revision 2

ICH5: not 100% native mode: will probe irqs later

    ide0: BM-DMA at 0xfc00-0xfc07, BIOS settings: hda:DMA, hdb:pio

    ide1: BM-DMA at 0xfc08-0xfc0f, BIOS settings: hdc:pio, hdd:pio

hda: WDC WD400JB-00ENA0, ATA DISK drive

Using anticipatory io scheduler

ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

hda: max request size: 128KiB

hda: 78165360 sectors (40020 MB) w/8192KiB Cache, CHS=65535/16/63, UDMA(33)

 /dev/ide/host0/bus0/target0/lun0: p1 p2 p3

```

/Nic

----------

## JonnyRo

I'm having serious problems with the 6300 sata controller.  I cant even get the drives to be detected except on the install cd (which uses the E-IDE driver.  

I think your drives are being detected using a generic method, and are pretty much gauranteed to be slow.  Hopefully there will be some more development for this controller.  Someone must have already figured it out because you could purchase Red Hat Enterprise Linux with the Dell PowerEdge 750 (which has this controller).

Keep me up to date on how your search for a resolution goes.  Right now I have a brand new server that is a paperweight because I cant get it's drives detected.

----------

## nic01

I know. Intel should provide proper opensource drivers, instead of the Red Hat Enterprise precompiled stuff.. I can hardly use my server with a max output of 8 MB/s on a SATA disk.

You might be able to change the BIOS controller setting to legacy ATA and see if that helps with the disks. 

Doesn't your drive gets detected as a /dev/sd*  device?? What kernel are you running?

/Nic

----------

## JonnyRo

On the gentoo livecd it gets detected as hdc and hdd, so it might already be in legacy mode.  However, no matter what kernel settings I try, the kernel I create during the install does not find the drives.

----------

## dt

I had the same problems - I have a new Dell Poweredge 700 machine which uses the same 6300 chipset. After banging my head against a wall for a few days I worked out that there is no support for this chipset in the newest kernels in the IDE drivers. The drives will only use a generic driver and as such DMA is not able to be turned on, hence the poor performance. This means that you cannot use these disks as '/dev/hd*' devices

The chipset is fully supported if you use the libata drivers, which are turned on in the SCSI section of the kernel configuration:

 Device Drivers -> SCSI Device Support -> SCSI Low Level Drivers

Add Serial ATA Support & Intel PIIX/ICH SATA support

The drives will then come up as /dev/sd* devices. 

This caused a problem for me, as I followed the normal installation procedure using the Gentoo 2004.1 live CD, which only has the 2.4 kernel. This used the generic ATA driver and brought up the disks as /dev/hdc and /dev/hdd. I configured a software RAID 1 on these disks, and as such migrating the raid to use /dev/sd* devices was not an easy task. What I had to do was boot of a Gentoo Live 2.6 CD which I found here:

http://gentoo.oregonstate.edu/experimental/x86/livecd/x86/

The disks came up as /dev/sd* devices, and I was able to reconfigure and remake the raid, then copy all tha data to it that I had previously backed up. I then made the appropriate change to /etc/fstab (for the swap partitions) and have been getting great performace ever since:

```
  hdparm -Tt /dev/md0

/dev/md0:

 Timing buffer-cache reads:   3444 MB in  2.00 seconds = 1721.40 MB/sec

 Timing buffered disk reads:  100 MB in  1.81 seconds =  55.23 MB/sec
```

I was previously getting about 5.5MB/sec, so am very happy with the 10-fold performance increase   :Very Happy: 

----------

## JonnyRo

Thanks for the info, i'll definately try this out tomorrow.  We should stay in touch since we have such similar servers.

We also picked up a Dell PowerEdge 2650 in this purchase batch.  That one worked out of the box just like a dream.

----------

## nic01

Thats odd.. I use the same Intel PIIX/ICH SATA driver in the kernel, but i get around 7 MB/s.

Do you have the PATA driver (ICHx) compiled in as well or just the SATA driver? I'm thinking it could be a conflict between the two drivers..

/Nic

[edit] hmm.. without the (P)ATA driver in the kernel, the speed is up to 18MB/s.. still need some tweaking i guess.. [/edit]

----------

## dt

I do have the PATA driver compiled in as well, but my experience has been that the SCSI (libata) driver takes precedence. What does dmesg say? Mine prints the following:

```
<---SNIP--->

libata version 1.02 loaded.

ata_piix version 1.01

ata_piix: combined mode detected

ata: 0x1f0 IDE port busy

PCI: Setting latency timer of device 0000:00:1f.2 to 64

ata1: SATA max UDMA/133 cmd 0x170 ctl 0x376 bmdma 0xFEA8 irq 15

ata1: dev 0 cfg 49:2f00 82:346b 83:7f01 84:4003 85:3469 86:3e01 87:4003 88:207f

ata1: dev 0 ATA, max UDMA/133, 156250000 sectors (lba48)

ata1: dev 1 cfg 49:2f00 82:346b 83:7f01 84:4003 85:3469 86:3e01 87:4003 88:207f

ata1: dev 1 ATA, max UDMA/133, 156250000 sectors (lba48)

ata1: dev 0 configured for UDMA/133

ata1: dev 1 configured for UDMA/133

scsi0 : ata_piix

  Vendor: ATA       Model: ST380011AS        Rev: 1.02

  Type:   Direct-Access                      ANSI SCSI revision: 05

  Vendor: ATA       Model: ST380011AS        Rev: 1.02

  Type:   Direct-Access                      ANSI SCSI revision: 05

SCSI device sda: 156250000 512-byte hdwr sectors (80000 MB)

SCSI device sda: drive cache: write through

 /dev/scsi/host0/bus0/target0/lun0: p1 p2 p3

Attached scsi disk sda at scsi0, channel 0, id 0, lun 0

SCSI device sdb: 156250000 512-byte hdwr sectors (80000 MB)

SCSI device sdb: drive cache: write through

 /dev/scsi/host0/bus0/target1/lun0: p1 p2 p3

Attached scsi disk sdb at scsi0, channel 0, id 1, lun 0

<---SNIP--->
```

I am using kernel 2.6.5 (from gentoo-dev-sources). The SCSI & libata requirements are compiled into the kernel - they are not built as modules.

----------

## nic01

Here is my dmegs, i noticed that the 

```
ata_piix version
```

 and 

```
SCSI device sda: drive cache: write back
```

 differs.

```
libata version 1.02 loaded.

ata_piix version 1.02

PCI: Setting latency timer of device 0000:00:1f.2 to 64

ata1: SATA max UDMA/133 cmd 0xE400 ctl 0xE002 bmdma 0xD400 irq 18

ata2: SATA max UDMA/133 cmd 0xDC00 ctl 0xD802 bmdma 0xD408 irq 18

ata1: dev 0 cfg 49:2f00 82:346b 83:7d01 84:4003 85:3469 86:3c01 87:4003 88:207f

ata1: dev 0 ATA, max UDMA/133, 312581808 sectors: lba48

ata1: dev 0 configured for UDMA/133

scsi0 : ata_piix

ata2: SATA port has no device.

scsi1 : ata_piix

Using anticipatory io scheduler

  Vendor: ATA       Model: ST3160023AS       Rev: 3.18

  Type:   Direct-Access                      ANSI SCSI revision: 05

SCSI device sda: 312581808 512-byte hdwr sectors (160042 MB)

SCSI device sda: drive cache: write back

 /dev/scsi/host0/bus0/target0/lun0: p1 p2 p3 < p5 p6 >

Attached scsi disk sda at scsi0, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

```

Right now i'm using 2.6.7-rc1..

----------

## JonnyRo

I am using a USB keyboard, so I cant page back up in the kernel messages when I try out my own custom compiled kernel?  Is this because it's a USB keyboard?  Will a PS/2 keyboard let me scroll back up?

It passes by too fast, and all I can see is the kernel panic message and those immediately preceeding.

As to the two drivers for ata conflicting, I have both compiled in and it appears to not be working.  I'm going to have to try several different options.

----------

## nic01

If you want the kernel messages just run 

```
#dmegs |less
```

 or check the /var/log/kernel.log logfile.

Sorry, didn't see you had a kernel panic.. You might want to run at 1024x786, you should then be able to see the kernel ouput before the panic.

/Nic

----------

## JonnyRo

I am happily running just fine using gentoo-sources-2.4.25-r1.  What was wrong was that I had SCSI disk support compiled as a module, even though further down in the low level drivers I had Serial ATA support compiled into the kernel.

So all that was required is that SCSI disk support was compiled directly into the kernel, and the Intel Serial ATA drivers in the SCSI low level drivers menu page.  Note that this option is not present in any of the later vanilla 2.4 kernels, and doesnt even show up in vanilla 2.4.27

The gentoo sources probably use patches derived from the patches intel hosts on their website at: intel.com

Those patches are against the 2.4.20 kernel.

The drives now show up as sda and sdb, where in the 2.4 install cd, they were showing up as hdc and hdd.  I'm soo happy to finally get this working on the 2.4 series, since I need to do some ipsec stuff, and that's a serious hastle on the 2.6 kernel series from what I can gather.

```

hdparm -tT /dev/sda

/dev/sda:

 Timing buffer-cache reads:   3604 MB in  2.00 seconds = 1802.00 MB/sec

 Timing buffered disk reads:  170 MB in  3.00 seconds =  56.67 MB/sec

 
```

----------

