From patchwork Thu Feb 1 16:17:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ales Musil X-Patchwork-Id: 1894041 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=fQPq+gVa; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TQkbd03dCz23gD for ; Fri, 2 Feb 2024 03:18:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 4E24B43677; Thu, 1 Feb 2024 16:18:18 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4E24B43677 Authentication-Results: smtp2.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=fQPq+gVa X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MOKfNWFBy8NE; Thu, 1 Feb 2024 16:18:17 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 15A65409F9; Thu, 1 Feb 2024 16:18:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 15A65409F9 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E22C7C0072; Thu, 1 Feb 2024 16:18:15 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2EF31C0037 for ; Thu, 1 Feb 2024 16:18:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 098E140B20 for ; Thu, 1 Feb 2024 16:18:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 098E140B20 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zz3WlWWkx4xg for ; Thu, 1 Feb 2024 16:18:13 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp2.osuosl.org (Postfix) with ESMTPS id DAA2D40332 for ; Thu, 1 Feb 2024 16:18:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org DAA2D40332 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706804291; 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; bh=youy8ZNaBPuR6nBxQA/LyNGKrBM5SyOpiJG/VMV6jgA=; b=fQPq+gVaLyphxHztjZ5rMPjc+MShTRbKfrFkAiOurbN05htps18KBUyXTr2meC/9aomLzJ 19LZSbkgOA+JEN3MWbs9++e8L+CzdgE1HeIfU3Izhv18ddYpTjCN0Bh4if9h/KRQLkIKlE flylWxgmrOEJvE+3cUqFRxe1wGMFaYQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-460-FJpQjhoHNsWzECe7qhUXIA-1; Thu, 01 Feb 2024 11:18:10 -0500 X-MC-Unique: FJpQjhoHNsWzECe7qhUXIA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 32DDE185A78E for ; Thu, 1 Feb 2024 16:18:10 +0000 (UTC) Received: from amusil.redhat.com (unknown [10.45.224.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0A181BDB1; Thu, 1 Feb 2024 16:18:09 +0000 (UTC) From: Ales Musil To: dev@openvswitch.org Date: Thu, 1 Feb 2024 17:17:38 +0100 Message-ID: <20240201161804.210604-1-amusil@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 00/26] Remove most of the hardcoded table numbers 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" A lot of tests were relying on exact table numbers for flow comparison either logical or OpenFlows. To solve this problem logical flows will have stripped table maening that the table= will become table=??. This makes it future proof for any logical table shifts and there is no need to deal with number changes when the pipleine shifts for example. For OpenFlows the solution is to use macros and replace table= with the macro e.g. table=OFTABLE_PHY_TO_LOG. This means that if there is table shift we just have to adjust those macros instead of "random" tests. Simple grep for table= before and after shows the benefit. Before: grep -E "table=[0-9]+" tests/*.at | wc -l 1651 After: grep -E "table=[0-9]+" tests/*.at | wc -l 332 The same applies to resubmits to known tables: Before: grep -E "resubmit\(,[0-9]+\)" tests/*.at | wc -l 168 After: grep -E "resubmit\(,[0-9]+\)" tests/*.at | wc -l 152 There are still some tests that use the direct number, those are tests that reference the logical pipeline through OpenFlows. Solution for those is not very straight forward and will be probably addressed in future. Nevertheless the overall improvement is visible. Ales Musil (26): tests: Add macro to strip table numbers from lflows. tests: Use ovn_strip_lflows instead of single ? for the replace. tests: Use ovn_strip_lflows for cases with sort before sed. tests: Use ovn_strip_lflows for cases without sort. tests: Use ovn_strip_lflows for the rest of lflows. tests: Add macro for OFTABLE_PHY_TO_LOG table number. tests: Add macro for OFTABLE_LOG_INGRESS_PIPELINE table number. tests: Add macro for OFTABLE_OUTPUT_LARGE_PKT_DETECT table number. tests: Add macro for OFTABLE_REMOTE_OUTPUT table number. tests: Add macro for OFTABLE_LOCAL_OUTPUT table number. tests: Add macro for OFTABLE_LOG_TO_PHY table number. tests: Add macro for OFTABLE_MAC_BINDING table number. tests: Add macro for OFTABLE_MAC_LOOKUP table number. tests: Add macro for OFTABLE_CHK_LB_HAIRPIN table number. tests: Add macro for OFTABLE_CHK_LB_HAIRPIN_REPLY table number. tests: Add macro for OFTABLE_CT_SNAT_HAIRPIN table number. tests: Add macro for OFTABLE_GET_FDB table number. tests: Add macro for OFTABLE_LOOKUP_FDB table number. tests: Add macro for OFTABLE_CHK_IN_PORT_SEC table number. tests: Add macro for OFTABLE_CHK_IN_PORT_SEC_ND table number. tests: Add macro for OFTABLE_CHK_OUT_PORT_SEC table number. tests: Add macro for OFTABLE_ECMP_NH_MAC table number. tests: Add macro for OFTABLE_ECMP_NH table number. tests: Add macro for OFTABLE_CHK_LB_AFFINITY table number. tests: Add macro for OFTABLE_MAC_CACHE_USE table number. checkpatch: Add rule to check for hardcoded table numbers tests/ovn-controller-vtep.at | 14 +- tests/ovn-controller.at | 12 +- tests/ovn-macros.at | 25 + tests/ovn-northd.at | 3005 +++++++++++++++++----------------- tests/ovn.at | 1404 ++++++++-------- tests/system-ovn-kmod.at | 16 +- tests/system-ovn.at | 14 +- utilities/checkpatch.py | 12 + 8 files changed, 2270 insertions(+), 2232 deletions(-)