qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/8] Net patches
@ 2022-02-14  3:59 Jason Wang
  2022-02-15 13:51 ` Peter Maydell
  0 siblings, 1 reply; 23+ messages in thread
From: Jason Wang @ 2022-02-14  3:59 UTC (permalink / raw)
  To: peter.maydell; +Cc: Jason Wang, qemu-devel

The following changes since commit 48033ad678ae2def43bf0d543a2c4c3d2a93feaf:

  Merge remote-tracking branch 'remotes/vsementsov/tags/pull-nbd-2022-02-09-v2' into staging (2022-02-12 22:04:07 +0000)

are available in the git repository at:

  https://github.com/jasowang/qemu.git tags/net-pull-request

for you to fetch changes up to 9d6267b240c114d1a3cd314a08fd6e1339d34b83:

  net/eth: Don't consider ESP to be an IPv6 option header (2022-02-14 11:50:44 +0800)

----------------------------------------------------------------

----------------------------------------------------------------
Nick Hudson (1):
      hw/net: e1000e: Clear ICR on read when using non MSI-X interrupts

Peter Foley (2):
      net/tap: Set return code on failure
      net: Fix uninitialized data usage

Philippe Mathieu-Daudé (1):
      hw/net/vmxnet3: Log guest-triggerable errors using LOG_GUEST_ERROR

Rao Lei (1):
      net/filter: Optimize filter_send to coroutine

Thomas Jansen (1):
      net/eth: Don't consider ESP to be an IPv6 option header

Zhang Chen (2):
      net/colo-compare.c: Optimize compare order for performance
      net/colo-compare.c: Update the default value comments

 hw/net/e1000e_core.c |  5 ++++
 hw/net/trace-events  |  1 +
 hw/net/vmxnet3.c     |  4 +++-
 net/colo-compare.c   | 28 +++++++++++-----------
 net/eth.c            |  1 -
 net/filter-mirror.c  | 66 +++++++++++++++++++++++++++++++++++++++++-----------
 net/tap-linux.c      |  1 +
 net/tap.c            |  1 +
 8 files changed, 78 insertions(+), 29 deletions(-)



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

* Re: [PULL 0/8] Net patches
  2022-02-14  3:59 Jason Wang
@ 2022-02-15 13:51 ` Peter Maydell
  0 siblings, 0 replies; 23+ messages in thread
From: Peter Maydell @ 2022-02-15 13:51 UTC (permalink / raw)
  To: Jason Wang; +Cc: qemu-devel

On Mon, 14 Feb 2022 at 04:00, Jason Wang <jasowang@redhat.com> wrote:
>
> The following changes since commit 48033ad678ae2def43bf0d543a2c4c3d2a93feaf:
>
>   Merge remote-tracking branch 'remotes/vsementsov/tags/pull-nbd-2022-02-09-v2' into staging (2022-02-12 22:04:07 +0000)
>
> are available in the git repository at:
>
>   https://github.com/jasowang/qemu.git tags/net-pull-request
>
> for you to fetch changes up to 9d6267b240c114d1a3cd314a08fd6e1339d34b83:
>
>   net/eth: Don't consider ESP to be an IPv6 option header (2022-02-14 11:50:44 +0800)
>
> ----------------------------------------------------------------

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/7.0
for any user-visible changes.

-- PMM


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

* [PULL 0/8] Net patches
@ 2022-05-18  3:12 Jason Wang
  2022-05-18 14:10 ` Richard Henderson
  0 siblings, 1 reply; 23+ messages in thread
From: Jason Wang @ 2022-05-18  3:12 UTC (permalink / raw)
  To: jasowang, qemu-devel, peter.maydell

The following changes since commit eec398119fc6911d99412c37af06a6bc27871f85:

  Merge tag 'for_upstream' of git://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging (2022-05-16 16:31:01 -0700)

are available in the git repository at:

  https://github.com/jasowang/qemu.git tags/net-pull-request

for you to fetch changes up to 052c2579b89b0d87debe8b05594b5180f0fde87d:

  tulip: Assign default MAC address if not specified (2022-05-17 16:48:23 +0800)

----------------------------------------------------------------

----------------------------------------------------------------
Helge Deller (1):
      tulip: Assign default MAC address if not specified

Vladislav Yaroshchuk (7):
      net/vmnet: add vmnet dependency and customizable option
      net/vmnet: add vmnet backends to qapi/net
      net/vmnet: implement shared mode (vmnet-shared)
      net/vmnet: implement host mode (vmnet-host)
      net/vmnet: implement bridged mode (vmnet-bridged)
      net/vmnet: update qemu-options.hx
      net/vmnet: update hmp-commands.hx

 hmp-commands.hx               |   6 +-
 hw/net/tulip.c                |   4 +-
 meson.build                   |  16 +-
 meson_options.txt             |   2 +
 net/clients.h                 |  11 ++
 net/meson.build               |   7 +
 net/net.c                     |  10 ++
 net/vmnet-bridged.m           | 152 +++++++++++++++++
 net/vmnet-common.m            | 378 ++++++++++++++++++++++++++++++++++++++++++
 net/vmnet-host.c              | 128 ++++++++++++++
 net/vmnet-shared.c            | 114 +++++++++++++
 net/vmnet_int.h               |  63 +++++++
 qapi/net.json                 | 133 ++++++++++++++-
 qemu-options.hx               |  25 +++
 scripts/meson-buildoptions.sh |   1 +
 15 files changed, 1044 insertions(+), 6 deletions(-)
 create mode 100644 net/vmnet-bridged.m
 create mode 100644 net/vmnet-common.m
 create mode 100644 net/vmnet-host.c
 create mode 100644 net/vmnet-shared.c
 create mode 100644 net/vmnet_int.h





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

* Re: [PULL 0/8] Net patches
  2022-05-18  3:12 Jason Wang
@ 2022-05-18 14:10 ` Richard Henderson
  0 siblings, 0 replies; 23+ messages in thread
From: Richard Henderson @ 2022-05-18 14:10 UTC (permalink / raw)
  To: Jason Wang, qemu-devel, peter.maydell

On 5/17/22 20:12, Jason Wang wrote:
> The following changes since commit eec398119fc6911d99412c37af06a6bc27871f85:
> 
>    Merge tag 'for_upstream' of git://git.kernel.org/pub/scm/virt/kvm/mst/qemu into staging (2022-05-16 16:31:01 -0700)
> 
> are available in the git repository at:
> 
>    https://github.com/jasowang/qemu.git tags/net-pull-request
> 
> for you to fetch changes up to 052c2579b89b0d87debe8b05594b5180f0fde87d:
> 
>    tulip: Assign default MAC address if not specified (2022-05-17 16:48:23 +0800)
> 
> ----------------------------------------------------------------
> 
> ----------------------------------------------------------------
> Helge Deller (1):
>        tulip: Assign default MAC address if not specified
> 
> Vladislav Yaroshchuk (7):
>        net/vmnet: add vmnet dependency and customizable option
>        net/vmnet: add vmnet backends to qapi/net
>        net/vmnet: implement shared mode (vmnet-shared)
>        net/vmnet: implement host mode (vmnet-host)
>        net/vmnet: implement bridged mode (vmnet-bridged)
>        net/vmnet: update qemu-options.hx
>        net/vmnet: update hmp-commands.hx

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate.


r~



> 
>   hmp-commands.hx               |   6 +-
>   hw/net/tulip.c                |   4 +-
>   meson.build                   |  16 +-
>   meson_options.txt             |   2 +
>   net/clients.h                 |  11 ++
>   net/meson.build               |   7 +
>   net/net.c                     |  10 ++
>   net/vmnet-bridged.m           | 152 +++++++++++++++++
>   net/vmnet-common.m            | 378 ++++++++++++++++++++++++++++++++++++++++++
>   net/vmnet-host.c              | 128 ++++++++++++++
>   net/vmnet-shared.c            | 114 +++++++++++++
>   net/vmnet_int.h               |  63 +++++++
>   qapi/net.json                 | 133 ++++++++++++++-
>   qemu-options.hx               |  25 +++
>   scripts/meson-buildoptions.sh |   1 +
>   15 files changed, 1044 insertions(+), 6 deletions(-)
>   create mode 100644 net/vmnet-bridged.m
>   create mode 100644 net/vmnet-common.m
>   create mode 100644 net/vmnet-host.c
>   create mode 100644 net/vmnet-shared.c
>   create mode 100644 net/vmnet_int.h
> 
> 
> 
> 



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

* [PULL 0/8] Net patches
@ 2022-09-27  7:30 Jason Wang
  2022-09-27 18:40 ` Stefan Hajnoczi
  0 siblings, 1 reply; 23+ messages in thread
From: Jason Wang @ 2022-09-27  7:30 UTC (permalink / raw)
  To: qemu-devel, peter.maydell, stefanha; +Cc: Jason Wang

The following changes since commit 99d6b11b5b44d7dd64f4cb1973184e40a4a174f8:

  Merge tag 'pull-target-arm-20220922' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2022-09-26 13:38:26 -0400)

are available in the git repository at:

  https://github.com/jasowang/qemu.git tags/net-pull-request

for you to fetch changes up to bf769f742c3624952f125b303878a77ea870c156:

  virtio: del net client if net_init_tap_one failed (2022-09-27 15:14:37 +0800)

----------------------------------------------------------------

----------------------------------------------------------------
Ding Hui (1):
      e1000e: set RX desc status with DD flag in a separate operation

Eugenio Pérez (6):
      vdpa: Make VhostVDPAState cvq_cmd_in_buffer control ack type
      vdpa: extract vhost_vdpa_net_load_mac from vhost_vdpa_net_load
      vdpa: Add vhost_vdpa_net_load_mq
      vdpa: validate MQ CVQ commands
      virtio-net: Update virtio-net curr_queue_pairs in vdpa backends
      vdpa: Allow MQ feature in SVQ

lu zhipeng (1):
      virtio: del net client if net_init_tap_one failed

 hw/net/e1000e_core.c |  53 ++++++++++++++++++++++-
 hw/net/virtio-net.c  |  17 +++-----
 net/tap.c            |  18 +++++---
 net/vhost-vdpa.c     | 119 +++++++++++++++++++++++++++++++++++++--------------
 4 files changed, 157 insertions(+), 50 deletions(-)

Ding Hui (1):
  e1000e: set RX desc status with DD flag in a separate operation

Eugenio Pérez (6):
  vdpa: Make VhostVDPAState cvq_cmd_in_buffer control ack type
  vdpa: extract vhost_vdpa_net_load_mac from vhost_vdpa_net_load
  vdpa: Add vhost_vdpa_net_load_mq
  vdpa: validate MQ CVQ commands
  virtio-net: Update virtio-net curr_queue_pairs in vdpa backends
  vdpa: Allow MQ feature in SVQ

lu zhipeng (1):
  virtio: del net client if net_init_tap_one failed

 hw/net/e1000e_core.c |  53 ++++++++++++++++++++++-
 hw/net/virtio-net.c  |  17 +++-----
 net/tap.c            |  18 +++++---
 net/vhost-vdpa.c     | 119 +++++++++++++++++++++++++++++++++++++--------------
 4 files changed, 157 insertions(+), 50 deletions(-)

-- 
2.7.4



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

* Re: [PULL 0/8] Net patches
  2022-09-27  7:30 Jason Wang
@ 2022-09-27 18:40 ` Stefan Hajnoczi
  0 siblings, 0 replies; 23+ messages in thread
From: Stefan Hajnoczi @ 2022-09-27 18:40 UTC (permalink / raw)
  To: Jason Wang; +Cc: qemu-devel, peter.maydell, stefanha, Jason Wang

[-- Attachment #1: Type: text/plain, Size: 115 bytes --]

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* [PULL 0/8] Net patches
@ 2024-03-12 11:36 Jason Wang
  2024-03-12 16:29 ` Peter Maydell
  2024-03-12 17:56 ` Michael Tokarev
  0 siblings, 2 replies; 23+ messages in thread
From: Jason Wang @ 2024-03-12 11:36 UTC (permalink / raw)
  To: qemu-devel, peter.maydell; +Cc: Jason Wang

The following changes since commit 05ec974671200814fa5c1d5db710e0e4b88a40af:

  Merge tag 'm68k-for-9.0-pull-request' of https://github.com/vivier/qemu-m68k into staging (2024-03-11 18:42:53 +0000)

are available in the Git repository at:

  https://github.com/jasowang/qemu.git tags/net-pull-request

for you to fetch changes up to 0cc14182aba961f4c34a21dd202ce6e4a87470f5:

  ebpf: Updated eBPF program and skeleton. (2024-03-12 19:31:47 +0800)

----------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----

iQEzBAABCAAdFiEEIV1G9IJGaJ7HfzVi7wSWWzmNYhEFAmXwPUAACgkQ7wSWWzmN
YhFnIwgAgctDniJwlRxXB01eVlzXz7IulHnpSby07XEJxENSpGB8ufaeE4eK5gJy
NVK6C2+1EU2vRxm4oIdcvtN4C4/jtRbYYjiSTx7eE4FmSkqshSnR5XCV72LDqG3i
WbzInjMvYfysmcMXLfrWgxOnVew9WqEzlpEWlc7FfNKnkzBVf+JDztfqCUx0XM7H
qefw4ImjqQw993QxJpipXC7aEGUyouB0RIBB71FkCa9ihlh9x7W68evbOI/jTn5q
HWuStgS02sKHjRFliMbdbMY77FNUz4Yroo/GKSvGt64atxkQSJqPNAV+/9n18LNy
QAH5eK6cXFPOIAaYpADU5kHDVVAFiw==
=iBdx
-----END PGP SIGNATURE-----

----------------------------------------------------------------
Andrew Melnychenko (5):
      ebpf: Added eBPF map update through mmap.
      ebpf: Added eBPF initialization by fds.
      virtio-net: Added property to load eBPF RSS with fds.
      qmp: Added new command to retrieve eBPF blob.
      ebpf: Updated eBPF program and skeleton.

Laurent Vivier (2):
      igb: fix link state on resume
      e1000e: fix link state on resume

Nick Briggs (1):
      Avoid unaligned fetch in ladr_match()

 ebpf/ebpf.c                    |   69 +++
 ebpf/ebpf.h                    |   29 +
 ebpf/ebpf_rss-stub.c           |    6 +
 ebpf/ebpf_rss.c                |  149 ++++-
 ebpf/ebpf_rss.h                |   10 +
 ebpf/meson.build               |    2 +-
 ebpf/rss.bpf.skeleton.h        | 1343 ++++++++++++++++++++--------------------
 ebpf/trace.h                   |    1 -
 hw/net/e1000e_core.c           |   60 +-
 hw/net/e1000e_core.h           |    2 -
 hw/net/igb_core.c              |   51 +-
 hw/net/igb_core.h              |    2 -
 hw/net/pcnet.c                 |    2 +-
 hw/net/virtio-net.c            |   54 +-
 include/hw/virtio/virtio-net.h |    2 +
 meson.build                    |   10 +-
 qapi/ebpf.json                 |   66 ++
 qapi/meson.build               |    1 +
 qapi/qapi-schema.json          |    1 +
 tools/ebpf/rss.bpf.c           |    7 +-
 20 files changed, 1058 insertions(+), 809 deletions(-)
 create mode 100644 ebpf/ebpf.c
 create mode 100644 ebpf/ebpf.h
 delete mode 100644 ebpf/trace.h
 create mode 100644 qapi/ebpf.json



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

* Re: [PULL 0/8] Net patches
  2024-03-12 11:36 Jason Wang
@ 2024-03-12 16:29 ` Peter Maydell
  2024-03-12 17:56 ` Michael Tokarev
  1 sibling, 0 replies; 23+ messages in thread
From: Peter Maydell @ 2024-03-12 16:29 UTC (permalink / raw)
  To: Jason Wang; +Cc: qemu-devel

On Tue, 12 Mar 2024 at 11:36, Jason Wang <jasowang@redhat.com> wrote:
>
> The following changes since commit 05ec974671200814fa5c1d5db710e0e4b88a40af:
>
>   Merge tag 'm68k-for-9.0-pull-request' of https://github.com/vivier/qemu-m68k into staging (2024-03-11 18:42:53 +0000)
>
> are available in the Git repository at:
>
>   https://github.com/jasowang/qemu.git tags/net-pull-request
>
> for you to fetch changes up to 0cc14182aba961f4c34a21dd202ce6e4a87470f5:
>
>   ebpf: Updated eBPF program and skeleton. (2024-03-12 19:31:47 +0800)
>
> ----------------------------------------------------------------
> -----BEGIN PGP SIGNATURE-----
>
> iQEzBAABCAAdFiEEIV1G9IJGaJ7HfzVi7wSWWzmNYhEFAmXwPUAACgkQ7wSWWzmN
> YhFnIwgAgctDniJwlRxXB01eVlzXz7IulHnpSby07XEJxENSpGB8ufaeE4eK5gJy
> NVK6C2+1EU2vRxm4oIdcvtN4C4/jtRbYYjiSTx7eE4FmSkqshSnR5XCV72LDqG3i
> WbzInjMvYfysmcMXLfrWgxOnVew9WqEzlpEWlc7FfNKnkzBVf+JDztfqCUx0XM7H
> qefw4ImjqQw993QxJpipXC7aEGUyouB0RIBB71FkCa9ihlh9x7W68evbOI/jTn5q
> HWuStgS02sKHjRFliMbdbMY77FNUz4Yroo/GKSvGt64atxkQSJqPNAV+/9n18LNy
> QAH5eK6cXFPOIAaYpADU5kHDVVAFiw==
> =iBdx
> -----END PGP SIGNATURE-----
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0
for any user-visible changes.

-- PMM


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

* Re: [PULL 0/8] Net patches
  2024-03-12 11:36 Jason Wang
  2024-03-12 16:29 ` Peter Maydell
@ 2024-03-12 17:56 ` Michael Tokarev
  2024-03-13  6:43   ` Jason Wang
  1 sibling, 1 reply; 23+ messages in thread
From: Michael Tokarev @ 2024-03-12 17:56 UTC (permalink / raw)
  To: Jason Wang, qemu-devel; +Cc: Laurent Vivier, Nick Briggs

12.03.2024 14:36, Jason Wang wrote:
...
> ----------------------------------------------------------------
> Andrew Melnychenko (5):
>        ebpf: Added eBPF map update through mmap.
>        ebpf: Added eBPF initialization by fds.
>        virtio-net: Added property to load eBPF RSS with fds.
>        qmp: Added new command to retrieve eBPF blob.
>        ebpf: Updated eBPF program and skeleton.
> 
> Laurent Vivier (2):
>        igb: fix link state on resume
>        e1000e: fix link state on resume
> 
> Nick Briggs (1):
>        Avoid unaligned fetch in ladr_match()

 From the above, I'm picking up igb & e100e "fix link state on resume"
and "Avoid unaligned fetch in ladr_match()" for stable.

Please let me know if this is incorrect.

Thanks,

/mjt


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

* Re: [PULL 0/8] Net patches
  2024-03-12 17:56 ` Michael Tokarev
@ 2024-03-13  6:43   ` Jason Wang
  0 siblings, 0 replies; 23+ messages in thread
From: Jason Wang @ 2024-03-13  6:43 UTC (permalink / raw)
  To: Michael Tokarev; +Cc: qemu-devel, Laurent Vivier, Nick Briggs

On Wed, Mar 13, 2024 at 1:56 AM Michael Tokarev <mjt@tls.msk.ru> wrote:
>
> 12.03.2024 14:36, Jason Wang wrote:
> ...
> > ----------------------------------------------------------------
> > Andrew Melnychenko (5):
> >        ebpf: Added eBPF map update through mmap.
> >        ebpf: Added eBPF initialization by fds.
> >        virtio-net: Added property to load eBPF RSS with fds.
> >        qmp: Added new command to retrieve eBPF blob.
> >        ebpf: Updated eBPF program and skeleton.
> >
> > Laurent Vivier (2):
> >        igb: fix link state on resume
> >        e1000e: fix link state on resume
> >
> > Nick Briggs (1):
> >        Avoid unaligned fetch in ladr_match()
>
>  From the above, I'm picking up igb & e100e "fix link state on resume"
> and "Avoid unaligned fetch in ladr_match()" for stable.
>
> Please let me know if this is incorrect.
>

It's correct.

Thanks

> Thanks,
>
> /mjt
>



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

* [PULL 0/8] Net patches
@ 2024-08-02  3:19 Jason Wang
  2024-08-02  3:19 ` [PULL 1/8] rtl8139: Fix behaviour for old kernels Jason Wang
                   ` (8 more replies)
  0 siblings, 9 replies; 23+ messages in thread
From: Jason Wang @ 2024-08-02  3:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jason Wang

The following changes since commit 31669121a01a14732f57c49400bc239cf9fd505f:

  Merge tag 'pull-target-arm-20240801' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-08-02 08:18:37 +1000)

are available in the Git repository at:

  https://github.com/jasowang/qemu.git tags/net-pull-request

for you to fetch changes up to 64f75f57f9d2c8c12ac6d9355fa5d3a2af5879ca:

  net: Reinstate '-net nic, model=help' output as documented in man page (2024-08-02 11:09:52 +0800)

----------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----

iQEzBAABCAAdFiEEIV1G9IJGaJ7HfzVi7wSWWzmNYhEFAmasTgwACgkQ7wSWWzmN
YhFUtAgAq45v7fQJ7cKKwRam/VrIkxT5cM59ODwzLSL9kPWfL6f/bJ7xM/zvLyvn
LNBXFWWu+eNKA73f95cckZwaqZ4U6giGbiesCACn1IpgVtieLS+Lq78jsifKIAsR
yxFvbT9oLhU0dZ1Up3+isc6V+jeAE4ZYu4KOiIt7PscTEzkJl+vSUjN4X9rRVtUD
PzONUacL6MoTJtX8UZJZXNzLN9JTsN39Gx+LSDGQ27MDmDvE3R9BW+T0ZgF9JQZ7
wnrL5sharqF3gxa7X55fPBI1qwY5gWcH0yyJpRdM8guA13vhtvlrhNSypip9eKWi
HtPHUTKEB5YOvF236WRiuQPIm/GNpA==
=7HGN
-----END PGP SIGNATURE-----

----------------------------------------------------------------
Akihiko Odaki (1):
      virtio-net: Ensure queue index fits with RSS

David Woodhouse (1):
      net: Reinstate '-net nic, model=help' output as documented in man page

Hans (1):
      rtl8139: Fix behaviour for old kernels.

Laurent Vivier (4):
      net: update netdev stream/dgram man page
      net: update netdev stream man page with unix socket
      net: update netdev dgram man page with unix socket
      net: update netdev stream man page with the reconnect parameter

thomas (1):
      virtio-net: Fix network stall at the host side waiting for kick

 hw/net/rtl8139.c           |   6 +-
 hw/net/virtio-net.c        |  31 ++++----
 hw/virtio/virtio.c         |  64 ++++++++++++++-
 include/hw/virtio/virtio.h |  19 ++++-
 net/net.c                  |  25 +++++-
 qemu-options.hx            | 189 +++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 310 insertions(+), 24 deletions(-)




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

* [PULL 1/8] rtl8139: Fix behaviour for old kernels.
  2024-08-02  3:19 [PULL 0/8] Net patches Jason Wang
@ 2024-08-02  3:19 ` Jason Wang
  2024-08-02  3:19 ` [PULL 2/8] virtio-net: Ensure queue index fits with RSS Jason Wang
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jason Wang @ 2024-08-02  3:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Hans, Jason Wang

From: Hans <sungdgdhtryrt@gmail.com>

Old linux kernel rtl8139 drivers (ex. debian 2.1) uses outb to set the rx
mode for RxConfig. Unfortunatelly qemu does not support outb for RxConfig.

Signed-off-by: Hans <sungdgdhtryrt@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/rtl8139.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 897c86ec41..03a204ef8a 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -2738,7 +2738,11 @@ static void rtl8139_io_writeb(void *opaque, uint8_t addr, uint32_t val)
             }
 
             break;
-
+        case RxConfig:
+            DPRINTF("RxConfig write(b) val=0x%02x\n", val);
+            rtl8139_RxConfig_write(s,
+                (rtl8139_RxConfig_read(s) & 0xFFFFFF00) | val);
+            break;
         default:
             DPRINTF("not implemented write(b) addr=0x%x val=0x%02x\n", addr,
                 val);
-- 
2.42.0



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

* [PULL 2/8] virtio-net: Ensure queue index fits with RSS
  2024-08-02  3:19 [PULL 0/8] Net patches Jason Wang
  2024-08-02  3:19 ` [PULL 1/8] rtl8139: Fix behaviour for old kernels Jason Wang
@ 2024-08-02  3:19 ` Jason Wang
  2024-08-06 13:30   ` Daniel P. Berrangé
  2024-08-02  3:19 ` [PULL 3/8] virtio-net: Fix network stall at the host side waiting for kick Jason Wang
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 23+ messages in thread
From: Jason Wang @ 2024-08-02  3:19 UTC (permalink / raw)
  To: qemu-devel
  Cc: Akihiko Odaki, Zhibin Hu, qemu-stable, Michael S . Tsirkin,
	Jason Wang

From: Akihiko Odaki <akihiko.odaki@daynix.com>

Ensure the queue index points to a valid queue when software RSS
enabled. The new calculation matches with the behavior of Linux's TAP
device with the RSS eBPF program.

Fixes: 4474e37a5b3a ("virtio-net: implement RX RSS processing")
Reported-by: Zhibin Hu <huzhibin5@huawei.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/virtio-net.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 8f30972708..5635620a31 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1905,7 +1905,8 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
     if (!no_rss && n->rss_data.enabled && n->rss_data.enabled_software_rss) {
         int index = virtio_net_process_rss(nc, buf, size, &extra_hdr);
         if (index >= 0) {
-            NetClientState *nc2 = qemu_get_subqueue(n->nic, index);
+            NetClientState *nc2 =
+                qemu_get_subqueue(n->nic, index % n->curr_queue_pairs);
             return virtio_net_receive_rcu(nc2, buf, size, true);
         }
     }
-- 
2.42.0



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

* [PULL 3/8] virtio-net: Fix network stall at the host side waiting for kick
  2024-08-02  3:19 [PULL 0/8] Net patches Jason Wang
  2024-08-02  3:19 ` [PULL 1/8] rtl8139: Fix behaviour for old kernels Jason Wang
  2024-08-02  3:19 ` [PULL 2/8] virtio-net: Ensure queue index fits with RSS Jason Wang
@ 2024-08-02  3:19 ` Jason Wang
  2024-08-02  3:19 ` [PULL 4/8] net: update netdev stream/dgram man page Jason Wang
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jason Wang @ 2024-08-02  3:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: thomas, qemu-stable, Michael S . Tsirkin, Jason Wang

From: thomas <east.moutain.yang@gmail.com>

Patch 06b12970174 ("virtio-net: fix network stall under load")
added double-check to test whether the available buffer size
can satisfy the request or not, in case the guest has added
some buffers to the avail ring simultaneously after the first
check. It will be lucky if the available buffer size becomes
okay after the double-check, then the host can send the packet
to the guest. If the buffer size still can't satisfy the request,
even if the guest has added some buffers, viritio-net would
stall at the host side forever.

The patch enables notification and checks whether the guest has
added some buffers since last check of available buffers when
the available buffers are insufficient. If no buffer is added,
return false, else recheck the available buffers in the loop.
If the available buffers are sufficient, disable notification
and return true.

Changes:
1. Change the return type of virtqueue_get_avail_bytes() from void
   to int, it returns an opaque that represents the shadow_avail_idx
   of the virtqueue on success, else -1 on error.
2. Add a new API: virtio_queue_enable_notification_and_check(),
   it takes an opaque as input arg which is returned from
   virtqueue_get_avail_bytes(). It enables notification firstly,
   then checks whether the guest has added some buffers since
   last check of available buffers or not by virtio_queue_poll(),
   return ture if yes.

The patch also reverts patch "06b12970174".

The case below can reproduce the stall.

                                       Guest 0
                                     +--------+
                                     | iperf  |
                    ---------------> | server |
         Host       |                +--------+
       +--------+   |                    ...
       | iperf  |----
       | client |----                  Guest n
       +--------+   |                +--------+
                    |                | iperf  |
                    ---------------> | server |
                                     +--------+

Boot many guests from qemu with virtio network:
 qemu ... -netdev tap,id=net_x \
    -device virtio-net-pci-non-transitional,\
    iommu_platform=on,mac=xx:xx:xx:xx:xx:xx,netdev=net_x

Each guest acts as iperf server with commands below:
 iperf3 -s -D -i 10 -p 8001
 iperf3 -s -D -i 10 -p 8002

The host as iperf client:
 iperf3 -c guest_IP -p 8001 -i 30 -w 256k -P 20 -t 40000
 iperf3 -c guest_IP -p 8002 -i 30 -w 256k -P 20 -t 40000

After some time, the host loses connection to the guest,
the guest can send packet to the host, but can't receive
packet from the host.

It's more likely to happen if SWIOTLB is enabled in the guest,
allocating and freeing bounce buffer takes some CPU ticks,
copying from/to bounce buffer takes more CPU ticks, compared
with that there is no bounce buffer in the guest.
Once the rate of producing packets from the host approximates
the rate of receiveing packets in the guest, the guest would
loop in NAPI.

         receive packets    ---
               |             |
               v             |
           free buf      virtnet_poll
               |             |
               v             |
     add buf to avail ring  ---
               |
               |  need kick the host?
               |  NAPI continues
               v
         receive packets    ---
               |             |
               v             |
           free buf      virtnet_poll
               |             |
               v             |
     add buf to avail ring  ---
               |
               v
              ...           ...

On the other hand, the host fetches free buf from avail
ring, if the buf in the avail ring is not enough, the
host notifies the guest the event by writing the avail
idx read from avail ring to the event idx of used ring,
then the host goes to sleep, waiting for the kick signal
from the guest.

Once the guest finds the host is waiting for kick singal
(in virtqueue_kick_prepare_split()), it kicks the host.

The host may stall forever at the sequences below:

         Host                        Guest
     ------------                 -----------
 fetch buf, send packet           receive packet ---
         ...                          ...         |
 fetch buf, send packet             add buf       |
         ...                        add buf   virtnet_poll
    buf not enough      avail idx-> add buf       |
    read avail idx                  add buf       |
                                    add buf      ---
                                  receive packet ---
    write event idx                   ...         |
    wait for kick                   add buf   virtnet_poll
                                      ...         |
                                                 ---
                                 no more packet, exit NAPI

In the first loop of NAPI above, indicated in the range of
virtnet_poll above, the host is sending packets while the
guest is receiving packets and adding buffers.
 step 1: The buf is not enough, for example, a big packet
         needs 5 buf, but the available buf count is 3.
         The host read current avail idx.
 step 2: The guest adds some buf, then checks whether the
         host is waiting for kick signal, not at this time.
         The used ring is not empty, the guest continues
         the second loop of NAPI.
 step 3: The host writes the avail idx read from avail
         ring to used ring as event idx via
         virtio_queue_set_notification(q->rx_vq, 1).
 step 4: At the end of the second loop of NAPI, recheck
         whether kick is needed, as the event idx in the
         used ring written by the host is beyound the
         range of kick condition, the guest will not
         send kick signal to the host.

Fixes: 06b12970174 ("virtio-net: fix network stall under load")
Cc: qemu-stable@nongnu.org
Signed-off-by: Wencheng Yang <east.moutain.yang@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/virtio-net.c        | 28 ++++++++++-------
 hw/virtio/virtio.c         | 64 +++++++++++++++++++++++++++++++++++---
 include/hw/virtio/virtio.h | 19 +++++++++--
 3 files changed, 92 insertions(+), 19 deletions(-)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 5635620a31..08aa0b65e3 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -1641,24 +1641,28 @@ static bool virtio_net_can_receive(NetClientState *nc)
 
 static int virtio_net_has_buffers(VirtIONetQueue *q, int bufsize)
 {
+    int opaque;
+    unsigned int in_bytes;
     VirtIONet *n = q->n;
-    if (virtio_queue_empty(q->rx_vq) ||
-        (n->mergeable_rx_bufs &&
-         !virtqueue_avail_bytes(q->rx_vq, bufsize, 0))) {
-        virtio_queue_set_notification(q->rx_vq, 1);
-
-        /* To avoid a race condition where the guest has made some buffers
-         * available after the above check but before notification was
-         * enabled, check for available buffers again.
-         */
-        if (virtio_queue_empty(q->rx_vq) ||
-            (n->mergeable_rx_bufs &&
-             !virtqueue_avail_bytes(q->rx_vq, bufsize, 0))) {
+
+    while (virtio_queue_empty(q->rx_vq) || n->mergeable_rx_bufs) {
+        opaque = virtqueue_get_avail_bytes(q->rx_vq, &in_bytes, NULL,
+                                           bufsize, 0);
+        /* Buffer is enough, disable notifiaction */
+        if (bufsize <= in_bytes) {
+            break;
+        }
+
+        if (virtio_queue_enable_notification_and_check(q->rx_vq, opaque)) {
+            /* Guest has added some buffers, try again */
+            continue;
+        } else {
             return 0;
         }
     }
 
     virtio_queue_set_notification(q->rx_vq, 0);
+
     return 1;
 }
 
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 397c261c3c..9e10cbc058 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -744,6 +744,60 @@ int virtio_queue_empty(VirtQueue *vq)
     }
 }
 
+static bool virtio_queue_split_poll(VirtQueue *vq, unsigned shadow_idx)
+{
+    if (unlikely(!vq->vring.avail)) {
+        return false;
+    }
+
+    return (uint16_t)shadow_idx != vring_avail_idx(vq);
+}
+
+static bool virtio_queue_packed_poll(VirtQueue *vq, unsigned shadow_idx)
+{
+    VRingPackedDesc desc;
+    VRingMemoryRegionCaches *caches;
+
+    if (unlikely(!vq->vring.desc)) {
+        return false;
+    }
+
+    caches = vring_get_region_caches(vq);
+    if (!caches) {
+        return false;
+    }
+
+    vring_packed_desc_read(vq->vdev, &desc, &caches->desc,
+                           shadow_idx, true);
+
+    return is_desc_avail(desc.flags, vq->shadow_avail_wrap_counter);
+}
+
+static bool virtio_queue_poll(VirtQueue *vq, unsigned shadow_idx)
+{
+    if (virtio_device_disabled(vq->vdev)) {
+        return false;
+    }
+
+    if (virtio_vdev_has_feature(vq->vdev, VIRTIO_F_RING_PACKED)) {
+        return virtio_queue_packed_poll(vq, shadow_idx);
+    } else {
+        return virtio_queue_split_poll(vq, shadow_idx);
+    }
+}
+
+bool virtio_queue_enable_notification_and_check(VirtQueue *vq,
+                                                int opaque)
+{
+    virtio_queue_set_notification(vq, 1);
+
+    if (opaque >= 0) {
+        return virtio_queue_poll(vq, (unsigned)opaque);
+    } else {
+        return false;
+    }
+}
+
 static void virtqueue_unmap_sg(VirtQueue *vq, const VirtQueueElement *elem,
                                unsigned int len)
 {
@@ -1442,9 +1496,9 @@ err:
     goto done;
 }
 
-void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
-                               unsigned int *out_bytes,
-                               unsigned max_in_bytes, unsigned max_out_bytes)
+int virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
+                              unsigned int *out_bytes, unsigned max_in_bytes,
+                              unsigned max_out_bytes)
 {
     uint16_t desc_size;
     VRingMemoryRegionCaches *caches;
@@ -1477,7 +1531,7 @@ void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
                                         caches);
     }
 
-    return;
+    return (int)vq->shadow_avail_idx;
 err:
     if (in_bytes) {
         *in_bytes = 0;
@@ -1485,6 +1539,8 @@ err:
     if (out_bytes) {
         *out_bytes = 0;
     }
+
+    return -1;
 }
 
 int virtqueue_avail_bytes(VirtQueue *vq, unsigned int in_bytes,
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index d2a1938757..0fcbc5c0c6 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -273,9 +273,13 @@ void qemu_put_virtqueue_element(VirtIODevice *vdev, QEMUFile *f,
                                 VirtQueueElement *elem);
 int virtqueue_avail_bytes(VirtQueue *vq, unsigned int in_bytes,
                           unsigned int out_bytes);
-void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
-                               unsigned int *out_bytes,
-                               unsigned max_in_bytes, unsigned max_out_bytes);
+/**
+ * Return <0 on error or an opaque >=0 to pass to
+ * virtio_queue_enable_notification_and_check on success.
+ */
+int virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes,
+                              unsigned int *out_bytes, unsigned max_in_bytes,
+                              unsigned max_out_bytes);
 
 void virtio_notify_irqfd(VirtIODevice *vdev, VirtQueue *vq);
 void virtio_notify(VirtIODevice *vdev, VirtQueue *vq);
@@ -309,6 +313,15 @@ int virtio_queue_ready(VirtQueue *vq);
 
 int virtio_queue_empty(VirtQueue *vq);
 
+/**
+ * Enable notification and check whether guest has added some
+ * buffers since last call to virtqueue_get_avail_bytes.
+ *
+ * @opaque: value returned from virtqueue_get_avail_bytes
+ */
+bool virtio_queue_enable_notification_and_check(VirtQueue *vq,
+                                                int opaque);
+
 void virtio_queue_set_shadow_avail_idx(VirtQueue *vq, uint16_t idx);
 
 /* Host binding interface.  */
-- 
2.42.0



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

* [PULL 4/8] net: update netdev stream/dgram man page
  2024-08-02  3:19 [PULL 0/8] Net patches Jason Wang
                   ` (2 preceding siblings ...)
  2024-08-02  3:19 ` [PULL 3/8] virtio-net: Fix network stall at the host side waiting for kick Jason Wang
@ 2024-08-02  3:19 ` Jason Wang
  2024-08-02  3:19 ` [PULL 5/8] net: update netdev stream man page with unix socket Jason Wang
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jason Wang @ 2024-08-02  3:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Marc-André Lureau, Jason Wang

From: Laurent Vivier <lvivier@redhat.com>

Add the description of "-netdev stream" and "-netdev dgram" in the QEMU
manpage.

Add some examples on how to use them.

Fixes: 5166fe0ae46d ("qapi: net: add stream and dgram netdevs")
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 qemu-options.hx | 114 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 114 insertions(+)

diff --git a/qemu-options.hx b/qemu-options.hx
index 369ae81d7c..52143cfb8f 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3353,6 +3353,120 @@ SRST
                          -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
                          -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4
 
+``-netdev stream,id=str[,server=on|off],addr.type=inet,addr.host=host,addr.port=port[,to=maxport][,numeric=on|off][,keep-alive=on|off][,mptcp=on|off][,addr.ipv4=on|off][,addr.ipv6=on|off]``
+    Configure a network backend to connect to another QEMU virtual machine or a proxy using a TCP/IP socket.
+
+    ``server=on|off``
+        if ``on`` create a server socket
+
+    ``addr.host=host,addr.port=port``
+        socket address to listen on (server=on) or connect to (server=off)
+
+    ``to=maxport``
+        if present, this is range of possible addresses, with port between ``port`` and ``maxport``.
+
+    ``numeric=on|off``
+        if ``on`` ``host`` and ``port`` are guaranteed to be numeric, otherwise a name resolution should be attempted (default: ``off``)
+
+    ``keep-alive=on|off``
+        enable keep-alive when connecting to this socket.  Not supported for passive sockets.
+
+    ``mptcp=on|off``
+        enable multipath TCP
+
+    ``ipv4=on|off``
+        whether to accept IPv4 addresses, default to try both IPv4 and IPv6
+
+    ``ipv6=on|off``
+        whether to accept IPv6 addresses, default to try both IPv4 and IPv6
+
+    Example (two guests connected using a TCP/IP socket):
+
+    .. parsed-literal::
+
+        # first VM
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
+                      -netdev stream,id=net0,server=on,addr.type=inet,addr.host=localhost,addr.port=1234
+        # second VM
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:57 \\
+                      -netdev stream,id=net0,server=off,addr.type=inet,addr.host=localhost,addr.port=1234
+
+``-netdev stream,id=str[,server=on|off],addr.type=fd,addr.str=file-descriptor``
+    Configure a network backend to connect to another QEMU virtual machine or a proxy using a stream oriented socket file descriptor.
+
+    ``server=on|off``
+        if ``on`` create a server socket
+
+    ``addr.str=file-descriptor``
+        file descriptor number to use as a socket
+
+``-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=inet,local.host=addr]``
+    Configure a network backend to connect to a multicast address.
+
+    ``remote.host=maddr,remote.port=port``
+        multicast address
+
+    ``local.host=addr``
+        specify the host address to send packets from
+
+    Example:
+
+    .. parsed-literal::
+
+        # launch one QEMU instance
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
+                      -netdev dgram,id=net0,remote.type=inet,remote.host=224.0.0.1,remote.port=1234
+        # launch another QEMU instance on same "bus"
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:57 \\
+                      -netdev dgram,id=net0,remote.type=inet,remote.host=224.0.0.1,remote.port=1234
+        # launch yet another QEMU instance on same "bus"
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:58 \\
+                      -netdev dgram,id=net0,remote.type=inet,remote.host=224.0.0.1,remote.port=1234
+
+``-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=fd,local.str=file-descriptor]``
+    Configure a network backend to connect to a multicast address using a UDP socket file descriptor.
+
+    ``remote.host=maddr,remote.port=port``
+        multicast address
+
+    ``local.str=file-descriptor``
+        File descriptor to use to send packets
+
+``-netdev dgram,id=str,local.type=inet,local.host=addr,local.port=port[,remote.type=inet,remote.host=addr,remote.port=port]``
+    Configure a network backend to connect to another QEMU virtual
+    machine or a proxy using a datagram oriented unix domain socket.
+
+    ``local.host=addr,local.port=port``
+        IP address to use to send the packets from
+
+    ``remote.host=addr,remote.port=port``
+        Destination IP address
+
+    Example (two guests connected using an UDP/IP socket):
+
+    .. parsed-literal::
+
+        # first VM
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
+                      -netdev dgram,id=net0,local.type=inet,local.host=localhost,local.port=1234,remote.type=inet,remote.host=localhost,remote.port=1235
+        # second VM
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
+                      -netdev dgram,id=net0,local.type=inet,local.host=localhost,local.port=1235,remote.type=inet,remote.host=localhost,remote.port=1234
+
+``-netdev dgram,id=str,local.type=fd,local.str=file-descriptor``
+    Configure a network backend to connect to another QEMU virtual
+    machine or a proxy using a datagram oriented socket file descriptor.
+
+    ``local.str=file-descriptor``
+        File descriptor to use to send packets
+
 ``-netdev l2tpv3,id=id,src=srcaddr,dst=dstaddr[,srcport=srcport][,dstport=dstport],txsession=txsession[,rxsession=rxsession][,ipv6=on|off][,udp=on|off][,cookie64=on|off][,counter=on|off][,pincounter=on|off][,txcookie=txcookie][,rxcookie=rxcookie][,offset=offset]``
     Configure a L2TPv3 pseudowire host network backend. L2TPv3 (RFC3931)
     is a popular protocol to transport Ethernet (and other Layer 2) data
-- 
2.42.0



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

* [PULL 5/8] net: update netdev stream man page with unix socket
  2024-08-02  3:19 [PULL 0/8] Net patches Jason Wang
                   ` (3 preceding siblings ...)
  2024-08-02  3:19 ` [PULL 4/8] net: update netdev stream/dgram man page Jason Wang
@ 2024-08-02  3:19 ` Jason Wang
  2024-08-02  3:19 ` [PULL 6/8] net: update netdev dgram " Jason Wang
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jason Wang @ 2024-08-02  3:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Marc-André Lureau, Jason Wang

From: Laurent Vivier <lvivier@redhat.com>

Add the description of "-netdev stream" with a unix domain socket.
The code has been added but the man page has not been updated.

Include an example how to use "-netdev stream" and "passt" in place
of "-netdev user".
("passt" is a non privileged translation proxy between layer-2, like
"-netdev stream", and layer-4 on host, like TCP, UDP, ICMP/ICMPv6 echo)

Fixes: 13c6be96618c ("net: stream: add unix socket")
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 qemu-options.hx | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/qemu-options.hx b/qemu-options.hx
index 52143cfb8f..2614eea4d7 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3393,6 +3393,46 @@ SRST
                       -device virtio-net,netdev=net0,mac=52:54:00:12:34:57 \\
                       -netdev stream,id=net0,server=off,addr.type=inet,addr.host=localhost,addr.port=1234
 
+``-netdev stream,id=str[,server=on|off],addr.type=unix,addr.path=path[,abstract=on|off][,tight=on|off]``
+    Configure a network backend to connect to another QEMU virtual machine or a proxy using a stream oriented unix domain socket.
+
+    ``server=on|off``
+        if ``on`` create a server socket
+
+    ``addr.path=path``
+        filesystem path to use
+
+    ``abstract=on|off``
+        if ``on``, this is a Linux abstract socket address.
+
+    ``tight=on|off``
+        if false, pad an abstract socket address with enough null bytes to make it fill struct sockaddr_un member sun_path.
+
+    Example (using passt as a replacement of -netdev user):
+
+    .. parsed-literal::
+
+        # start passt server as a non privileged user
+        passt
+        UNIX domain socket bound at /tmp/passt_1.socket
+        # start QEMU to connect to passt
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0 \\
+                      -netdev stream,id=net0,server=off,addr.type=unix,addr.path=/tmp/passt_1.socket
+
+    Example (two guests connected using a stream oriented unix domain socket):
+
+    .. parsed-literal::
+
+        # first VM
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
+                      netdev stream,id=net0,server=on,addr.type=unix,addr.path=/tmp/qemu0
+        # second VM
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:57 \\
+                      -netdev stream,id=net0,server=off,addr.type=unix,addr.path=/tmp/qemu0
+
 ``-netdev stream,id=str[,server=on|off],addr.type=fd,addr.str=file-descriptor``
     Configure a network backend to connect to another QEMU virtual machine or a proxy using a stream oriented socket file descriptor.
 
-- 
2.42.0



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

* [PULL 6/8] net: update netdev dgram man page with unix socket
  2024-08-02  3:19 [PULL 0/8] Net patches Jason Wang
                   ` (4 preceding siblings ...)
  2024-08-02  3:19 ` [PULL 5/8] net: update netdev stream man page with unix socket Jason Wang
@ 2024-08-02  3:19 ` Jason Wang
  2024-08-02  3:19 ` [PULL 7/8] net: update netdev stream man page with the reconnect parameter Jason Wang
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 23+ messages in thread
From: Jason Wang @ 2024-08-02  3:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Marc-André Lureau, Jason Wang

From: Laurent Vivier <lvivier@redhat.com>

Add the description of "-netdev dgram" with a unix domain socket.
The code has been added but the man page has not been updated.

Fixes: 784e7a253104 ("net: dgram: add unix socket")
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 qemu-options.hx | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/qemu-options.hx b/qemu-options.hx
index 2614eea4d7..23a53a7190 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3500,6 +3500,29 @@ SRST
                       -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
                       -netdev dgram,id=net0,local.type=inet,local.host=localhost,local.port=1235,remote.type=inet,remote.host=localhost,remote.port=1234
 
+``-netdev dgram,id=str,local.type=unix,local.path=path[,remote.type=unix,remote.path=path]``
+    Configure a network backend to connect to another QEMU virtual
+    machine or a proxy using a datagram oriented unix socket.
+
+    ``local.path=path``
+        filesystem path to use to bind the socket
+
+    ``remote.path=path``
+        filesystem path to use as a destination (see sendto(2))
+
+    Example (two guests connected using an UDP/UNIX socket):
+
+    .. parsed-literal::
+
+        # first VM
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:56 \\
+                      -netdev dgram,id=net0,local.type=unix,local.path=/tmp/qemu0,remote.type=unix,remote.path=/tmp/qemu1
+        # second VM
+        |qemu_system| linux.img \\
+                      -device virtio-net,netdev=net0,mac=52:54:00:12:34:57 \\
+                      -netdev dgram,id=net0,local.type=unix,local.path=/tmp/qemu1,remote.type=unix,remote.path=/tmp/qemu0
+
 ``-netdev dgram,id=str,local.type=fd,local.str=file-descriptor``
     Configure a network backend to connect to another QEMU virtual
     machine or a proxy using a datagram oriented socket file descriptor.
-- 
2.42.0



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

* [PULL 7/8] net: update netdev stream man page with the reconnect parameter
  2024-08-02  3:19 [PULL 0/8] Net patches Jason Wang
                   ` (5 preceding siblings ...)
  2024-08-02  3:19 ` [PULL 6/8] net: update netdev dgram " Jason Wang
@ 2024-08-02  3:19 ` Jason Wang
  2024-08-02  3:19 ` [PULL 8/8] net: Reinstate '-net nic, model=help' output as documented in man page Jason Wang
  2024-08-02  9:48 ` [PULL 0/8] Net patches Richard Henderson
  8 siblings, 0 replies; 23+ messages in thread
From: Jason Wang @ 2024-08-02  3:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Marc-André Lureau, Jason Wang

From: Laurent Vivier <lvivier@redhat.com>

"-netdev stream" supports a reconnect parameter that attempts to
reconnect automatically the socket if it is disconnected. The code
has been added but the man page has not been updated.

Fixes: 148fbf0d58a6 ("net: stream: add a new option to automatically reconnect"
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 qemu-options.hx | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 23a53a7190..cee0da2014 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3353,7 +3353,7 @@ SRST
                          -device e1000,netdev=n1,mac=52:54:00:12:34:56 \\
                          -netdev socket,id=n1,mcast=239.192.168.1:1102,localaddr=1.2.3.4
 
-``-netdev stream,id=str[,server=on|off],addr.type=inet,addr.host=host,addr.port=port[,to=maxport][,numeric=on|off][,keep-alive=on|off][,mptcp=on|off][,addr.ipv4=on|off][,addr.ipv6=on|off]``
+``-netdev stream,id=str[,server=on|off],addr.type=inet,addr.host=host,addr.port=port[,to=maxport][,numeric=on|off][,keep-alive=on|off][,mptcp=on|off][,addr.ipv4=on|off][,addr.ipv6=on|off][,reconnect=seconds]``
     Configure a network backend to connect to another QEMU virtual machine or a proxy using a TCP/IP socket.
 
     ``server=on|off``
@@ -3380,6 +3380,10 @@ SRST
     ``ipv6=on|off``
         whether to accept IPv6 addresses, default to try both IPv4 and IPv6
 
+    ``reconnect=seconds``
+        for a client socket, if a socket is disconnected, then attempt a reconnect after the given number of seconds.
+        Setting this to zero disables this function.  (default: 0)
+
     Example (two guests connected using a TCP/IP socket):
 
     .. parsed-literal::
@@ -3391,9 +3395,9 @@ SRST
         # second VM
         |qemu_system| linux.img \\
                       -device virtio-net,netdev=net0,mac=52:54:00:12:34:57 \\
-                      -netdev stream,id=net0,server=off,addr.type=inet,addr.host=localhost,addr.port=1234
+                      -netdev stream,id=net0,server=off,addr.type=inet,addr.host=localhost,addr.port=1234,reconnect=5
 
-``-netdev stream,id=str[,server=on|off],addr.type=unix,addr.path=path[,abstract=on|off][,tight=on|off]``
+``-netdev stream,id=str[,server=on|off],addr.type=unix,addr.path=path[,abstract=on|off][,tight=on|off][,reconnect=seconds]``
     Configure a network backend to connect to another QEMU virtual machine or a proxy using a stream oriented unix domain socket.
 
     ``server=on|off``
@@ -3408,6 +3412,10 @@ SRST
     ``tight=on|off``
         if false, pad an abstract socket address with enough null bytes to make it fill struct sockaddr_un member sun_path.
 
+    ``reconnect=seconds``
+        for a client socket, if a socket is disconnected, then attempt a reconnect after the given number of seconds.
+        Setting this to zero disables this function.  (default: 0)
+
     Example (using passt as a replacement of -netdev user):
 
     .. parsed-literal::
@@ -3431,9 +3439,9 @@ SRST
         # second VM
         |qemu_system| linux.img \\
                       -device virtio-net,netdev=net0,mac=52:54:00:12:34:57 \\
-                      -netdev stream,id=net0,server=off,addr.type=unix,addr.path=/tmp/qemu0
+                      -netdev stream,id=net0,server=off,addr.type=unix,addr.path=/tmp/qemu0,reconnect=5
 
-``-netdev stream,id=str[,server=on|off],addr.type=fd,addr.str=file-descriptor``
+``-netdev stream,id=str[,server=on|off],addr.type=fd,addr.str=file-descriptor[,reconnect=seconds]``
     Configure a network backend to connect to another QEMU virtual machine or a proxy using a stream oriented socket file descriptor.
 
     ``server=on|off``
@@ -3442,6 +3450,10 @@ SRST
     ``addr.str=file-descriptor``
         file descriptor number to use as a socket
 
+    ``reconnect=seconds``
+        for a client socket, if a socket is disconnected, then attempt a reconnect after the given number of seconds.
+        Setting this to zero disables this function.  (default: 0)
+
 ``-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=inet,local.host=addr]``
     Configure a network backend to connect to a multicast address.
 
-- 
2.42.0



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

* [PULL 8/8] net: Reinstate '-net nic, model=help' output as documented in man page
  2024-08-02  3:19 [PULL 0/8] Net patches Jason Wang
                   ` (6 preceding siblings ...)
  2024-08-02  3:19 ` [PULL 7/8] net: update netdev stream man page with the reconnect parameter Jason Wang
@ 2024-08-02  3:19 ` Jason Wang
  2024-08-02  9:48 ` [PULL 0/8] Net patches Richard Henderson
  8 siblings, 0 replies; 23+ messages in thread
From: Jason Wang @ 2024-08-02  3:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: David Woodhouse, qemu-stable, Michael Tokarev, Jason Wang

From: David Woodhouse <dwmw@amazon.co.uk>

While refactoring the NIC initialization code, I broke '-net nic,model=help'
which no longer outputs a list of available NIC models.

Fixes: 2cdeca04adab ("net: report list of available models according to platform")
Cc: qemu-stable@nongnu.org
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 net/net.c | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/net/net.c b/net/net.c
index 6938da05e0..2eb8bc9c0b 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1139,6 +1139,21 @@ NICInfo *qemu_find_nic_info(const char *typename, bool match_default,
     return NULL;
 }
 
+static bool is_nic_model_help_option(const char *model)
+{
+    if (model && is_help_option(model)) {
+        /*
+         * Trigger the help output by instantiating the hash table which
+         * will gather tha available models as they get registered.
+         */
+        if (!nic_model_help) {
+            nic_model_help = g_hash_table_new_full(g_str_hash, g_str_equal,
+                                                   g_free, NULL);
+        }
+        return true;
+    }
+    return false;
+}
 
 /* "I have created a device. Please configure it if you can" */
 bool qemu_configure_nic_device(DeviceState *dev, bool match_default,
@@ -1722,6 +1737,12 @@ void net_check_clients(void)
 
 static int net_init_client(void *dummy, QemuOpts *opts, Error **errp)
 {
+    const char *model = qemu_opt_get_del(opts, "model");
+
+    if (is_nic_model_help_option(model)) {
+        return 0;
+    }
+
     return net_client_init(opts, false, errp);
 }
 
@@ -1778,9 +1799,7 @@ static int net_param_nic(void *dummy, QemuOpts *opts, Error **errp)
     memset(ni, 0, sizeof(*ni));
     ni->model = qemu_opt_get_del(opts, "model");
 
-    if (!nic_model_help && !g_strcmp0(ni->model, "help")) {
-        nic_model_help = g_hash_table_new_full(g_str_hash, g_str_equal,
-                                               g_free, NULL);
+    if (is_nic_model_help_option(ni->model)) {
         return 0;
     }
 
-- 
2.42.0



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

* Re: [PULL 0/8] Net patches
  2024-08-02  3:19 [PULL 0/8] Net patches Jason Wang
                   ` (7 preceding siblings ...)
  2024-08-02  3:19 ` [PULL 8/8] net: Reinstate '-net nic, model=help' output as documented in man page Jason Wang
@ 2024-08-02  9:48 ` Richard Henderson
  2024-08-05  2:38   ` Jason Wang
  8 siblings, 1 reply; 23+ messages in thread
From: Richard Henderson @ 2024-08-02  9:48 UTC (permalink / raw)
  To: Jason Wang, qemu-devel

On 8/2/24 13:19, Jason Wang wrote:
> The following changes since commit 31669121a01a14732f57c49400bc239cf9fd505f:
> 
>    Merge tag 'pull-target-arm-20240801' ofhttps://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-08-02 08:18:37 +1000)
> 
> are available in the Git repository at:
> 
>    https://github.com/jasowang/qemu.git tags/net-pull-request
> 
> for you to fetch changes up to 64f75f57f9d2c8c12ac6d9355fa5d3a2af5879ca:
> 
>    net: Reinstate '-net nic, model=help' output as documented in man page (2024-08-02 11:09:52 +0800)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


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

* Re: [PULL 0/8] Net patches
  2024-08-02  9:48 ` [PULL 0/8] Net patches Richard Henderson
@ 2024-08-05  2:38   ` Jason Wang
  2024-08-05 22:00     ` Richard Henderson
  0 siblings, 1 reply; 23+ messages in thread
From: Jason Wang @ 2024-08-05  2:38 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel

Hi Richard:

On Fri, Aug 2, 2024 at 5:48 PM Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 8/2/24 13:19, Jason Wang wrote:
> > The following changes since commit 31669121a01a14732f57c49400bc239cf9fd505f:
> >
> >    Merge tag 'pull-target-arm-20240801' ofhttps://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-08-02 08:18:37 +1000)
> >
> > are available in the Git repository at:
> >
> >    https://github.com/jasowang/qemu.git tags/net-pull-request
> >
> > for you to fetch changes up to 64f75f57f9d2c8c12ac6d9355fa5d3a2af5879ca:
> >
> >    net: Reinstate '-net nic, model=help' output as documented in man page (2024-08-02 11:09:52 +0800)
>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
>

I guess it means it has been merged :) ?

Thanks

> r~
>



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

* Re: [PULL 0/8] Net patches
  2024-08-05  2:38   ` Jason Wang
@ 2024-08-05 22:00     ` Richard Henderson
  0 siblings, 0 replies; 23+ messages in thread
From: Richard Henderson @ 2024-08-05 22:00 UTC (permalink / raw)
  To: Jason Wang; +Cc: qemu-devel

On 8/5/24 12:38, Jason Wang wrote:
> Hi Richard:
> 
> On Fri, Aug 2, 2024 at 5:48 PM Richard Henderson
> <richard.henderson@linaro.org> wrote:
>>
>> On 8/2/24 13:19, Jason Wang wrote:
>>> The following changes since commit 31669121a01a14732f57c49400bc239cf9fd505f:
>>>
>>>     Merge tag 'pull-target-arm-20240801' ofhttps://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-08-02 08:18:37 +1000)
>>>
>>> are available in the Git repository at:
>>>
>>>     https://github.com/jasowang/qemu.git tags/net-pull-request
>>>
>>> for you to fetch changes up to 64f75f57f9d2c8c12ac6d9355fa5d3a2af5879ca:
>>>
>>>     net: Reinstate '-net nic, model=help' output as documented in man page (2024-08-02 11:09:52 +0800)
>>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>
>>
> 
> I guess it means it has been merged :) ?

Whoops, yes, wrong macro button pushed.  :-)


r~


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

* Re: [PULL 2/8] virtio-net: Ensure queue index fits with RSS
  2024-08-02  3:19 ` [PULL 2/8] virtio-net: Ensure queue index fits with RSS Jason Wang
@ 2024-08-06 13:30   ` Daniel P. Berrangé
  0 siblings, 0 replies; 23+ messages in thread
From: Daniel P. Berrangé @ 2024-08-06 13:30 UTC (permalink / raw)
  To: Jason Wang
  Cc: qemu-devel, Akihiko Odaki, Zhibin Hu, qemu-stable,
	Michael S . Tsirkin

On Fri, Aug 02, 2024 at 11:19:23AM +0800, Jason Wang wrote:
> From: Akihiko Odaki <akihiko.odaki@daynix.com>
> 
> Ensure the queue index points to a valid queue when software RSS
> enabled. The new calculation matches with the behavior of Linux's TAP
> device with the RSS eBPF program.
> 
> Fixes: 4474e37a5b3a ("virtio-net: implement RX RSS processing")
> Reported-by: Zhibin Hu <huzhibin5@huawei.com>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  hw/net/virtio-net.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

FYI, this patch is the fix for CVE-2024-6505.

Please make sure to mention CVE assignments in the commit message
when one is available.

> 
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 8f30972708..5635620a31 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -1905,7 +1905,8 @@ static ssize_t virtio_net_receive_rcu(NetClientState *nc, const uint8_t *buf,
>      if (!no_rss && n->rss_data.enabled && n->rss_data.enabled_software_rss) {
>          int index = virtio_net_process_rss(nc, buf, size, &extra_hdr);
>          if (index >= 0) {
> -            NetClientState *nc2 = qemu_get_subqueue(n->nic, index);
> +            NetClientState *nc2 =
> +                qemu_get_subqueue(n->nic, index % n->curr_queue_pairs);
>              return virtio_net_receive_rcu(nc2, buf, size, true);
>          }
>      }

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

end of thread, other threads:[~2024-08-06 13:31 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-02  3:19 [PULL 0/8] Net patches Jason Wang
2024-08-02  3:19 ` [PULL 1/8] rtl8139: Fix behaviour for old kernels Jason Wang
2024-08-02  3:19 ` [PULL 2/8] virtio-net: Ensure queue index fits with RSS Jason Wang
2024-08-06 13:30   ` Daniel P. Berrangé
2024-08-02  3:19 ` [PULL 3/8] virtio-net: Fix network stall at the host side waiting for kick Jason Wang
2024-08-02  3:19 ` [PULL 4/8] net: update netdev stream/dgram man page Jason Wang
2024-08-02  3:19 ` [PULL 5/8] net: update netdev stream man page with unix socket Jason Wang
2024-08-02  3:19 ` [PULL 6/8] net: update netdev dgram " Jason Wang
2024-08-02  3:19 ` [PULL 7/8] net: update netdev stream man page with the reconnect parameter Jason Wang
2024-08-02  3:19 ` [PULL 8/8] net: Reinstate '-net nic, model=help' output as documented in man page Jason Wang
2024-08-02  9:48 ` [PULL 0/8] Net patches Richard Henderson
2024-08-05  2:38   ` Jason Wang
2024-08-05 22:00     ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
2024-03-12 11:36 Jason Wang
2024-03-12 16:29 ` Peter Maydell
2024-03-12 17:56 ` Michael Tokarev
2024-03-13  6:43   ` Jason Wang
2022-09-27  7:30 Jason Wang
2022-09-27 18:40 ` Stefan Hajnoczi
2022-05-18  3:12 Jason Wang
2022-05-18 14:10 ` Richard Henderson
2022-02-14  3:59 Jason Wang
2022-02-15 13:51 ` Peter Maydell

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).