qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] igb: Add Function Level Reset to PF and VF
@ 2023-05-26 17:30 Cédric Le Goater
  2023-05-28 10:50 ` Sriram Yagnaraman
  0 siblings, 1 reply; 12+ messages in thread
From: Cédric Le Goater @ 2023-05-26 17:30 UTC (permalink / raw)
  To: qemu-devel
  Cc: Akihiko Odaki, Sriram Yagnaraman, Jason Wang,
	Cédric Le Goater

The Intel 82576EB GbE Controller say that the Physical and Virtual
Functions support Function Level Reset. Add the capability to each
device model.

Cc: Akihiko Odaki <akihiko.odaki@daynix.com>
Fixes: 3a977deebe6b ("Intrdocue igb device emulation")
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 hw/net/igb.c   | 3 +++
 hw/net/igbvf.c | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/hw/net/igb.c b/hw/net/igb.c
index 1c989d767725..08e389338dca 100644
--- a/hw/net/igb.c
+++ b/hw/net/igb.c
@@ -101,6 +101,7 @@ static void igb_write_config(PCIDevice *dev, uint32_t addr,
 
     trace_igb_write_config(addr, val, len);
     pci_default_write_config(dev, addr, val, len);
+    pcie_cap_flr_write_config(dev, addr, val, len);
 
     if (range_covers_byte(addr, len, PCI_COMMAND) &&
         (dev->config[PCI_COMMAND] & PCI_COMMAND_MASTER)) {
@@ -427,6 +428,8 @@ static void igb_pci_realize(PCIDevice *pci_dev, Error **errp)
     }
 
     /* PCIe extended capabilities (in order) */
+    pcie_cap_flr_init(pci_dev);
+
     if (pcie_aer_init(pci_dev, 1, 0x100, 0x40, errp) < 0) {
         hw_error("Failed to initialize AER capability");
     }
diff --git a/hw/net/igbvf.c b/hw/net/igbvf.c
index 284ea611848b..0a58dad06802 100644
--- a/hw/net/igbvf.c
+++ b/hw/net/igbvf.c
@@ -204,6 +204,7 @@ static void igbvf_write_config(PCIDevice *dev, uint32_t addr, uint32_t val,
 {
     trace_igbvf_write_config(addr, val, len);
     pci_default_write_config(dev, addr, val, len);
+    pcie_cap_flr_write_config(dev, addr, val, len);
 }
 
 static uint64_t igbvf_mmio_read(void *opaque, hwaddr addr, unsigned size)
@@ -266,6 +267,8 @@ static void igbvf_pci_realize(PCIDevice *dev, Error **errp)
         hw_error("Failed to initialize PCIe capability");
     }
 
+    pcie_cap_flr_init(dev);
+
     if (pcie_aer_init(dev, 1, 0x100, 0x40, errp) < 0) {
         hw_error("Failed to initialize AER capability");
     }
-- 
2.40.1



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

end of thread, other threads:[~2023-05-30 15:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-26 17:30 [PATCH] igb: Add Function Level Reset to PF and VF Cédric Le Goater
2023-05-28 10:50 ` Sriram Yagnaraman
2023-05-28 11:25   ` Sriram Yagnaraman
2023-05-29  2:45   ` Akihiko Odaki
2023-05-29  7:01     ` Cédric Le Goater
2023-05-29  7:45       ` Akihiko Odaki
2023-05-29 15:07         ` Cédric Le Goater
2023-05-30  2:02           ` Akihiko Odaki
2023-05-30  8:30             ` Sriram Yagnaraman
2023-05-30 12:30               ` Akihiko Odaki
2023-05-30 15:05                 ` Cédric Le Goater
2023-05-30 14:56             ` Cédric Le Goater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).