Skip to contentSkip to conversation

megasas: LSI Megaraid SAS emulation

PATCH In review Hannes Reinecke 4 participants 7 messages Nov 18, 2010 – Nov 19, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 16/16 megasas: LSI Megaraid SAS emulation

This patch adds an emulation for the LSI Megaraid SAS HBA.

---
 Makefile.objs |    2 +-
 hw/megasas.c  | 1826 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/mfi.h      | 1197 +++++++++++++++++++++++++++++++++++++
 hw/pci_ids.h  |    2 +
 hw/scsi.h     |    1 +
 5 files changed, 3027 insertions(+), 1 deletions(-)
 create mode 100644 hw/megasas.c
 create mode 100644 hw/mfi.h
Makefile.objs +1 -1
index 15569af..54c6e02 100644
@@ -231,7 +231,7 @@ hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o
 hw-obj-$(CONFIG_IDE_VIA) += ide/via.o
 
 # SCSI layer
-hw-obj-y += lsi53c895a.o
+hw-obj-y += lsi53c895a.o megasas.o
 hw-obj-$(CONFIG_ESP) += esp.o
 
 hw-obj-y += dma-helpers.o sysbus.o isa-bus.o
hw/megasas.c new file +1826 -0

1,826 lines not on this page · raw message

hw/mfi.h new file +1197 -0

1,166 lines not on this page · raw message

hw/pci_ids.h +2 -0
index 82cba7e..6b9b54e 100644

Lines of this file are not shown. View the raw message.

hw/scsi.h +1 -0
index 10594de..7998ec5 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.1

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 18 lines · Hannes Reinecke

This patch adds an emulation for the LSI Megaraid SAS HBA.

---
 Makefile.objs |    2 +-
 hw/megasas.c  | 1826 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/mfi.h      | 1197 +++++++++++++++++++++++++++++++++++++
 hw/pci_ids.h  |    2 +
 hw/scsi.h     |    1 +
 5 files changed, 3027 insertions(+), 1 deletions(-)
 create mode 100644 hw/megasas.c
 create mode 100644 hw/mfi.h
Makefile.objs +0 -0
index 15569af..54c6e02 100644

Makefile.objs hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o · line 237

Quoted 8 lines
Makefile.objs +1 -1
@@ -231,7 +231,7 @@ hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o
 hw-obj-$(CONFIG_IDE_VIA) += ide/via.o
 
 # SCSI layer
-hw-obj-y += lsi53c895a.o
+hw-obj-y += lsi53c895a.o megasas.o
 hw-obj-$(CONFIG_ESP) += esp.o
 
 hw-obj-y += dma-helpers.o sysbus.o isa-bus.o

Just had a look through your patches and have to say nice work. Haven't tested it though, but looks like a good step in the right direction.

Only comment, as you are adding another SCSI driver, maybe it's time to make the driver selection configurable, rather than hard coding the build?

Cheers,
Jes

#2 lore raw
Quoted 26 lines · Jes Sorensen
Quoted 25 lines · Hannes Reinecke

This patch adds an emulation for the LSI Megaraid SAS HBA.

---
 Makefile.objs |    2 +-
 hw/megasas.c  | 1826 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/mfi.h      | 1197 +++++++++++++++++++++++++++++++++++++
 hw/pci_ids.h  |    2 +
 hw/scsi.h     |    1 +
 5 files changed, 3027 insertions(+), 1 deletions(-)
 create mode 100644 hw/megasas.c
 create mode 100644 hw/mfi.h
Makefile.objs +1 -1
index 15569af..54c6e02 100644
@@ -231,7 +231,7 @@ hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o
 hw-obj-$(CONFIG_IDE_VIA) += ide/via.o
 
 # SCSI layer
-hw-obj-y += lsi53c895a.o
+hw-obj-y += lsi53c895a.o megasas.o
 hw-obj-$(CONFIG_ESP) += esp.o
 
Quoted 7 lines

Makefile.objs hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o · line 237

Quoted 1 line
Makefile.objs +0 -0
 hw-obj-y += dma-helpers.o sysbus.o isa-bus.o

Just had a look through your patches and have to say nice work. Haven't tested it though, but looks like a good step in the right direction.

Only comment, as you are adding another SCSI driver, maybe it's time to make the driver selection configurable, rather than hard coding the build?

What do you mean by that?

We hardcode lsi53c895a in two places where we really mean "default SCSI controller type": pc_pci_device_init(), which applies to "-drive if=scsi", and qemu_pci_hot_add_storage(), which applies to "pci_add storage if=scsi". Not sure making that default configurable is worth it.

If you want more control than -drive and pci_add provice, use -device and device_add.

#3 lore raw
Quoted 38 lines · Markus Armbruster
Quoted 26 lines · Jes Sorensen
Quoted 25 lines · Hannes Reinecke

This patch adds an emulation for the LSI Megaraid SAS HBA.

---
 Makefile.objs |    2 +-
 hw/megasas.c  | 1826 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/mfi.h      | 1197 +++++++++++++++++++++++++++++++++++++
 hw/pci_ids.h  |    2 +
 hw/scsi.h     |    1 +
 5 files changed, 3027 insertions(+), 1 deletions(-)
 create mode 100644 hw/megasas.c
 create mode 100644 hw/mfi.h
Makefile.objs +1 -1
index 15569af..54c6e02 100644
@@ -231,7 +231,7 @@ hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o
 hw-obj-$(CONFIG_IDE_VIA) += ide/via.o
 
 # SCSI layer
-hw-obj-y += lsi53c895a.o
+hw-obj-y += lsi53c895a.o megasas.o
 hw-obj-$(CONFIG_ESP) += esp.o
 
Quoted 7 lines

Makefile.objs hw-obj-$(CONFIG_IDE_MACIO) += ide/macio.o · line 237

Quoted 1 line
Makefile.objs +0 -0
 hw-obj-y += dma-helpers.o sysbus.o isa-bus.o

Just had a look through your patches and have to say nice work. Haven't tested it though, but looks like a good step in the right direction.

Only comment, as you are adding another SCSI driver, maybe it's time to make the driver selection configurable, rather than hard coding the build?

What do you mean by that?

Quoted 8 lines

We hardcode lsi53c895a in two places where we really mean "default SCSI controller type": pc_pci_device_init(), which applies to "-drive if=scsi", and qemu_pci_hot_add_storage(), which applies to "pci_add storage if=scsi". Not sure making that default configurable is worth it.

If you want more control than -drive and pci_add provice, use -device and device_add.

Idea is probably to have megasas the default SCSI controller, if configured during compile time. Basically have a configure option '--scsi-hba=megasas' or somesuch.

But then, you can 'easily' select the megasas HBA nowadays with

-drive file=XXX,if=none,id=d1 \
-device megasas,id=m1 \
-device scsi-disk,drive=d1

So not sure if it's worthwhile.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
#4 lore raw
In reply to Markus Armbruster
Quoted 5 lines · Markus Armbruster
Quoted 2 lines

Only comment, as you are adding another SCSI driver, maybe it's time to make the driver selection configurable, rather than hard coding the build?

What do you mean by that?

Quoted 8 lines

We hardcode lsi53c895a in two places where we really mean "default SCSI controller type": pc_pci_device_init(), which applies to "-drive if=scsi", and qemu_pci_hot_add_storage(), which applies to "pci_add storage if=scsi". Not sure making that default configurable is worth it.

If you want more control than -drive and pci_add provice, use -device and device_add.

What I mean is for most other device types we allow to specify a list of wanted devices at the configure line, which is what I am suggesting we added support for for SCSI as well.

Cheers,
Jes

#5 lore raw
Quoted 12 lines · Jes Sorensen
Quoted 11 lines · Markus Armbruster
Quoted 2 lines

Only comment, as you are adding another SCSI driver, maybe it's time to make the driver selection configurable, rather than hard coding the build?

What do you mean by that?

We hardcode lsi53c895a in two places where we really mean "default SCSI controller type": pc_pci_device_init(), which applies to "-drive if=scsi", and qemu_pci_hot_add_storage(), which applies to "pci_add storage if=scsi". Not sure making that default configurable is worth it.

Quoted 6 lines
Quoted 2 lines

If you want more control than -drive and pci_add provice, use -device and device_add.

What I mean is for most other device types we allow to specify a list of wanted devices at the configure line, which is what I am suggesting we added support for for SCSI as well.

Oh, you mean something like:

hw-obj-$(CONFIG_MEGASAS) += megasas.o

with respective entries in default-config/*? Yeah, makes sense.

Alex

#6 lore raw
Quoted 11 lines · Alexander Graf
Quoted 3 lines · Jes Sorensen

What I mean is for most other device types we allow to specify a list of wanted devices at the configure line, which is what I am suggesting we added support for for SCSI as well.

Oh, you mean something like:

hw-obj-$(CONFIG_MEGASAS) += megasas.o

with respective entries in default-config/*? Yeah, makes sense.

Correct, and I suggest we add that for the 53c895 driver too.

Cheers,
Jes