From nobody Mon May 13 21:42:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1656425910294222.03542410506554; Tue, 28 Jun 2022 07:18:30 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-646-HtRBK5UqN3aqH51oYP4f9A-1; Tue, 28 Jun 2022 10:18:25 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3A5223810D42; Tue, 28 Jun 2022 14:17:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 24B2B2026D64; Tue, 28 Jun 2022 14:17:39 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EEBBF1947054; Tue, 28 Jun 2022 14:17:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A75AC1947060 for ; Tue, 28 Jun 2022 14:17:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 80BDE112131B; Tue, 28 Jun 2022 14:17:37 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 289D21121314 for ; Tue, 28 Jun 2022 14:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656425909; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=2CMVio6WI6wk2InB1wRklYsV2G7rBkMQ+BtiZJHiBKQ=; b=EdY2k0ehAsKMMJNvWPI4oXpYTDExM19KBeTRk+gsVXg1scitTIT/3Va8f/TSOV5s0H+Xw3 JujdCCLVD2sYxU+SC45uz3PVbR7QRzkeZlutzOu0DWSB17YVGiKe16QTtrNS8Ff92pbCwm hY19lo1b9tTjxPZLdLbw0QoB8Nt5GZY= X-MC-Unique: HtRBK5UqN3aqH51oYP4f9A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/4] virnetdevbandwidthtest: Drop unnecessary brackets Date: Tue, 28 Jun 2022 16:17:32 +0200 Message-Id: <92e5c1b29d7598c7382adb3adc7678c6f7dfef0c.1656425669.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656425910738100006 Content-Type: text/plain; charset="utf-8"; x-default="true" Some cases that call DO_TEST_SET() macro wrap each argument in curved brackets. This is unnecessary, drop the brackets. Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- tests/virnetdevbandwidthtest.c | 88 +++++++++++++++++----------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index eb4f47dfce..419793a4ae 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidthtest.c @@ -117,53 +117,53 @@ mymain(void) =20 DO_TEST_SET("", NULL); =20 - DO_TEST_SET(("" - " " - ""), - (TC " qdisc del dev eth0 root\n" - TC " qdisc del dev eth0 ingress\n" - TC " qdisc add dev eth0 root handle 1: htb default 1\n" - TC " class add dev eth0 parent 1: classid 1:1 htb rate 10= 24kbps quantum 87\n" - TC " qdisc add dev eth0 parent 1:1 handle 2: sfq perturb = 10\n" - TC " filter add dev eth0 parent 1:0 protocol all prio 1 h= andle 1 fw flowid 1\n")); + DO_TEST_SET("" + " " + "", + TC " qdisc del dev eth0 root\n" + TC " qdisc del dev eth0 ingress\n" + TC " qdisc add dev eth0 root handle 1: htb default 1\n" + TC " class add dev eth0 parent 1: classid 1:1 htb rate 102= 4kbps quantum 87\n" + TC " qdisc add dev eth0 parent 1:1 handle 2: sfq perturb 1= 0\n" + TC " filter add dev eth0 parent 1:0 protocol all prio 1 ha= ndle 1 fw flowid 1\n"); =20 - DO_TEST_SET(("" - " " - ""), - (TC " qdisc del dev eth0 root\n" - TC " qdisc del dev eth0 ingress\n" - TC " qdisc add dev eth0 ingress\n" - TC " filter add dev eth0 parent ffff: protocol all u32 ma= tch u32 0 0 " - "police rate 1024kbps burst 1024kb mtu 64kb drop flowid := 1\n")); + DO_TEST_SET("" + " " + "", + TC " qdisc del dev eth0 root\n" + TC " qdisc del dev eth0 ingress\n" + TC " qdisc add dev eth0 ingress\n" + TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch u32 0 0 " + "police rate 1024kbps burst 1024kb mtu 64kb drop flowid :1= \n"); =20 - DO_TEST_SET(("" - " " - " " - ""), - (TC " qdisc del dev eth0 root\n" - TC " qdisc del dev eth0 ingress\n" - TC " qdisc add dev eth0 root handle 1: htb default 1\n" - TC " class add dev eth0 parent 1: classid 1:1 htb rate 1k= bps ceil 2kbps burst 4kb quantum 1\n" - TC " qdisc add dev eth0 parent 1:1 handle 2: sfq perturb = 10\n" - TC " filter add dev eth0 parent 1:0 protocol all prio 1 h= andle 1 fw flowid 1\n" - TC " qdisc add dev eth0 ingress\n" - TC " filter add dev eth0 parent ffff: protocol all u32 ma= tch u32 0 0 " - "police rate 5kbps burst 7kb mtu 64kb drop flowid :1\n")); + DO_TEST_SET("" + " " + " " + "", + TC " qdisc del dev eth0 root\n" + TC " qdisc del dev eth0 ingress\n" + TC " qdisc add dev eth0 root handle 1: htb default 1\n" + TC " class add dev eth0 parent 1: classid 1:1 htb rate 1kb= ps ceil 2kbps burst 4kb quantum 1\n" + TC " qdisc add dev eth0 parent 1:1 handle 2: sfq perturb 1= 0\n" + TC " filter add dev eth0 parent 1:0 protocol all prio 1 ha= ndle 1 fw flowid 1\n" + TC " qdisc add dev eth0 ingress\n" + TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch u32 0 0 " + "police rate 5kbps burst 7kb mtu 64kb drop flowid :1\n"); =20 - DO_TEST_SET(("" - " " - " " - ""), - (TC " qdisc del dev eth0 root\n" - TC " qdisc del dev eth0 ingress\n" - TC " qdisc add dev eth0 root handle 1: htb default 1\n" - TC " class add dev eth0 parent 1: classid 1:1 htb rate 42= 94967295kbps quantum 366503875\n" - TC " qdisc add dev eth0 parent 1:1 handle 2: sfq perturb = 10\n" - TC " filter add dev eth0 parent 1:0 protocol all prio 1 h= andle 1 fw flowid 1\n" - TC " qdisc add dev eth0 ingress\n" - TC " filter add dev eth0 parent ffff: protocol all u32 ma= tch " - "u32 0 0 police rate 4294967295kbps burst 4194303kb mtu 6= 4kb " - "drop flowid :1\n")); + DO_TEST_SET("" + " " + " " + "", + TC " qdisc del dev eth0 root\n" + TC " qdisc del dev eth0 ingress\n" + TC " qdisc add dev eth0 root handle 1: htb default 1\n" + TC " class add dev eth0 parent 1: classid 1:1 htb rate 429= 4967295kbps quantum 366503875\n" + TC " qdisc add dev eth0 parent 1:1 handle 2: sfq perturb 1= 0\n" + TC " filter add dev eth0 parent 1:0 protocol all prio 1 ha= ndle 1 fw flowid 1\n" + TC " qdisc add dev eth0 ingress\n" + TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch " + "u32 0 0 police rate 4294967295kbps burst 4194303kb mtu 64= kb " + "drop flowid :1\n"); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.35.1 From nobody Mon May 13 21:42:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1656425907891939.169684759559; Tue, 28 Jun 2022 07:18:27 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-79-t_-oJyrIOXCRC2MrhNsEJw-1; Tue, 28 Jun 2022 10:18:21 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D8AE3C021BA; Tue, 28 Jun 2022 14:17:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76FA5463DFB; Tue, 28 Jun 2022 14:17:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 570B81947054; Tue, 28 Jun 2022 14:17:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 203F919466DF for ; Tue, 28 Jun 2022 14:17:38 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 13FCF112131B; Tue, 28 Jun 2022 14:17:38 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3E741121314 for ; Tue, 28 Jun 2022 14:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656425907; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ZSPXBenELRXsB+HlQi0WSc4RJ1C4mmFgYeN13ReX85s=; b=OiahB0h2a9613puk5s++S1QdhsEAyzlITk2PfFmtabcuc5tva5Cy18NMElywfFWhfCI1ap 6oHFTtL0Jk/lxr5YdGUJY+s57atUd20CE1oOTWhWufpYbryErgIwNOdoFvuWduQmCUZQcD qAGOaxNYA9CLRrenIrG2lkjz5Q0nmKg= X-MC-Unique: t_-oJyrIOXCRC2MrhNsEJw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/4] virnetdevbandwidthtest: Drop unused testMinimalStruct Date: Tue, 28 Jun 2022 16:17:33 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656425908682100002 Content-Type: text/plain; charset="utf-8"; x-default="true" The last usage of the testMinimalStruct struct was removed in v1.2.2-rc1~206 which forgot to remove the struct as well. Remove it now. Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- tests/virnetdevbandwidthtest.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index 419793a4ae..f0873743b4 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidthtest.c @@ -26,12 +26,6 @@ =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 -struct testMinimalStruct { - const char *expected_result; - const char *band1; - const char *band2; -}; - struct testSetStruct { const char *band; const char *exp_cmd; --=20 2.35.1 From nobody Mon May 13 21:42:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1656425909100795.6314005128372; Tue, 28 Jun 2022 07:18:29 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-184-vUKxvRU1M7qVxpwsDdBVHg-1; Tue, 28 Jun 2022 10:18:25 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E31868FC17B; Tue, 28 Jun 2022 14:17:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF519141510C; Tue, 28 Jun 2022 14:17:40 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A45C91947058; Tue, 28 Jun 2022 14:17:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BE37C19466DF for ; Tue, 28 Jun 2022 14:17:38 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9F18E112131E; Tue, 28 Jun 2022 14:17:38 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4AA1D112131B for ; Tue, 28 Jun 2022 14:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656425908; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=9X4btSi2PVQHAdJV+qALWpbKGsAiR6jWsUJW2Ykgt58=; b=E87h+gxjBbKcFoZJgj6bhIk44EOzkqbx7vV+6EgqAoJ+CKlcxYStW/8pczv/AlfiNwL5C9 /JZM0YF4RVXUsZYfuhWXBPTuDG3rqSZmiMMk5A5DIK3nAO9ik2W4D2wF559nkXZb747SAe WmZPpv7lX0vyT2R+AfnAf6ApDn5GjRo= X-MC-Unique: vUKxvRU1M7qVxpwsDdBVHg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/4] virnetdevbandwidthtest: Reformat TC cmd line Date: Tue, 28 Jun 2022 16:17:34 +0200 Message-Id: <902f1c9b7b5632f32957e1e97d935b3ceb10839d.1656425669.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656425910703100005 Content-Type: text/plain; charset="utf-8"; x-default="true" Our coding style expects a long line to be broken into shorter lines which are then aligned on the first character, for instance: "some string that's broken " "into multiple lines" However, one can argue that there are few cases where shifting the alignment makes the code more readable. And this is the case of expected cmd line for DO_TEST_SET() where a long cmd line can be aligned on the arguments rather than the binary: TC " filter ..." " police ..." Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- tests/virnetdevbandwidthtest.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index f0873743b4..51e5ec016b 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidthtest.c @@ -127,8 +127,8 @@ mymain(void) TC " qdisc del dev eth0 root\n" TC " qdisc del dev eth0 ingress\n" TC " qdisc add dev eth0 ingress\n" - TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch u32 0 0 " - "police rate 1024kbps burst 1024kb mtu 64kb drop flowid :1= \n"); + TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch u32 0 0" + " police rate 1024kbps burst 1024kb mtu 64kb drop flowi= d :1\n"); =20 DO_TEST_SET("" " " @@ -141,8 +141,8 @@ mymain(void) TC " qdisc add dev eth0 parent 1:1 handle 2: sfq perturb 1= 0\n" TC " filter add dev eth0 parent 1:0 protocol all prio 1 ha= ndle 1 fw flowid 1\n" TC " qdisc add dev eth0 ingress\n" - TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch u32 0 0 " - "police rate 5kbps burst 7kb mtu 64kb drop flowid :1\n"); + TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch u32 0 0" + " police rate 5kbps burst 7kb mtu 64kb drop flowid :1\n= "); =20 DO_TEST_SET("" " " @@ -155,9 +155,9 @@ mymain(void) TC " qdisc add dev eth0 parent 1:1 handle 2: sfq perturb 1= 0\n" TC " filter add dev eth0 parent 1:0 protocol all prio 1 ha= ndle 1 fw flowid 1\n" TC " qdisc add dev eth0 ingress\n" - TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch " - "u32 0 0 police rate 4294967295kbps burst 4194303kb mtu 64= kb " - "drop flowid :1\n"); + TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch" + " u32 0 0 police rate 4294967295kbps burst 4194303kb mt= u 64kb" + " drop flowid :1\n"); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.35.1 From nobody Mon May 13 21:42:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1656425916136312.6668127478007; Tue, 28 Jun 2022 07:18:36 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-215-v3Jn2I21Oqe7XDCWcwDYUA-1; Tue, 28 Jun 2022 10:18:25 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 59F5C886D57; Tue, 28 Jun 2022 14:17:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3DBF82166B2A; Tue, 28 Jun 2022 14:17:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0D7F9194705F; Tue, 28 Jun 2022 14:17:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 40B42194705D for ; Tue, 28 Jun 2022 14:17:39 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 35E4B112131E; Tue, 28 Jun 2022 14:17:39 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id D5AC91121314 for ; Tue, 28 Jun 2022 14:17:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656425915; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=YwXK3sbdbF8Jwnbm1FWkxlclIZKj3Szkre1lFKzN0Pc=; b=b6ZKVMVhwLicMIRkHGcAekNLbQYv6cXVR12tBNXXfOw4fmg8mYY8vMdQFNEE+RuSGmbBol pGI8KBx3SfxIwMbdSRod5/PDOgV1lKdnAqYi/1dJzHagYt/JB5X0qIcWkgT26bS4GLYOXb BSqLfTN8T69JLPRUCN7/+vxv5nOHKSw= X-MC-Unique: v3Jn2I21Oqe7XDCWcwDYUA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] virnetdevbandwidthtest: Test QoS for OVS Date: Tue, 28 Jun 2022 16:17:35 +0200 Message-Id: <1500e9498ba2447e999b512eaa99115d21ed0e56.1656425669.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1656425916918100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Ever since v7.6.0-rc1~235 we can use ovs-vsctl to set QoS instead of tc. However, we don't have a test that's verifying generated cmd line for ovs-vsctl. Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- tests/virnetdevbandwidthtest.c | 85 +++++++++++++++++++++++++++------- 1 file changed, 69 insertions(+), 16 deletions(-) diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c index 51e5ec016b..d5e4092fc3 100644 --- a/tests/virnetdevbandwidthtest.c +++ b/tests/virnetdevbandwidthtest.c @@ -22,13 +22,17 @@ #define LIBVIRT_VIRCOMMANDPRIV_H_ALLOW #include "vircommandpriv.h" #include "virnetdevbandwidth.h" +#include "virnetdevopenvswitch.h" #include "netdev_bandwidth_conf.c" =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 struct testSetStruct { const char *band; - const char *exp_cmd; + const char *exp_cmd_tc; + const char *exp_cmd_ovs; + bool ovs; + const unsigned char *uuid; const char *iface; const bool hierarchical_class; }; @@ -59,6 +63,7 @@ testVirNetDevBandwidthSet(const void *data) { const struct testSetStruct *info =3D data; const char *iface =3D info->iface; + const char *exp_cmd =3D NULL; g_autoptr(virNetDevBandwidth) band =3D NULL; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; g_autofree char *actual_cmd =3D NULL; @@ -72,17 +77,24 @@ testVirNetDevBandwidthSet(const void *data) =20 virCommandSetDryRun(dryRunToken, &buf, false, false, NULL, NULL); =20 - if (virNetDevBandwidthSet(iface, band, info->hierarchical_class, true)= < 0) - return -1; + if (info->ovs) { + exp_cmd =3D info->exp_cmd_ovs; + if (virNetDevOpenvswitchInterfaceSetQos(iface, band, info->uuid, t= rue) < 0) + return -1; + } else { + exp_cmd =3D info->exp_cmd_tc; + if (virNetDevBandwidthSet(iface, band, info->hierarchical_class, t= rue) < 0) + return -1; + } =20 if (!(actual_cmd =3D virBufferContentAndReset(&buf))) { /* This is interesting, no command has been executed. * Maybe that's expected, actually. */ } =20 - if (STRNEQ_NULLABLE(info->exp_cmd, actual_cmd)) { + if (STRNEQ_NULLABLE(exp_cmd, actual_cmd)) { virTestDifference(stderr, - NULLSTR(info->exp_cmd), + NULLSTR(exp_cmd), NULLSTR(actual_cmd)); return -1; } @@ -94,22 +106,37 @@ static int mymain(void) { int ret =3D 0; + unsigned char uuid[VIR_UUID_BUFLEN] =3D { 0 }; =20 -#define DO_TEST_SET(Band, Exp_cmd, ...) \ +#define VMUUID "c1018351-a229-4209-9faf-42446e0b53e5" + + if (virUUIDParse(VMUUID, uuid) < 0) + return -1; + +#define DO_TEST_SET(Band, Exp_cmd_tc, Exp_cmd_ovs, ...) \ do { \ struct testSetStruct data =3D {.band =3D Band, \ - .exp_cmd =3D Exp_cmd, \ + .exp_cmd_tc =3D Exp_cmd_tc, \ + .exp_cmd_ovs =3D Exp_cmd_ovs, \ + .ovs =3D false, \ + .uuid =3D uuid, \ __VA_ARGS__}; \ - if (virTestRun("virNetDevBandwidthSet", \ + if (virTestRun("virNetDevBandwidthSet TC", \ testVirNetDevBandwidthSet, \ - &data) < 0) \ + &data) < 0) { \ ret =3D -1; \ + } \ + data.ovs =3D true; \ + if (virTestRun("virNetDevBandwidthSet OVS", \ + testVirNetDevBandwidthSet, \ + &data) < 0) { \ + ret =3D -1; \ + } \ } while (0) =20 + DO_TEST_SET(NULL, NULL, NULL); =20 - DO_TEST_SET(NULL, NULL); - - DO_TEST_SET("", NULL); + DO_TEST_SET("", NULL, NULL); =20 DO_TEST_SET("" " " @@ -119,7 +146,14 @@ mymain(void) TC " qdisc add dev eth0 root handle 1: htb default 1\n" TC " class add dev eth0 parent 1: classid 1:1 htb rate 102= 4kbps quantum 87\n" TC " qdisc add dev eth0 parent 1:1 handle 2: sfq perturb 1= 0\n" - TC " filter add dev eth0 parent 1:0 protocol all prio 1 ha= ndle 1 fw flowid 1\n"); + TC " filter add dev eth0 parent 1:0 protocol all prio 1 ha= ndle 1 fw flowid 1\n", + OVS_VSCTL " --timeout=3D5 --no-heading --columns=3D_uuid f= ind queue 'external-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D\"et= h0\"'\n" + OVS_VSCTL " --timeout=3D5 --no-heading --columns=3D_uuid f= ind qos 'external-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D\"eth0= \"'\n" + OVS_VSCTL " --timeout=3D5 set port eth0 qos=3D@qos1 'exter= nal-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D\"eth0\"' --" + " --id=3D@qos1 create qos type=3Dlinux-htb other= _config:min-rate=3D8192000 queues:0=3D@queue0 'external-ids:vm-id=3D\"" VMU= UID "\"'" + " 'external-ids:ifname=3D\"eth0\"' --" + " --id=3D@queue0 create queue other_config:min-r= ate=3D8192000 'external-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D= \"eth0\"'\n" + OVS_VSCTL " --timeout=3D5 set Interface eth0 ingress_polic= ing_rate=3D0 ingress_policing_burst=3D0\n"); =20 DO_TEST_SET("" " " @@ -128,7 +162,10 @@ mymain(void) TC " qdisc del dev eth0 ingress\n" TC " qdisc add dev eth0 ingress\n" TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch u32 0 0" - " police rate 1024kbps burst 1024kb mtu 64kb drop flowi= d :1\n"); + " police rate 1024kbps burst 1024kb mtu 64kb drop flowi= d :1\n", + OVS_VSCTL " --timeout=3D5 --no-heading --columns=3D_uuid f= ind queue 'external-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D\"et= h0\"'\n" + OVS_VSCTL " --timeout=3D5 --no-heading --columns=3D_uuid f= ind qos 'external-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D\"eth0= \"'\n" + OVS_VSCTL " --timeout=3D5 set Interface eth0 ingress_polic= ing_rate=3D8192\n"); =20 DO_TEST_SET("" " " @@ -142,7 +179,15 @@ mymain(void) TC " filter add dev eth0 parent 1:0 protocol all prio 1 ha= ndle 1 fw flowid 1\n" TC " qdisc add dev eth0 ingress\n" TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch u32 0 0" - " police rate 5kbps burst 7kb mtu 64kb drop flowid :1\n= "); + " police rate 5kbps burst 7kb mtu 64kb drop flowid :1\n= ", + OVS_VSCTL " --timeout=3D5 --no-heading --columns=3D_uuid f= ind queue 'external-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D\"et= h0\"'\n" + OVS_VSCTL " --timeout=3D5 --no-heading --columns=3D_uuid f= ind qos 'external-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D\"eth0= \"'\n" + OVS_VSCTL " --timeout=3D5 set port eth0 qos=3D@qos1 'exter= nal-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D\"eth0\"' --" + " --id=3D@qos1 create qos type=3Dlinux-htb other= _config:min-rate=3D8000 other_config:burst=3D32768 other_config:max-rate=3D= 16000" + " queues:0=3D@queue0 'external-ids:vm-id=3D\""= VMUUID "\"' 'external-ids:ifname=3D\"eth0\"' --" + " --id=3D@queue0 create queue other_config:min-r= ate=3D8000 other_config:burst=3D32768 other_config:max-rate=3D16000" + " 'external-ids:vm-id=3D\"" VMUUID "\"' 'exter= nal-ids:ifname=3D\"eth0\"'\n" + OVS_VSCTL " --timeout=3D5 set Interface eth0 ingress_polic= ing_rate=3D40 ingress_policing_burst=3D56\n"); =20 DO_TEST_SET("" " " @@ -157,7 +202,15 @@ mymain(void) TC " qdisc add dev eth0 ingress\n" TC " filter add dev eth0 parent ffff: protocol all u32 mat= ch" " u32 0 0 police rate 4294967295kbps burst 4194303kb mt= u 64kb" - " drop flowid :1\n"); + " drop flowid :1\n", + OVS_VSCTL " --timeout=3D5 --no-heading --columns=3D_uuid f= ind queue 'external-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D\"et= h0\"'\n" + OVS_VSCTL " --timeout=3D5 --no-heading --columns=3D_uuid f= ind qos 'external-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D\"eth0= \"'\n" + OVS_VSCTL " --timeout=3D5 set port eth0 qos=3D@qos1 'exter= nal-ids:vm-id=3D\"" VMUUID "\"' 'external-ids:ifname=3D\"eth0\"' --" + " --id=3D@qos1 create qos type=3Dlinux-htb other= _config:min-rate=3D34359738360000" + " queues:0=3D@queue0 'external-ids:vm-id=3D\""= VMUUID "\"' 'external-ids:ifname=3D\"eth0\"' --" + " --id=3D@queue0 create queue other_config:min-r= ate=3D34359738360000 'external-ids:vm-id=3D\"" VMUUID "\"'" + " 'external-ids:ifname=3D\"eth0\"'\n" + OVS_VSCTL " --timeout=3D5 set Interface eth0 ingress_polic= ing_rate=3D34359738360\n"); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.35.1