From patchwork Thu Sep 17 12:50:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1366101 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.136; helo=silver.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=CDj3Z5hc; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BscK12W5vz9sSW for ; Thu, 17 Sep 2020 22:51:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id D30C42E190; Thu, 17 Sep 2020 12:50:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rvw9ctYZ7WPN; Thu, 17 Sep 2020 12:50:52 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id C8B2C2E198; Thu, 17 Sep 2020 12:50:51 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A522EC0864; Thu, 17 Sep 2020 12:50:51 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id A7073C0051 for ; Thu, 17 Sep 2020 12:50:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 9D97D878AA for ; Thu, 17 Sep 2020 12:50:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JbfMo3uavdzy for ; Thu, 17 Sep 2020 12:50:49 +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 [63.128.21.124]) by whitealder.osuosl.org (Postfix) with ESMTPS id AAE2A878AE for ; Thu, 17 Sep 2020 12:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600347048; h=from:from: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; bh=GOaBLCxtW8X8Gp1uPcuUpYlkO47Y8iqJc6fkHBTWzkA=; b=CDj3Z5hcqu7xNqM9d23KFlCaciedJpl/HtWqMkvY3jl5YDBX+4gkoYTTo24IHTWtI/NhE3 W6fLUxuo3W6OThcNKpuBwfPx2YMrpwts8YM+EvQv2W5Leuca4/EFNkMU2fNPd10akQ1dZd h8ji9V1Dy2L9uoC5dN+haQk9biAuXOc= 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-514-3IQz8XRMNRSnpkR1TqS6SQ-1; Thu, 17 Sep 2020 08:50:46 -0400 X-MC-Unique: 3IQz8XRMNRSnpkR1TqS6SQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 763AC8030A2 for ; Thu, 17 Sep 2020 12:50:45 +0000 (UTC) Received: from dceara.remote.csb (ovpn-113-244.ams2.redhat.com [10.36.113.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 02C377EB97 for ; Thu, 17 Sep 2020 12:50:44 +0000 (UTC) From: Dumitru Ceara To: dev@openvswitch.org Date: Thu, 17 Sep 2020 14:50:31 +0200 Message-Id: <20200917125025.19729.19409.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.13 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 Subject: [ovs-dev] [PATCH v3 ovn 0/4] Drop packets destined to own IPs and refactor SNAT processing. 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" The first patch of the series is a bug fix for: https://bugzilla.redhat.com/1876174 If accepted, the first patch should also be backported to stable branches. The following three patches are a series of refactoring to make logical flow processing for SNAT a bit more efficient while reducing code duplication. CC: Numan Siddique Signed-off-by: Dumitru Ceara Dumitru Ceara (4): ovn-northd: Drop IP packets destined to router owned IPs (after NAT). ovn-northd: Move NAT ARP/ND resolution to separate functions. ovn-northd: Refactor parsing of *_force_snat_ip. ovn-northd: Refactor processing of SNAT IPs. lib/ovn-util.c | 6 + lib/ovn-util.h | 2 northd/ovn-northd.8.xml | 24 ++ northd/ovn-northd.c | 547 +++++++++++++++++++++++++++-------------------- tests/ovn.at | 88 ++++++++ 5 files changed, 428 insertions(+), 239 deletions(-) --- V3: - turned the patch in a series (bug fix + refactoring) - patch1: - implement Numan's suggestion to avoid redundant flows in lr_in_arp_resolve. V2: - rebased changes.