From nobody Thu Oct 31 00:24:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 17222828336621016.6786878343137; Mon, 29 Jul 2024 12:53:53 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 68F2193A; Mon, 29 Jul 2024 15:53:52 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 7422712E9; Mon, 29 Jul 2024 15:49:57 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id A7AE712A2; Mon, 29 Jul 2024 15:49:53 -0400 (EDT) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 89AA812A2 for ; Mon, 29 Jul 2024 15:49:43 -0400 (EDT) Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2eeb1051360so40687201fa.0 for ; Mon, 29 Jul 2024 12:49:43 -0700 (PDT) Received: from localhost.localdomain ([2001:4bb8:181:247f:e288:8f76:5999:3]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ac6339bcb3sm6121862a12.5.2024.07.29.12.49.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jul 2024 12:49:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1722282582; x=1722887382; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/giwz8MvIsY37JugIi1Sn/lgfa73n9K7WXiQR9D0PiM=; b=pgh4cYkHltVQ7rFyF2eDCUghtBffZLB+7SZenck8TMRPkeDZMi7bTrleFA0iJ2euFH ouSfqKYdo8zXj7KkEbUIybMsXAW8T6w1yrx6193vv3+TjWk0/KlBnbK4Osc7NKyoxvXy jM7+Uw5U9WH+sjVIc5zVPL2gsabXLv61WXOK7I4oH4sYBz0Y+wFR6oVn9ldsLDlbWkte QGUST1jfy/HpTKFLs1mR9tP1jOf6mzDE+S720BvlgTEVTKFUiQRAprPci8QAMyUkTv5o Muh6/SMQkp+kbLJGf6VA3Mju4UbXCKwCWw0MDdjMKbQC64xKJkkGKRN0L1KlfNCxeV8+ SXVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722282582; x=1722887382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/giwz8MvIsY37JugIi1Sn/lgfa73n9K7WXiQR9D0PiM=; b=PNzQD1+bp1bDi/JDhYzdGwxRNxICCqGY9UuQ2F9W+AqXuvXXuc2gpMjWh3estma1f5 5g+JFjAjMLDpzsLwI5AlL2ewqL9tTWQ2McI7AVp3vph05ZOUaTkWwwn9KvhrbWj5p5S8 gpRKHq77KvrOSSkvM5LHZytJ5VbpTIYOPcowBCClRh0Yyjpuv413MAisYSmCvvrUIziV 4nt+Zo6p+pXcbfvT8E/HelyW/v5CpS209dvcFJpL0ScXuT4F6SE1ItKNVB8bV1rApbYq OpWIDyFcy+zvuoYkq1MVew88kzB9wXx67xytlWJMQUPdXmJSYyWaps8Kgdo97y1wuz0Q 3/9g== X-Gm-Message-State: AOJu0Yya7A0u77cLMmstzvKskwdkpZdIJmzTDbQmuX6ND19yU4zC4FeL Ks/zTamHe9tN4wiwFjORXvkcwuKeDMOY2geHY5AXr2/AbnJ+f0E1R6OWPcScIzGNpmhkfiITxhN E X-Google-Smtp-Source: AGHT+IGpH6ZRuwIWBLMq6sydOXdcvmpFUESiRJBwXp3RAH8ffwt+Dv2ZB/Vj0kk9DuwAvct9TCjtFA== X-Received: by 2002:a05:651c:4ca:b0:2ef:18b7:4408 with SMTP id 38308e7fff4ca-2f12edf742amr72593541fa.5.1722282581757; Mon, 29 Jul 2024 12:49:41 -0700 (PDT) From: Andrew Melnychenko To: devel@lists.libvirt.org Subject: [RFC PATCH v4 5/5] tests: Added tests for eBPF blob loading. Date: Mon, 29 Jul 2024 23:48:53 +0200 Message-ID: <20240729214853.458886-6-andrew@daynix.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240729214853.458886-1-andrew@daynix.com> References: <20240729214853.458886-1-andrew@daynix.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: T44GWJYFUYOYUNHSSMLBSAUDQDDSONE6 X-Message-ID-Hash: T44GWJYFUYOYUNHSSMLBSAUDQDDSONE6 X-MailFrom: andrew@daynix.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 CC: yuri.benditovich@daynix.com, yan@daynix.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1722282834044116600 Content-Type: text/plain; charset="utf-8" Added net-virtio-rss-bpf to qemuxmlconf's test. Synthetically modified caps-9.0.0 with a reply. Added mock functions for loading eBPF. Signed-off-by: Andrew Melnychenko Fixed Tests for 9.1.0 Added tests for SPARK Fixed issue with ident Signed-off-by: Andrew Melnychenko --- tests/qemuxml2argvmock.c | 24 ++++++++++ .../net-virtio-rss-bpf.x86_64-latest.args | 37 +++++++++++++++ .../net-virtio-rss-bpf.x86_64-latest.xml | 46 +++++++++++++++++++ tests/qemuxmlconfdata/net-virtio-rss-bpf.xml | 46 +++++++++++++++++++ tests/qemuxmlconftest.c | 5 ++ 5 files changed, 158 insertions(+) create mode 100644 tests/qemuxmlconfdata/net-virtio-rss-bpf.x86_64-latest.= args create mode 100644 tests/qemuxmlconfdata/net-virtio-rss-bpf.x86_64-latest.= xml create mode 100644 tests/qemuxmlconfdata/net-virtio-rss-bpf.xml diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c index 9cc97199c4..f0dba04a10 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -292,3 +292,27 @@ virNetDevSetMTU(const char *ifname G_GNUC_UNUSED, { return 0; } + +int +qemuInterfaceLoadEbpf(__attribute__((unused)) const char *ebpfObject, + __attribute__((unused)) void **retLibbpfObj, int *fds, size_t nfds) +{ + if (g_getenv("QEMU_NET_RSS_EBPF_DISABLED")) + return -1; + + if (nfds >=3D 4) { + fds[0] =3D 0x100; + fds[1] =3D 0x101; + fds[2] =3D 0x102; + fds[3] =3D 0x103; + return 4; + } else { + return -1; + } +} + +void +qemuInterfaceCloseEbpf(__attribute__((unused)) void *libbpfObj) +{ + return; +} diff --git a/tests/qemuxmlconfdata/net-virtio-rss-bpf.x86_64-latest.args b/= tests/qemuxmlconfdata/net-virtio-rss-bpf.x86_64-latest.args new file mode 100644 index 0000000000..b9497e5a73 --- /dev/null +++ b/tests/qemuxmlconfdata/net-virtio-rss-bpf.x86_64-latest.args @@ -0,0 +1,37 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ +-accel tcg \ +-cpu qemu64 \ +-m size=3D219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-1-storage","read-only":false}' \ +-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-stor= age","id":"ide0-0-0","bootindex":1}' \ +-netdev '{"type":"user","id":"hostnet0"}' \ +-device '{"driver":"virtio-net-pci","rss":true,"ebpf-rss-fds":["256","257"= ,"258","259"],"netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:55","bu= s":"pci.0","addr":"0x2"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x5"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/net-virtio-rss-bpf.x86_64-latest.xml b/t= ests/qemuxmlconfdata/net-virtio-rss-bpf.x86_64-latest.xml new file mode 100644 index 0000000000..198540380c --- /dev/null +++ b/tests/qemuxmlconfdata/net-virtio-rss-bpf.x86_64-latest.xml @@ -0,0 +1,46 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + +
+ + + +
+ + + + + +
+ + + +