On 9/3/26 12:24 PM, Zhuoying Cai wrote:
Enable network booting via virtio-net-pci by implementing PCI transport
support for virtio-net.

This patch also extends endianness handling for virtio PCI ring operations in
little-endian to ensure correct behavior on s390x.

Signed-off-by: Zhuoying Cai <[email protected]>
---
[...]
@@ -199,6 +203,14 @@ static int virtio_pci_get_blk_config(void)
      return rc;
  }
+static int virtio_pci_get_net_config(void)
+{
+    VirtioNetConfig *cfg = &virtio_get_device()->config.net;
+    int rc = vpci_read_flex(d_cap.off, d_cap.bar, cfg, 
sizeof(VirtioNetConfig));
+
+    return rc;
+}
+

Nit:  Because all the other PCI device types require byte-swapping in the
config, I would like to see a comment here indicating that the only reason
the net config doesn't need any swapping is because the only field we use
is the MAC address, which is a byte array.  If the other net config fields
were ever to be used, they would need to be byte-swapped here.

Overall, looks good to me.

Reviewed-by: Jared Rossi <[email protected]>

Reply via email to