On 9/14/26 3:34 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]>
> Reviewed-by: Jared Rossi <[email protected]>
> ---
>  pc-bios/s390-ccw/main.c       |  1 +
>  pc-bios/s390-ccw/netmain.c    |  9 +++++++-
>  pc-bios/s390-ccw/virtio-net.c | 41 ++++++++++++++++++++++++++++-------
>  pc-bios/s390-ccw/virtio-pci.c | 20 +++++++++++++++++
>  4 files changed, 62 insertions(+), 9 deletions(-)
> 
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index 8fc1cbf653..28cab3b411 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -332,6 +332,7 @@ static void ipl_pci_device(void)
>      }
>  
>      switch (vdev->dev_type) {
> +    case VIRTIO_ID_NET:

block, scsi (when you rebase on top of Jared's series) and now net will
all use the exact same code here by falling through.

How about a comment block above the switch statement explaining they all
intentionally fall through / use the same shared setup

>      case VIRTIO_ID_BLOCK:
>          if (virtio_setup() == 0) {
>              zipl_load(); /* only return on error */
> diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c
> index bcb62bf6ca..e42e049063 100644
> --- a/pc-bios/s390-ccw/netmain.c
> +++ b/pc-bios/s390-ccw/netmain.c
> @@ -498,7 +498,14 @@ int netmain(void)
>      sclp_setup();
>      puts("Network boot starting...");
>  
> -    if (!virtio_ccw_net_setup()) {
> +    /*
> +     * CCW devices require subchannel enumeration here.
> +     * PCI devices don't require specific setup: the transport is already
> +     * initialized by ipl_pci_device(), and virtio_is_supported() is checked
> +     * later in virtio_net_init().
> +     */

This comment seems not quite accurate?

AFAICT ipl_pci_device() is just going to enable the PCI device, the
transport isn't setup until
virtio_net_init()->virtio_pci_setup()

With those 2 minor issues addressed:

Reviewed-by: Matthew Rosato <[email protected]>



Reply via email to