Skip to contentSkip to conversation

Question: can we hot plug a PCIe switch on machine "virt"

Qemu-devel Heyi Guo 3 participants 7 messages Apr 3, 2019 – Apr 12, 2019

lore
Share & tools
lore

Heyi Guo

author
#0 lore raw

Hi folks,

In physical world, a PCIe switch including one upstream port and several downstream ports is a single physical device, however we treat each port as a device in qemu world. In qemu docs/pcie.txt, we have below statements:

Line 230: Be aware that PCI Express Downstream Ports can't be hot-plugged into Line 231: an existing PCI Express Upstream Port.

To my understanding, it implies PCIe downstream ports *can* be hot-plugged into something which is not an existing upstream port. If it is true, how can we do that? AFAIK monitor command device_add can only add one device at a time.

Please help to show the truth.

Thanks,

Heyi

#1 lore raw
Quoted 7 lines · Heyi Guo

Hi folks,

In physical world, a PCIe switch including one upstream port and several downstream ports is a single physical device, however we treat each port as a device in qemu world. In qemu docs/pcie.txt, we have below statements:

Line 230: Be aware that PCI Express Downstream Ports can't be hot-plugged into Line 231: an existing PCI Express Upstream Port.

Quoted 8 lines

To my understanding, it implies PCIe downstream ports *can* be hot-plugged into something which is not an existing upstream port. If it is true, how can we do that? AFAIK monitor command device_add can only add one device at a time.

Please help to show the truth.

Thanks,

Heyi

afaik they can only be plugged into upstearm ports with or without hotplug.

Signature · 1 line
mst
#2 lore raw

Hi Heyi,

Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Heyi Guo

Hi folks,

In physical world, a PCIe switch including one upstream port and several downstream ports is a single physical device, however we treat each port as a device in qemu world. In qemu docs/pcie.txt, we have below statements:

Line 230: Be aware that PCI Express Downstream Ports can't be hot-plugged into Line 231: an existing PCI Express Upstream Port.

To my understanding, it implies PCIe downstream ports *can* be hot-plugged into something which is not an existing upstream port. If it is true, how can we do that? AFAIK monitor command device_add can only add one device at a time.

Quoted 8 lines
Quoted 6 lines

Please help to show the truth.

Thanks,

Heyi

afaik they can only be plugged into upstearm ports with or without hotplug.

Hotplug on upstream port does not look supported, as mentionned in the doc:
(QEMU) device_add driver=xio3130-downstream id=down0 bus=upstream_port1 {"error": {"class": "GenericError", "desc": "Bus 'upstream_port1' does not support hotplugging"}}

Looks the std way to use the downstream port is the one documented in 2.2.3:

2.2.3 Plugging a PCI Express device into a Switch:
-device ioh3420,id=root_port1,chassis=x,slot=y[,bus=pcie.0][,addr=z] -device x3130-upstream,id=upstream_port1,bus=root_port1[,addr=x]
-device xio3130-downstream,id=downstream_port1,bus=upstream_port1,chassis=x1,slot=y1[,addr=z1]] -device <dev>,bus=downstream_port1

For my curiosity why do you want to hotplug a downstream port in another place than an upstream port?

Thanks

Eric

Quoted 1 line
author
#3 lore raw

Hi Eric,

My real interesting is about the hotplug of PCIe switch, which means we don't need to provide lots of PCIe root ports or PCIe down stream ports at the beginning, but we can extend the capacity by hot adding PCIe switches which can provide more hot-pluggable slots for endpoint devices.

The document docs/pcie.txt says "PCI Express Downstream Ports can't be hot-plugged into an existing PCI Express Upstream Port" which confuses me. Does it actually mean Downstream Ports can't be hot-plugged? For they can't be hot-plugged into an existing Upstream Port as the doc says, either they can't be hot-plugged into an non-existing Upstream Port or another place...

Thanks,

Heyi

Quoted 44 lines · Auger Eric

Hi Heyi,

Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Heyi Guo

Hi folks,

In physical world, a PCIe switch including one upstream port and several downstream ports is a single physical device, however we treat each port as a device in qemu world. In qemu docs/pcie.txt, we have below statements:

Line 230: Be aware that PCI Express Downstream Ports can't be hot-plugged into Line 231: an existing PCI Express Upstream Port.

To my understanding, it implies PCIe downstream ports *can* be hot-plugged into something which is not an existing upstream port. If it is true, how can we do that? AFAIK monitor command device_add can only add one device at a time.

Quoted 7 lines
Quoted 6 lines

Please help to show the truth.

Thanks,

Heyi

afaik they can only be plugged into upstearm ports with or without hotplug.

Hotplug on upstream port does not look supported, as mentionned in the doc:
(QEMU) device_add driver=xio3130-downstream id=down0 bus=upstream_port1 {"error": {"class": "GenericError", "desc": "Bus 'upstream_port1' does not support hotplugging"}}

Looks the std way to use the downstream port is the one documented in 2.2.3:

2.2.3 Plugging a PCI Express device into a Switch:

(quoted diff) +0 -3
-device ioh3420,id=root_port1,chassis=x,slot=y[,bus=pcie.0][,addr=z]
-device x3130-upstream,id=upstream_port1,bus=root_port1[,addr=x]
-device

xio3130-downstream,id=downstream_port1,bus=upstream_port1,chassis=x1,slot=y1[,addr=z1]] -device <dev>,bus=downstream_port1

For my curiosity why do you want to hotplug a downstream port in another place than an upstream port?

Thanks

Eric

.

author
#4 lore raw

Hi Eric,

Could you help to confirm?

Thanks,

Heyi

Quoted 57 lines · Heyi Guo

Hi Eric,

My real interesting is about the hotplug of PCIe switch, which means we don't need to provide lots of PCIe root ports or PCIe down stream ports at the beginning, but we can extend the capacity by hot adding PCIe switches which can provide more hot-pluggable slots for endpoint devices.

The document docs/pcie.txt says "PCI Express Downstream Ports can't be hot-plugged into an existing PCI Express Upstream Port" which confuses me. Does it actually mean Downstream Ports can't be hot-plugged? For they can't be hot-plugged into an existing Upstream Port as the doc says, either they can't be hot-plugged into an non-existing Upstream Port or another place...

Thanks,

Heyi

Quoted 44 lines · Auger Eric

Hi Heyi,

Quoted 10 lines · Michael S. Tsirkin
Quoted 9 lines · Heyi Guo

Hi folks,

In physical world, a PCIe switch including one upstream port and several downstream ports is a single physical device, however we treat each port as a device in qemu world. In qemu docs/pcie.txt, we have below statements:

Line 230: Be aware that PCI Express Downstream Ports can't be hot-plugged into Line 231: an existing PCI Express Upstream Port.

To my understanding, it implies PCIe downstream ports *can* be hot-plugged into something which is not an existing upstream port. If it is true, how can we do that? AFAIK monitor command device_add can only add one device at a time.

Quoted 7 lines
Quoted 6 lines

Please help to show the truth.

Thanks,

Heyi

afaik they can only be plugged into upstearm ports with or without hotplug.

Hotplug on upstream port does not look supported, as mentionned in the doc:
(QEMU) device_add driver=xio3130-downstream id=down0 bus=upstream_port1 {"error": {"class": "GenericError", "desc": "Bus 'upstream_port1' does not support hotplugging"}}

Looks the std way to use the downstream port is the one documented in 2.2.3:

2.2.3 Plugging a PCI Express device into a Switch:

(quoted diff) +0 -3
-device ioh3420,id=root_port1,chassis=x,slot=y[,bus=pcie.0][,addr=z]
-device x3130-upstream,id=upstream_port1,bus=root_port1[,addr=x]
-device

xio3130-downstream,id=downstream_port1,bus=upstream_port1,chassis=x1,slot=y1[,addr=z1]] -device <dev>,bus=downstream_port1

For my curiosity why do you want to hotplug a downstream port in another place than an upstream port?

Thanks

Eric

.

#5 lore raw

Hi Heyi,

Quoted 3 lines · Heyi Guo

Hi Eric,

Could you help to confirm?

Practically I have not tried anything else than hot-plugging the downstream port downstream to the upstream port. This looks not supported as documented.

Michael answered that up to him, the downstream port could only be plugged downto the upstream port.

On my side I have not aware of any usage of the downstream port outside of the switch's scope.

Thanks

Eric

Quoted 86 lines

Thanks,

Heyi

Quoted 77 lines · Heyi Guo

Hi Eric,

My real interesting is about the hotplug of PCIe switch, which means we don't need to provide lots of PCIe root ports or PCIe down stream ports at the beginning, but we can extend the capacity by hot adding PCIe switches which can provide more hot-pluggable slots for endpoint devices.

The document docs/pcie.txt says "PCI Express Downstream Ports can't be hot-plugged into an existing PCI Express Upstream Port" which confuses me. Does it actually mean Downstream Ports can't be hot-plugged? For they can't be hot-plugged into an existing Upstream Port as the doc says, either they can't be hot-plugged into an non-existing Upstream Port or another place...

Thanks,

Heyi

Quoted 55 lines · Auger Eric

Hi Heyi,

Quoted 17 lines · Michael S. Tsirkin
Quoted 16 lines · Heyi Guo

Hi folks,

In physical world, a PCIe switch including one upstream port and several downstream ports is a single physical device, however we treat each port as a device in qemu world. In qemu docs/pcie.txt, we have below statements:

Line 230: Be aware that PCI Express Downstream Ports can't be hot-plugged into
Line 231: an existing PCI Express Upstream Port.

To my understanding, it implies PCIe downstream ports *can* be hot-plugged into something which is not an existing upstream port. If it is true, how can we do that? AFAIK monitor command device_add can only add one device at a time.

Quoted 8 lines
Quoted 6 lines

Please help to show the truth.

Thanks,

Heyi

afaik they can only be plugged into upstearm ports with or without hotplug.

Hotplug on upstream port does not look supported, as mentionned in the doc:
(QEMU) device_add driver=xio3130-downstream id=down0 bus=upstream_port1 {"error": {"class": "GenericError", "desc": "Bus 'upstream_port1' does not support hotplugging"}}

Looks the std way to use the downstream port is the one documented in 2.2.3:

2.2.3 Plugging a PCI Express device into a Switch:

(quoted diff) +0 -3
-device ioh3420,id=root_port1,chassis=x,slot=y[,bus=pcie.0][,addr=z]
-device x3130-upstream,id=upstream_port1,bus=root_port1[,addr=x]
-device

xio3130-downstream,id=downstream_port1,bus=upstream_port1,chassis=x1,slot=y1[,addr=z1]]

-device <dev>,bus=downstream_port1

For my curiosity why do you want to hotplug a downstream port in another place than an upstream port?

Thanks

Eric

.

author
#6 lore raw

Hi Eric and Michael,

Appreciate your sharing of this information. But sorry I'm still a little confused due to my poor English...

Quoted 9 lines · Auger Eric

Hi Heyi,

Quoted 3 lines · Heyi Guo

Hi Eric,

Could you help to confirm?

Practically I have not tried anything else than hot-plugging the downstream port downstream to the upstream port. This looks not supported as documented.

Do you mean you *have* tried hot-plugging the downstream port to the upstream port? Have you succeeded? Could you tell how to do that?

Quoted 3 lines

Michael answered that up to him, the downstream port could only be plugged downto the upstream port.

Is only code-plugging supported here, or hot-plugging is supported as well?

Thanks,
Heyi

Quoted 92 lines

On my side I have not aware of any usage of the downstream port outside of the switch's scope.

Thanks

Eric

Quoted 75 lines

Thanks,

Heyi

Quoted 69 lines · Heyi Guo

Hi Eric,

My real interesting is about the hotplug of PCIe switch, which means we don't need to provide lots of PCIe root ports or PCIe down stream ports at the beginning, but we can extend the capacity by hot adding PCIe switches which can provide more hot-pluggable slots for endpoint devices.

The document docs/pcie.txt says "PCI Express Downstream Ports can't be hot-plugged into an existing PCI Express Upstream Port" which confuses me. Does it actually mean Downstream Ports can't be hot-plugged? For they can't be hot-plugged into an existing Upstream Port as the doc says, either they can't be hot-plugged into an non-existing Upstream Port or another place...

Thanks,

Heyi

Quoted 48 lines · Auger Eric

Hi Heyi,

Quoted 17 lines · Michael S. Tsirkin
Quoted 16 lines · Heyi Guo

Hi folks,

In physical world, a PCIe switch including one upstream port and several downstream ports is a single physical device, however we treat each port as a device in qemu world. In qemu docs/pcie.txt, we have below statements:

Line 230: Be aware that PCI Express Downstream Ports can't be hot-plugged into
Line 231: an existing PCI Express Upstream Port.

To my understanding, it implies PCIe downstream ports *can* be hot-plugged into something which is not an existing upstream port. If it is true, how can we do that? AFAIK monitor command device_add can only add one device at a time.

Quoted 8 lines
Quoted 6 lines

Please help to show the truth.

Thanks,

Heyi

afaik they can only be plugged into upstearm ports with or without hotplug.

Hotplug on upstream port does not look supported, as mentionned in the doc:
(QEMU) device_add driver=xio3130-downstream id=down0 bus=upstream_port1 {"error": {"class": "GenericError", "desc": "Bus 'upstream_port1' does not support hotplugging"}}

Looks the std way to use the downstream port is the one documented in 2.2.3:

2.2.3 Plugging a PCI Express device into a Switch:

(quoted diff) +0 -3
-device ioh3420,id=root_port1,chassis=x,slot=y[,bus=pcie.0][,addr=z]
-device x3130-upstream,id=upstream_port1,bus=root_port1[,addr=x]
-device

xio3130-downstream,id=downstream_port1,bus=upstream_port1,chassis=x1,slot=y1[,addr=z1]]

-device <dev>,bus=downstream_port1

For my curiosity why do you want to hotplug a downstream port in another place than an upstream port?

Quoted 8 lines
Quoted 7 lines
Quoted 7 lines

Thanks

Eric

.

.