From patchwork Tue Nov 15 12:32:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eelco Chaudron X-Patchwork-Id: 1704062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XSO82o9N; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NBQcY0HFFz20KC for ; Tue, 15 Nov 2022 23:35:09 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 25B8880B6D; Tue, 15 Nov 2022 12:35:07 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 25B8880B6D Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XSO82o9N X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id A_z-8nASdnAE; Tue, 15 Nov 2022 12:35:06 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id 54F5580B40; Tue, 15 Nov 2022 12:35:05 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 54F5580B40 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1EC58C0032; Tue, 15 Nov 2022 12:35:05 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8A7E0C002D for ; Tue, 15 Nov 2022 12:35:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 94B8F819D2 for ; Tue, 15 Nov 2022 12:34:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 94B8F819D2 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1F_dC-dvzdiP for ; Tue, 15 Nov 2022 12:34:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org CB1E5819D1 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id CB1E5819D1 for ; Tue, 15 Nov 2022 12:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668515666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zGl5xWTjuI0+V/wo/w80PaQOKotezr0RKRRxE9YdgCs=; b=XSO82o9NSqqIhVxz+PKCnpXxPua8hLlImOUAgIpyyUfiVclJx4L0dE7fnwnPJ9mxlLkUw2 VE7JgopBdBpgeohkOjwQXojGJutRMMnd9s9tlQE52RncCs9WaMlVXnA3c1UCCzshmmGdZz JJPUhz8nIK+W7Rfko3Ufz4hs90QrSiI= 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-184-jqtSYCEdNfG8F9d5E0S4RQ-1; Tue, 15 Nov 2022 07:34:25 -0500 X-MC-Unique: jqtSYCEdNfG8F9d5E0S4RQ-1 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 74E691C14344; Tue, 15 Nov 2022 12:34:25 +0000 (UTC) Received: from ebuild.redhat.com (unknown [10.39.193.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id EFAA52024CC0; Tue, 15 Nov 2022 12:34:24 +0000 (UTC) From: Eelco Chaudron To: dev@openvswitch.org Date: Tue, 15 Nov 2022 13:32:31 +0100 Message-Id: <166851555098.872016.9032852069438300944.stgit@ebuild> In-Reply-To: <166851534894.872016.10933356563476630373.stgit@ebuild> References: <166851534894.872016.10933356563476630373.stgit@ebuild> User-Agent: StGit/1.1 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH v2 13/15] netdev-offload-tc: If the flow has not been used, report it as such. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" If a tc flow was installed but has not yet been used, report it as such. In addition, add a delay to the "IGMP - flood under normal action" test case to make it work with many repetitions. This delay is also present in other ICMP/IGMP tests. Signed-off-by: Eelco Chaudron Acked-by: Roi Dayan --- lib/tc.c | 8 +++++++- tests/system-offloads.at | 3 +-- tests/system-traffic.at | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/tc.c b/lib/tc.c index a66dc432f..934df2e5e 100644 --- a/lib/tc.c +++ b/lib/tc.c @@ -1361,7 +1361,13 @@ get_user_hz(void) static void nl_parse_tcf(const struct tcf_t *tm, struct tc_flower *flower) { - uint64_t lastused = time_msec() - (tm->lastuse * 1000 / get_user_hz()); + uint64_t lastused; + + if (tm->firstuse == 0) { + lastused = 0; + } else { + lastused = time_msec() - (tm->lastuse * 1000 / get_user_hz()); + } if (flower->lastused < lastused) { flower->lastused = lastused; diff --git a/tests/system-offloads.at b/tests/system-offloads.at index ca0753457..e6f940f81 100644 --- a/tests/system-offloads.at +++ b/tests/system-offloads.at @@ -55,8 +55,7 @@ conntrack - multiple zones, local conntrack - multi-stage pipeline, local conntrack - ICMP related with NAT conntrack - DNAT load balancing -conntrack - DNAT load balancing with NC -IGMP - flood under normal action" +conntrack - DNAT load balancing with NC" echo "$ovs_test_skip_list" | sed "s// /g"]) m4_include([tests/system-traffic.at]) diff --git a/tests/system-traffic.at b/tests/system-traffic.at index 07913a192..57ff83b51 100644 --- a/tests/system-traffic.at +++ b/tests/system-traffic.at @@ -7002,6 +7002,8 @@ f0 00 00 01 01 01 08 00 46 c0 00 28 00 00 40 00 01 02 d3 49 45 65 eb 4a e0 dnl 00 00 16 94 04 00 00 22 00 f9 02 00 00 00 01 04 00 00 00 e0 00 00 fb 00 00 dnl 00 00 00 00 > /dev/null]) +sleep 1 + AT_CHECK([ovs-appctl dpctl/dump-flows --names | grep -e .*ipv4 | sort | dnl strip_stats | strip_used | strip_recirc | dnl sed 's/,packet_type(ns=[[0-9]]*,id=[[0-9]]*),/,/'],