All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel]  [PATCH] hw/pxb: add chassis_nr property
@ 2015-06-18 17:49 Marcel Apfelbaum
  2015-06-28 15:17 ` Marcel Apfelbaum
  0 siblings, 1 reply; 4+ messages in thread
From: Marcel Apfelbaum @ 2015-06-18 17:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcel, mst

Add a chassis_nr property Instead of using PXB bus number
as internal bridge's chassis nr.

Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
---
 docs/pci_expander_bridge.txt        | 7 +++----
 hw/pci-bridge/pci_expander_bridge.c | 5 ++++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/docs/pci_expander_bridge.txt b/docs/pci_expander_bridge.txt
index d7913fb..bc5be05 100644
--- a/docs/pci_expander_bridge.txt
+++ b/docs/pci_expander_bridge.txt
@@ -23,9 +23,9 @@ A detailed command line would be:
 -m 2G
 -object memory-backend-ram,size=1024M,policy=bind,host-nodes=0,id=ram-node0 -numa node,nodeid=0,cpus=0,memdev=ram-node0
 -object memory-backend-ram,size=1024M,policy=bind,host-nodes=1,id=ram-node1 -numa node,nodeid=1,cpus=1,memdev=ram-node1
--device pxb,id=bridge1,bus=pci.0,numa_node=1,bus_nr=4 -netdev user,id=nd-device e1000,bus=bridge1,addr=0x4,netdev=nd
--device pxb,id=bridge2,bus=pci.0,numa_node=0,bus_nr=8,bus=pci.0 -device e1000,bus=bridge2,addr=0x3
--device pxb,id=bridge3,bus=pci.0,bus_nr=40,bus=pci.0 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,scsi=off,bus=bridge3,addr=1
+-device pxb,id=bridge1,bus=pci.0,numa_node=1,bus_nr=4,chassis_nr=4 -netdev user,id=nd-device e1000,bus=bridge1,addr=0x4,netdev=nd
+-device pxb,id=bridge2,bus=pci.0,numa_node=0,bus_nr=8,bus=pci.0,chassis_nr=8 -device e1000,bus=bridge2,addr=0x3
+-device pxb,id=bridge3,bus=pci.0,bus_nr=40,bus=pci.0,chassis_nr=40 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,scsi=off,bus=bridge3,addr=1
 
 Here you have:
  - 2 NUMA nodes for the guest, 0 and 1. (both mapped to the same NUMA node in host, but you can and should put it in different host NUMA nodes)
@@ -55,4 +55,3 @@ The PXB is composed by:
   - Using the bridge will enable hotplug support
   - All the devices behind the bridge will use bridge's IO/MEM windows compacting
     the PCI address space.
-
diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
index ec2bb45..62756d1 100644
--- a/hw/pci-bridge/pci_expander_bridge.c
+++ b/hw/pci-bridge/pci_expander_bridge.c
@@ -38,6 +38,7 @@ typedef struct PXBDev {
     PCIDevice parent_obj;
     /*< public >*/
 
+    uint8_t chassis_nr;
     uint8_t bus_nr;
     uint16_t numa_node;
 } PXBDev;
@@ -175,7 +176,7 @@ static int pxb_dev_initfn(PCIDevice *dev)
 
     bds = qdev_create(BUS(bus), "pci-bridge");
     bds->id = dev_name;
-    qdev_prop_set_uint8(bds, "chassis_nr", pxb->bus_nr);
+    qdev_prop_set_uint8(bds, "chassis_nr", pxb->chassis_nr);
 
     PCI_HOST_BRIDGE(ds)->bus = bus;
 
@@ -194,6 +195,8 @@ static int pxb_dev_initfn(PCIDevice *dev)
 }
 
 static Property pxb_dev_properties[] = {
+    /* Note: 0 is not a legal chassis number. */
+    DEFINE_PROP_UINT8("chassis_nr", PXBDev, chassis_nr, 0),
     /* Note: 0 is not a legal a PXB bus number. */
     DEFINE_PROP_UINT8("bus_nr", PXBDev, bus_nr, 0),
     DEFINE_PROP_UINT16("numa_node", PXBDev, numa_node, NUMA_NODE_UNASSIGNED),
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/pxb: add chassis_nr property
  2015-06-18 17:49 [Qemu-devel] [PATCH] hw/pxb: add chassis_nr property Marcel Apfelbaum
@ 2015-06-28 15:17 ` Marcel Apfelbaum
  2015-07-13 10:35   ` Marcel Apfelbaum
  0 siblings, 1 reply; 4+ messages in thread
From: Marcel Apfelbaum @ 2015-06-28 15:17 UTC (permalink / raw)
  To: Marcel Apfelbaum, qemu-devel; +Cc: mst

On 06/18/2015 08:49 PM, Marcel Apfelbaum wrote:
> Add a chassis_nr property Instead of using PXB bus number
> as internal bridge's chassis nr.
ping

I think this should be part of 2.4.

Thanks,
Marcel

>
> Suggested-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
> ---
>   docs/pci_expander_bridge.txt        | 7 +++----
>   hw/pci-bridge/pci_expander_bridge.c | 5 ++++-
>   2 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/docs/pci_expander_bridge.txt b/docs/pci_expander_bridge.txt
> index d7913fb..bc5be05 100644
> --- a/docs/pci_expander_bridge.txt
> +++ b/docs/pci_expander_bridge.txt
> @@ -23,9 +23,9 @@ A detailed command line would be:
>   -m 2G
>   -object memory-backend-ram,size=1024M,policy=bind,host-nodes=0,id=ram-node0 -numa node,nodeid=0,cpus=0,memdev=ram-node0
>   -object memory-backend-ram,size=1024M,policy=bind,host-nodes=1,id=ram-node1 -numa node,nodeid=1,cpus=1,memdev=ram-node1
> --device pxb,id=bridge1,bus=pci.0,numa_node=1,bus_nr=4 -netdev user,id=nd-device e1000,bus=bridge1,addr=0x4,netdev=nd
> --device pxb,id=bridge2,bus=pci.0,numa_node=0,bus_nr=8,bus=pci.0 -device e1000,bus=bridge2,addr=0x3
> --device pxb,id=bridge3,bus=pci.0,bus_nr=40,bus=pci.0 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,scsi=off,bus=bridge3,addr=1
> +-device pxb,id=bridge1,bus=pci.0,numa_node=1,bus_nr=4,chassis_nr=4 -netdev user,id=nd-device e1000,bus=bridge1,addr=0x4,netdev=nd
> +-device pxb,id=bridge2,bus=pci.0,numa_node=0,bus_nr=8,bus=pci.0,chassis_nr=8 -device e1000,bus=bridge2,addr=0x3
> +-device pxb,id=bridge3,bus=pci.0,bus_nr=40,bus=pci.0,chassis_nr=40 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,scsi=off,bus=bridge3,addr=1
>
>   Here you have:
>    - 2 NUMA nodes for the guest, 0 and 1. (both mapped to the same NUMA node in host, but you can and should put it in different host NUMA nodes)
> @@ -55,4 +55,3 @@ The PXB is composed by:
>     - Using the bridge will enable hotplug support
>     - All the devices behind the bridge will use bridge's IO/MEM windows compacting
>       the PCI address space.
> -
> diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
> index ec2bb45..62756d1 100644
> --- a/hw/pci-bridge/pci_expander_bridge.c
> +++ b/hw/pci-bridge/pci_expander_bridge.c
> @@ -38,6 +38,7 @@ typedef struct PXBDev {
>       PCIDevice parent_obj;
>       /*< public >*/
>
> +    uint8_t chassis_nr;
>       uint8_t bus_nr;
>       uint16_t numa_node;
>   } PXBDev;
> @@ -175,7 +176,7 @@ static int pxb_dev_initfn(PCIDevice *dev)
>
>       bds = qdev_create(BUS(bus), "pci-bridge");
>       bds->id = dev_name;
> -    qdev_prop_set_uint8(bds, "chassis_nr", pxb->bus_nr);
> +    qdev_prop_set_uint8(bds, "chassis_nr", pxb->chassis_nr);
>
>       PCI_HOST_BRIDGE(ds)->bus = bus;
>
> @@ -194,6 +195,8 @@ static int pxb_dev_initfn(PCIDevice *dev)
>   }
>
>   static Property pxb_dev_properties[] = {
> +    /* Note: 0 is not a legal chassis number. */
> +    DEFINE_PROP_UINT8("chassis_nr", PXBDev, chassis_nr, 0),
>       /* Note: 0 is not a legal a PXB bus number. */
>       DEFINE_PROP_UINT8("bus_nr", PXBDev, bus_nr, 0),
>       DEFINE_PROP_UINT16("numa_node", PXBDev, numa_node, NUMA_NODE_UNASSIGNED),
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/pxb: add chassis_nr property
  2015-06-28 15:17 ` Marcel Apfelbaum
@ 2015-07-13 10:35   ` Marcel Apfelbaum
  2015-07-14  5:08     ` Michael S. Tsirkin
  0 siblings, 1 reply; 4+ messages in thread
From: Marcel Apfelbaum @ 2015-07-13 10:35 UTC (permalink / raw)
  To: Marcel Apfelbaum, qemu-devel; +Cc: mst

On 06/28/2015 06:17 PM, Marcel Apfelbaum wrote:
> On 06/18/2015 08:49 PM, Marcel Apfelbaum wrote:
>> Add a chassis_nr property Instead of using PXB bus number
>> as internal bridge's chassis nr.
> ping
>
> I think this should be part of 2.4.
ping ^^^^^

Thanks,
Marcel

>
> Thanks,
> Marcel
>
>>
>> Suggested-by: Michael S. Tsirkin <mst@redhat.com>
>> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
>> ---
>>   docs/pci_expander_bridge.txt        | 7 +++----
>>   hw/pci-bridge/pci_expander_bridge.c | 5 ++++-
>>   2 files changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/docs/pci_expander_bridge.txt b/docs/pci_expander_bridge.txt
>> index d7913fb..bc5be05 100644
>> --- a/docs/pci_expander_bridge.txt
>> +++ b/docs/pci_expander_bridge.txt
>> @@ -23,9 +23,9 @@ A detailed command line would be:
>>   -m 2G
>>   -object memory-backend-ram,size=1024M,policy=bind,host-nodes=0,id=ram-node0 -numa node,nodeid=0,cpus=0,memdev=ram-node0
>>   -object memory-backend-ram,size=1024M,policy=bind,host-nodes=1,id=ram-node1 -numa node,nodeid=1,cpus=1,memdev=ram-node1
>> --device pxb,id=bridge1,bus=pci.0,numa_node=1,bus_nr=4 -netdev user,id=nd-device e1000,bus=bridge1,addr=0x4,netdev=nd
>> --device pxb,id=bridge2,bus=pci.0,numa_node=0,bus_nr=8,bus=pci.0 -device e1000,bus=bridge2,addr=0x3
>> --device pxb,id=bridge3,bus=pci.0,bus_nr=40,bus=pci.0 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,scsi=off,bus=bridge3,addr=1
>> +-device pxb,id=bridge1,bus=pci.0,numa_node=1,bus_nr=4,chassis_nr=4 -netdev user,id=nd-device e1000,bus=bridge1,addr=0x4,netdev=nd
>> +-device pxb,id=bridge2,bus=pci.0,numa_node=0,bus_nr=8,bus=pci.0,chassis_nr=8 -device e1000,bus=bridge2,addr=0x3
>> +-device pxb,id=bridge3,bus=pci.0,bus_nr=40,bus=pci.0,chassis_nr=40 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,scsi=off,bus=bridge3,addr=1
>>
>>   Here you have:
>>    - 2 NUMA nodes for the guest, 0 and 1. (both mapped to the same NUMA node in host, but you can and should put it in different host NUMA nodes)
>> @@ -55,4 +55,3 @@ The PXB is composed by:
>>     - Using the bridge will enable hotplug support
>>     - All the devices behind the bridge will use bridge's IO/MEM windows compacting
>>       the PCI address space.
>> -
>> diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
>> index ec2bb45..62756d1 100644
>> --- a/hw/pci-bridge/pci_expander_bridge.c
>> +++ b/hw/pci-bridge/pci_expander_bridge.c
>> @@ -38,6 +38,7 @@ typedef struct PXBDev {
>>       PCIDevice parent_obj;
>>       /*< public >*/
>>
>> +    uint8_t chassis_nr;
>>       uint8_t bus_nr;
>>       uint16_t numa_node;
>>   } PXBDev;
>> @@ -175,7 +176,7 @@ static int pxb_dev_initfn(PCIDevice *dev)
>>
>>       bds = qdev_create(BUS(bus), "pci-bridge");
>>       bds->id = dev_name;
>> -    qdev_prop_set_uint8(bds, "chassis_nr", pxb->bus_nr);
>> +    qdev_prop_set_uint8(bds, "chassis_nr", pxb->chassis_nr);
>>
>>       PCI_HOST_BRIDGE(ds)->bus = bus;
>>
>> @@ -194,6 +195,8 @@ static int pxb_dev_initfn(PCIDevice *dev)
>>   }
>>
>>   static Property pxb_dev_properties[] = {
>> +    /* Note: 0 is not a legal chassis number. */
>> +    DEFINE_PROP_UINT8("chassis_nr", PXBDev, chassis_nr, 0),
>>       /* Note: 0 is not a legal a PXB bus number. */
>>       DEFINE_PROP_UINT8("bus_nr", PXBDev, bus_nr, 0),
>>       DEFINE_PROP_UINT16("numa_node", PXBDev, numa_node, NUMA_NODE_UNASSIGNED),
>>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/pxb: add chassis_nr property
  2015-07-13 10:35   ` Marcel Apfelbaum
@ 2015-07-14  5:08     ` Michael S. Tsirkin
  0 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2015-07-14  5:08 UTC (permalink / raw)
  To: marcel; +Cc: qemu-devel

On Mon, Jul 13, 2015 at 01:35:09PM +0300, Marcel Apfelbaum wrote:
> On 06/28/2015 06:17 PM, Marcel Apfelbaum wrote:
> >On 06/18/2015 08:49 PM, Marcel Apfelbaum wrote:
> >>Add a chassis_nr property Instead of using PXB bus number
> >>as internal bridge's chassis nr.
> >ping
> >
> >I think this should be part of 2.4.
> ping ^^^^^
> 
> Thanks,
> Marcel

This doesn't apply anymore, I assumed it's no longer needed.
Can you rebase and repost please?


> >
> >Thanks,
> >Marcel
> >
> >>
> >>Suggested-by: Michael S. Tsirkin <mst@redhat.com>
> >>Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
> >>---
> >>  docs/pci_expander_bridge.txt        | 7 +++----
> >>  hw/pci-bridge/pci_expander_bridge.c | 5 ++++-
> >>  2 files changed, 7 insertions(+), 5 deletions(-)
> >>
> >>diff --git a/docs/pci_expander_bridge.txt b/docs/pci_expander_bridge.txt
> >>index d7913fb..bc5be05 100644
> >>--- a/docs/pci_expander_bridge.txt
> >>+++ b/docs/pci_expander_bridge.txt
> >>@@ -23,9 +23,9 @@ A detailed command line would be:
> >>  -m 2G
> >>  -object memory-backend-ram,size=1024M,policy=bind,host-nodes=0,id=ram-node0 -numa node,nodeid=0,cpus=0,memdev=ram-node0
> >>  -object memory-backend-ram,size=1024M,policy=bind,host-nodes=1,id=ram-node1 -numa node,nodeid=1,cpus=1,memdev=ram-node1
> >>--device pxb,id=bridge1,bus=pci.0,numa_node=1,bus_nr=4 -netdev user,id=nd-device e1000,bus=bridge1,addr=0x4,netdev=nd
> >>--device pxb,id=bridge2,bus=pci.0,numa_node=0,bus_nr=8,bus=pci.0 -device e1000,bus=bridge2,addr=0x3
> >>--device pxb,id=bridge3,bus=pci.0,bus_nr=40,bus=pci.0 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,scsi=off,bus=bridge3,addr=1
> >>+-device pxb,id=bridge1,bus=pci.0,numa_node=1,bus_nr=4,chassis_nr=4 -netdev user,id=nd-device e1000,bus=bridge1,addr=0x4,netdev=nd
> >>+-device pxb,id=bridge2,bus=pci.0,numa_node=0,bus_nr=8,bus=pci.0,chassis_nr=8 -device e1000,bus=bridge2,addr=0x3
> >>+-device pxb,id=bridge3,bus=pci.0,bus_nr=40,bus=pci.0,chassis_nr=40 -drive if=none,id=drive0,file=[img] -device virtio-blk-pci,drive=drive0,scsi=off,bus=bridge3,addr=1
> >>
> >>  Here you have:
> >>   - 2 NUMA nodes for the guest, 0 and 1. (both mapped to the same NUMA node in host, but you can and should put it in different host NUMA nodes)
> >>@@ -55,4 +55,3 @@ The PXB is composed by:
> >>    - Using the bridge will enable hotplug support
> >>    - All the devices behind the bridge will use bridge's IO/MEM windows compacting
> >>      the PCI address space.
> >>-
> >>diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c
> >>index ec2bb45..62756d1 100644
> >>--- a/hw/pci-bridge/pci_expander_bridge.c
> >>+++ b/hw/pci-bridge/pci_expander_bridge.c
> >>@@ -38,6 +38,7 @@ typedef struct PXBDev {
> >>      PCIDevice parent_obj;
> >>      /*< public >*/
> >>
> >>+    uint8_t chassis_nr;
> >>      uint8_t bus_nr;
> >>      uint16_t numa_node;
> >>  } PXBDev;
> >>@@ -175,7 +176,7 @@ static int pxb_dev_initfn(PCIDevice *dev)
> >>
> >>      bds = qdev_create(BUS(bus), "pci-bridge");
> >>      bds->id = dev_name;
> >>-    qdev_prop_set_uint8(bds, "chassis_nr", pxb->bus_nr);
> >>+    qdev_prop_set_uint8(bds, "chassis_nr", pxb->chassis_nr);
> >>
> >>      PCI_HOST_BRIDGE(ds)->bus = bus;
> >>
> >>@@ -194,6 +195,8 @@ static int pxb_dev_initfn(PCIDevice *dev)
> >>  }
> >>
> >>  static Property pxb_dev_properties[] = {
> >>+    /* Note: 0 is not a legal chassis number. */
> >>+    DEFINE_PROP_UINT8("chassis_nr", PXBDev, chassis_nr, 0),
> >>      /* Note: 0 is not a legal a PXB bus number. */
> >>      DEFINE_PROP_UINT8("bus_nr", PXBDev, bus_nr, 0),
> >>      DEFINE_PROP_UINT16("numa_node", PXBDev, numa_node, NUMA_NODE_UNASSIGNED),
> >>
> >

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-14  5:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-18 17:49 [Qemu-devel] [PATCH] hw/pxb: add chassis_nr property Marcel Apfelbaum
2015-06-28 15:17 ` Marcel Apfelbaum
2015-07-13 10:35   ` Marcel Apfelbaum
2015-07-14  5:08     ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.