From patchwork Mon Dec 19 16:18:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Adri=C3=A1n_Moreno?= X-Patchwork-Id: 1717473 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=140.211.166.133; helo=smtp2.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=SGGpNCc/; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 4NbPzg6tN5z1ydb for ; Tue, 20 Dec 2022 03:19:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 3A334405F5; Mon, 19 Dec 2022 16:19:26 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3A334405F5 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=SGGpNCc/ 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 MVQjqDEGL2Mm; Mon, 19 Dec 2022 16:19:25 +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 36A26405DD; Mon, 19 Dec 2022 16:19:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 36A26405DD Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5A909C0097; Mon, 19 Dec 2022 16:19:23 +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 A90E1C0088 for ; Mon, 19 Dec 2022 16:19:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E69A280898 for ; Mon, 19 Dec 2022 16:18:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org E69A280898 Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SGGpNCc/ 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 NoyeHNH8zZJS for ; Mon, 19 Dec 2022 16:18:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 219A28109A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 219A28109A for ; Mon, 19 Dec 2022 16:18:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671466707; 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=HSPa2ZKjvyzGVX2DpKnelpiErUS7T4I/7J6uDn0xx7M=; b=SGGpNCc/DvS0oUAVFD3SToLgi2hHUO8X9cWnlDYKCpn20cW/PA25Z/BPOihRAvHmPa5qWv G0H1m2BtkFPdlJFsGuTy6y5C4u9bIq3N1GKfJWHEi6VdF79Hgfyrp+nBzL6NpayIB28TF0 cchUn7WZmxoupwldjtWU4Sn+qjAVSJ0= 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-587-P9PX4NtGPR2qAVWQlkN4QA-1; Mon, 19 Dec 2022 11:18:23 -0500 X-MC-Unique: P9PX4NtGPR2qAVWQlkN4QA-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 19EB43815D24 for ; Mon, 19 Dec 2022 16:18:23 +0000 (UTC) Received: from antares.redhat.com (unknown [10.39.192.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5485B2026D4B; Mon, 19 Dec 2022 16:18:22 +0000 (UTC) From: Adrian Moreno To: dev@openvswitch.org Date: Mon, 19 Dec 2022 17:18:08 +0100 Message-Id: <20221219161814.55422-1-amorenoz@redhat.com> 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 ovn 0/6] drop sampling: Fixes and optimizations 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" While testing, I discovered some problems with drop sampling (first 4 patches). Also, this series introduces an optimization. In order to avoid adding sample actions on Chassis that do not have a Flow_Sample_Collector_Set configured (which would generate a useless upcall), make the controller monitor this table in OVS and recompute flows when it's changed. The engine logic is pretty simple since this table is assumed to change very rarely. Adrian Moreno (6): controller: fix recompute pflows if sampling changes northd: fix unsampled drops and unit test controller: add missing drop to loopback check table controller: set sampling port to OFP_NONE for drops controller: only sample flow if Collector Set exists controller: only sample pflow if Collector Set exists controller/lflow.c | 1 + controller/lflow.h | 8 +- controller/ovn-controller.c | 161 +++++++++++++++++++++++++++++------- controller/physical.c | 2 + include/ovn/actions.h | 4 + lib/actions.c | 9 +- lib/ovn-util.c | 51 ++++++++++++ lib/ovn-util.h | 27 +++++- northd/northd.c | 17 ++-- tests/ovn-performance.at | 24 ++++++ tests/ovn.at | 15 +++- tests/test-ovn.c | 9 ++ 12 files changed, 281 insertions(+), 47 deletions(-)