From patchwork Sun Oct 11 12:05:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1380312 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: 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=PE4q+CQY; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C8L9R402Zz9sS8 for ; Sun, 11 Oct 2020 23:05:28 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A48F4878BD; Sun, 11 Oct 2020 12:05:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WlKGCZoQAVyR; Sun, 11 Oct 2020 12:05:24 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 543EB873F7; Sun, 11 Oct 2020 12:05:24 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 38F39C07FF; Sun, 11 Oct 2020 12:05:24 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8F32EC0051 for ; Sun, 11 Oct 2020 12:05:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 72531873FB for ; Sun, 11 Oct 2020 12:05:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y8gHjAIn8bsA for ; Sun, 11 Oct 2020 12:05:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by hemlock.osuosl.org (Postfix) with ESMTPS id 12F5B873F7 for ; Sun, 11 Oct 2020 12:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602417920; 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=DMTcgxA2RT83IBWqyvnH0Mbg+ByLIKOrddPWNbsNWo8=; b=PE4q+CQYOsKSzjuSzHCL2n2mr9j/Ugq+sexyxYKx0Shgt2YLxfgvkniQzMur9YfJ/PZGG2 BGQHZYnxubFl/TYjNU6lSLIZzZi7L2w5ZapSy8nAQxYgVR7PmN0NI3pJiJZgBOXweIQ6uZ i82l9ZtRXVkHLTK9D8Wa53NXpiCw8Ek= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-445-WK01nzl5OvCldXGMf5F6_Q-1; Sun, 11 Oct 2020 08:05:18 -0400 X-MC-Unique: WK01nzl5OvCldXGMf5F6_Q-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B8FBE1868400; Sun, 11 Oct 2020 12:05:17 +0000 (UTC) Received: from dceara.remote.csb (ovpn-112-46.ams2.redhat.com [10.36.112.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44FD576644; Sun, 11 Oct 2020 12:05:15 +0000 (UTC) From: Dumitru Ceara To: dev@openvswitch.org Date: Sun, 11 Oct 2020 14:05:07 +0200 Message-Id: <20201011120456.3374.30821.stgit@dceara.remote.csb> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: hzhou@ovn.org Subject: [ovs-dev] [PATCH v5 ovn 0/4] ofctrl: Add a predictable resolution for conflicting flow actions. 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" Patch 1 makes sure we never try to merge flow ations unless both flows only have "conjunction" action. Patches 2 and 3 of the series refactor the current ofctrl.c installed flow processing code such that: - order of desired flows is maintained within an installed flow. - the active desired flow is predictably selected (always the first in the list). This is required for patch 4 where we implement a partial ordering of desired flows within installed flows making sure that when selecting the active flow (to be installed in OVS) we always choose the less restrictive one. CC: Han Zhou CC: Numan Siddique CC: Mark Michelson Signed-off-by: Dumitru Ceara Dumitru Ceara (4): ofctrl.c: Only merge actions for conjunctive flows. ofctrl.c: Do not change flow ordering when merging opposite changes. ofctrl.c: Simplify active desired flow selection. ofctrl.c: Add a predictable resolution for conflicting flow actions. controller/ofctrl.c | 305 +++++++++++++++++++++++++++++++++++++-------------- tests/ovn.at | 216 ++++++++++++++++++++++++++++++++++++ 2 files changed, 436 insertions(+), 85 deletions(-) --- v5: - Turn the patch into a series. - Address Han's comments. - Ensure predictable flow ordering in all cases (during incremental procesing or full recomputation). v4: - Address Han's comments: - make sure only flows with action conjunction are combined. v3: - Add Mark's ack. - Add last missing pcap check in the test. v2: - Address Han's comments: - Do not delete desired flow that cannot be merged, it might be installed later. - Fix typos in the commit log. - Update the test to check the OVS flows.