qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 1f3728: net: fix build when libbpf is disable


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 1f3728: net: fix build when libbpf is disabled, but libxdp...
Date: Tue, 29 Oct 2024 10:05:59 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 1f37280b37dbf85f36748f359a9f8802c8fe7ccd
      
https://github.com/qemu/qemu/commit/1f37280b37dbf85f36748f359a9f8802c8fe7ccd
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M meson.build
    M net/meson.build

  Log Message:
  -----------
  net: fix build when libbpf is disabled, but libxdp is enabled

The net/af-xdp.c code is enabled when the libxdp library is present,
however, it also has direct API calls to bpf_xdp_query_id &
bpf_xdp_detach which are provided by the libbpf library.

As a result if building with --disable-libbpf, but libxdp gets
auto-detected, we'll fail to link QEMU

  /usr/bin/ld: libcommon.a.p/net_af-xdp.c.o: undefined reference to symbol 
'bpf_xdp_query_id@@LIBBPF_0.7.0'

There are two bugs here

 * Since we have direct libbpf API calls, when building
   net/af-xdp.c, we must tell meson that libbpf is a
   dependancy, so that we directly link to it, rather
   than relying on indirect linkage.

 * When must skip probing for libxdp at all, when libbpf
   is not found, raising an error if --enable-libxdp was
   given explicitly.

Fixes: cb039ef3d9e3112da01e1ecd9b136ac9809ef733
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 493a2403c247bdcfc812303f8dc0801778de4798
      
https://github.com/qemu/qemu/commit/493a2403c247bdcfc812303f8dc0801778de4798
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  hw/net: fix typo s/epbf/ebpf/ in virtio-net

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: a9436dd4077b0ee04dbbd2354a6738654530a206
      
https://github.com/qemu/qemu/commit/a9436dd4077b0ee04dbbd2354a6738654530a206
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M ebpf/ebpf_rss.c

  Log Message:
  -----------
  ebpf: drop redundant parameter checks in static methods

Various static methods have checks on their parameters which were
already checked immediately before the method was invoked. Drop
these redundat checks to simplify the following commit which adds
formal error reporting.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 31efce1e311830431718536c6461815b04e08bf9
      
https://github.com/qemu/qemu/commit/31efce1e311830431718536c6461815b04e08bf9
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M ebpf/ebpf_rss.c
    M ebpf/trace-events

  Log Message:
  -----------
  ebpf: improve error trace events

A design pattern of

   trace_foo_error("descriptive string")

is undesirable because it does not allow for filtering trace events
based on the error scenario. Split eBPF error trace event into three
separate events to address this filtering need.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 00b69f1d867ddcf8884c92f5647b424088e754e4
      
https://github.com/qemu/qemu/commit/00b69f1d867ddcf8884c92f5647b424088e754e4
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M ebpf/ebpf_rss-stub.c
    M ebpf/ebpf_rss.c
    M ebpf/ebpf_rss.h
    M hw/net/virtio-net.c

  Log Message:
  -----------
  ebpf: add formal error reporting to all APIs

The eBPF code is currently reporting error messages through trace
events. Trace events are fine for debugging, but they are not to be
considered the primary error reporting mechanism, as their output
is inaccessible to callers.

This adds an "Error **errp" parameter to all methods which have
important error scenarios to report to the caller.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: b5900dff14e5a8334766de6b37629c8020c6bbb0
      
https://github.com/qemu/qemu/commit/b5900dff14e5a8334766de6b37629c8020c6bbb0
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  hw/net: report errors from failing to use eBPF RSS FDs

If the user/mgmt app passed in a set of pre-opened FDs for eBPF RSS,
then it is expecting QEMU to use them. Any failure to do so must be
considered a fatal error and propagated back up the stack, otherwise
deployment mistakes will not be detectable in a prompt manner. When
not using pre-opened FDs, then eBPF RSS is tried on a "best effort"
basis only and thus fallback to software RSS is valid.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: f5cae19d109b99ed48ad147fc6c6a641329119bd
      
https://github.com/qemu/qemu/commit/f5cae19d109b99ed48ad147fc6c6a641329119bd
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M ebpf/ebpf_rss.c
    M ebpf/trace-events

  Log Message:
  -----------
  ebpf: improve trace event coverage to all key operations

The existing error trace event is renamed to have a name prefix
matching its source file & to remove the redundant first arg that
adds no useful information.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: ae311fb31543ca4e9de38c8435ebbdf6eca664d9
      
https://github.com/qemu/qemu/commit/ae311fb31543ca4e9de38c8435ebbdf6eca664d9
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M hw/net/trace-events
    M hw/net/virtio-net.c

  Log Message:
  -----------
  hw/net: improve tracing of eBPF RSS setup

This adds more trace events to key eBPF RSS setup operations, and
also distinguishes events from multiple NIC instances.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: c40e962d83f9968beb50fa7f3b6718461a7aedbf
      
https://github.com/qemu/qemu/commit/c40e962d83f9968beb50fa7f3b6718461a7aedbf
  Author: Daniil Tatianin <d-tatianin@yandex-team.ru>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M docs/about/deprecated.rst
    M net/stream.c
    M qapi/net.json
    M qemu-options.hx
    M tests/qtest/netdev-socket.c

  Log Message:
  -----------
  net/stream: deprecate 'reconnect' in favor of 'reconnect-ms'

Do the same thing we already did for chardev in c8e2b6b4d7e, and
introduce a new 'reconnect-ms' option to make it possible to specify
sub-second timeouts. This also changes the related documentaion and
tests to use reconnect-ms as well.

Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 96e610b23d4dcfa07b0f85eef02c70e28b32f4e6
      
https://github.com/qemu/qemu/commit/96e610b23d4dcfa07b0f85eef02c70e28b32f4e6
  Author: Daniil Tatianin <d-tatianin@yandex-team.ru>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M docs/COLO-FT.txt
    M docs/system/ppc/powernv.rst
    M qemu-options.hx
    M tests/qtest/ipmi-bt-test.c
    M tests/qtest/vhost-user-test.c
    M tests/unit/test-char.c

  Log Message:
  -----------
  chardev: finalize 'reconnect' deprecation

Change all related docs and tests to use the new 'reconnect-ms' option
instead of the now deprecated 'reconnect'.

Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 75fe36b4e8a994cdf9fd6eb601f49e96b1bc791d
      
https://github.com/qemu/qemu/commit/75fe36b4e8a994cdf9fd6eb601f49e96b1bc791d
  Author: Bernhard Beschow <shentey@gmail.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M net/tap-win32.c

  Log Message:
  -----------
  net/tap-win32: Fix gcc 14 format truncation errors

The patch fixes the following errors generated by GCC 14.2:

../src/net/tap-win32.c:343:19: error: '%s' directive output may be truncated 
writing up to 255 bytes into a region of size 176 [-Werror=format-truncation=]
  343 |              "%s\\%s\\Connection",
      |                   ^~
  344 |              NETWORK_CONNECTIONS_KEY, enum_name);
      |                                       ~~~~~~~~~

../src/net/tap-win32.c:341:9: note: 'snprintf' output between 92 and 347 bytes 
into a destination of size 256
  341 |         snprintf(connection_string,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  342 |              sizeof(connection_string),
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~
  343 |              "%s\\%s\\Connection",
      |              ~~~~~~~~~~~~~~~~~~~~~
  344 |              NETWORK_CONNECTIONS_KEY, enum_name);
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

../src/net/tap-win32.c:242:58: error: '%s' directive output may be truncated 
writing up to 255 bytes into a region of size 178 [-Werror=format-truncation=]
  242 |         snprintf (unit_string, sizeof(unit_string), "%s\\%s",
      |                                                          ^~
  243 |                   ADAPTER_KEY, enum_name);
      |                                ~~~~~~~~~

../src/net/tap-win32.c:242:9: note: 'snprintf' output between 79 and 334 bytes 
into a destination of size 256
  242 |         snprintf (unit_string, sizeof(unit_string), "%s\\%s",
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  243 |                   ADAPTER_KEY, enum_name);
      |                   ~~~~~~~~~~~~~~~~~~~~~~~

../src/net/tap-win32.c:620:52: error: '%s' directive output may be truncated 
writing up to 255 bytes into a region of size 245 [-Werror=format-truncation=]
  620 |     snprintf (device_path, sizeof(device_path), "%s%s%s",
      |                                                    ^~
  621 |               USERMODEDEVICEDIR,
  622 |               device_guid,
      |               ~~~~~~~~~~~
../src/net/tap-win32.c:620:5: note: 'snprintf' output between 16 and 271 bytes 
into a destination of size 256
  620 |     snprintf (device_path, sizeof(device_path), "%s%s%s",
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  621 |               USERMODEDEVICEDIR,
      |               ~~~~~~~~~~~~~~~~~~
  622 |               device_guid,
      |               ~~~~~~~~~~~~
  623 |               TAPSUFFIX);
      |               ~~~~~~~~~~

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2607
Cc: qemu-stable@nongnu.org
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 76240dd2a37c7b361740616a7d6080beafdb8a71
      
https://github.com/qemu/qemu/commit/76240dd2a37c7b361740616a7d6080beafdb8a71
  Author: Akihiko Odaki <akihiko.odaki@daynix.com>
  Date:   2024-10-28 (Mon, 28 Oct 2024)

  Changed paths:
    M net/net.c

  Log Message:
  -----------
  net: Check if nc is NULL in qemu_get_vnet_hdr_len()

A netdev may not have a peer specified, resulting in NULL. We should
make it behave like /dev/null in such a case instead of letting it
cause segmentatin fault.

Fixes: 4b52d63249a5 ("tap: Remove qemu_using_vnet_hdr()")
Cc: qemu-stable@nongnu.org
Reported-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by; Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: e29bc931e1699a98959680f6776b48673825762b
      
https://github.com/qemu/qemu/commit/e29bc931e1699a98959680f6776b48673825762b
  Author: Stefan Weil <sw@weilnetz.de>
  Date:   2024-10-29 (Tue, 29 Oct 2024)

  Changed paths:
    M net/colo-compare.c

  Log Message:
  -----------
  Fix calculation of minimum in colo_compare_tcp

GitHub's CodeQL reports a critical error which is fixed by using the MIN macro:

    Unsigned difference expression compared to zero

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Cc: qemu-stable@nongnu.org
Reviewed-by: Zhang Chen <chen.zhang@intel.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: cd76e8fcbe1a340776ae61b4e182be3a45b26219
      
https://github.com/qemu/qemu/commit/cd76e8fcbe1a340776ae61b4e182be3a45b26219
  Author: Akihiko Odaki <akihiko.odaki@daynix.com>
  Date:   2024-10-29 (Tue, 29 Oct 2024)

  Changed paths:
    M hw/net/virtio-net.c

  Log Message:
  -----------
  virtio-net: Avoid indirection_table_mask overflow

We computes indirections_len by adding 1 to indirection_table_mask, but
it may overflow indirection_table_mask is UINT16_MAX. Check if
indirection_table_mask is small enough before adding 1.

Fixes: 590790297c0d ("virtio-net: implement RSS configuration command")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>


  Commit: 58d49b5895f2e0b5cfe4b2901bf24f3320b74f29
      
https://github.com/qemu/qemu/commit/58d49b5895f2e0b5cfe4b2901bf24f3320b74f29
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2024-10-29 (Tue, 29 Oct 2024)

  Changed paths:
    M docs/COLO-FT.txt
    M docs/about/deprecated.rst
    M docs/system/ppc/powernv.rst
    M ebpf/ebpf_rss-stub.c
    M ebpf/ebpf_rss.c
    M ebpf/ebpf_rss.h
    M ebpf/trace-events
    M hw/net/trace-events
    M hw/net/virtio-net.c
    M meson.build
    M net/colo-compare.c
    M net/meson.build
    M net/net.c
    M net/stream.c
    M net/tap-win32.c
    M qapi/net.json
    M qemu-options.hx
    M tests/qtest/ipmi-bt-test.c
    M tests/qtest/netdev-socket.c
    M tests/qtest/vhost-user-test.c
    M tests/unit/test-char.c

  Log Message:
  -----------
  Merge tag 'net-pull-request' of https://github.com/jasowang/qemu into staging

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEIV1G9IJGaJ7HfzVi7wSWWzmNYhEFAmcglKYACgkQ7wSWWzmN
# YhEm/wf/cYA7i3asKMUoYqlff5mBiY3aFCWzTR5qHLBcWfnB33f9FYpAW6RgDwMa
# 3aFAJm1VZAynmUWgz+f537+e+7900M+P54zbD7kHCthAy7l/E7t9SkKNpe6jZHEA
# P4hB09CSKm/TY1XtsFMvO5tkF9IgY51VEO+mZJesO1H2X2+3ulJYusx9fh/P6yST
# bG8sbXr55v23R3z4UOovqfkuskPETwRh3qoiOLPPBy8CWkBVze8J+siC7HC+eFIo
# KrQ+jhUYpIK8CAgHV09ZnlurLo6UZ0+vlo9IcJN+GQp/gsmg8OErjvzPdKKbynC/
# 1zjvkgyW27aHsei+baTMXGCE0P8dIw==
# =6+yo
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 29 Oct 2024 07:54:14 GMT
# gpg:                using RSA key 215D46F48246689EC77F3562EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) 
<jasowang@redhat.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* tag 'net-pull-request' of https://github.com/jasowang/qemu:
  virtio-net: Avoid indirection_table_mask overflow
  Fix calculation of minimum in colo_compare_tcp
  net: Check if nc is NULL in qemu_get_vnet_hdr_len()
  net/tap-win32: Fix gcc 14 format truncation errors
  chardev: finalize 'reconnect' deprecation
  net/stream: deprecate 'reconnect' in favor of 'reconnect-ms'
  hw/net: improve tracing of eBPF RSS setup
  ebpf: improve trace event coverage to all key operations
  hw/net: report errors from failing to use eBPF RSS FDs
  ebpf: add formal error reporting to all APIs
  ebpf: improve error trace events
  ebpf: drop redundant parameter checks in static methods
  hw/net: fix typo s/epbf/ebpf/ in virtio-net
  net: fix build when libbpf is disabled, but libxdp is enabled

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/fdf250e5a378...58d49b5895f2

To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications



reply via email to

[Prev in Thread] Current Thread [Next in Thread]