From patchwork Mon May 27 09:00:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1105700 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45C9tN3K6mz9s5c for ; Mon, 27 May 2019 19:00:44 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 0F5FE167A; Mon, 27 May 2019 09:00:43 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 6BA401671 for ; Mon, 27 May 2019 09:00:31 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E63B913A for ; Mon, 27 May 2019 09:00:30 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id i3so15313578wml.4 for ; Mon, 27 May 2019 02:00:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jzpH4hoVVPbe2+Z9BQEt/9uXxz5MT2bLiNt4mgL9pAI=; b=aXsPBmkRO+6Gk9DcoV1dy06f+GYa9k2pkyVn4NQXVhBKYjESX6jNUo2daHH0ph96i+ ZdFze9CUpjRHQ+0/ebjLOcHiUgbZRxyUBE+3rKvOxYPhhfgCsX/EuvE2n/Y5SmZkKYcT C5yxQKMIpS6fsRsqIw48MatjhJSIvNTwQl1USHVe2lDFUc8GJfMtL6Vycl58SNE+FkP2 vAEPx6ogxFz4iFAmLLi7WsnRTOMVthovmWXuV9JuiR+5I4jHxnr8QjOO2lqbDNu0jix7 gjjOEDtE0nwU2uE3qbVnOc/NnUgIaIA/IqmEh6qCVgya429XJpTmzjdUeLvWoB994heM 0xyg== X-Gm-Message-State: APjAAAW2dqNogUg2dIayKkm5bDw0W9zlhdnhFK2cWfCeU1g7FR8ElxZ0 7QzGLQPxghtRw20EKizrb53GZ0wowVk= X-Google-Smtp-Source: APXvYqw/MxWN38UsJrQk2HKZ4AodcsrE91PiPgiRB9K+edGIwIPpfAW31lA1i5L1GGAJPMTSlxZLIA== X-Received: by 2002:a1c:6545:: with SMTP id z66mr1267554wmb.77.1558947628835; Mon, 27 May 2019 02:00:28 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id h90sm22725479wrh.15.2019.05.27.02.00.28 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 27 May 2019 02:00:28 -0700 (PDT) From: Lorenzo Bianconi To: ovs-dev@openvswitch.org Date: Mon, 27 May 2019 11:00:17 +0200 Message-Id: X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] OVN: do not distribute traffic for local FIP X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Do not send traffic for local FIP through the overlay tunnels but manage it in the local hypervisor Signed-off-by: Lorenzo Bianconi --- ovn/northd/ovn-northd.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ovn/northd/ovn-northd.c b/ovn/northd/ovn-northd.c index de0c06d4b..b233deef2 100644 --- a/ovn/northd/ovn-northd.c +++ b/ovn/northd/ovn-northd.c @@ -5222,6 +5222,19 @@ add_distributed_nat_routes(struct hmap *lflows, const struct ovn_port *op) continue; } + ds_put_format(&match, "inport == %s && " + "ip4.src == %s && ip4.dst == %s", + op->json_key, nat->logical_ip, nat->external_ip); + ds_put_format(&actions, "outport = %s; eth.dst = %s; " + REGBIT_DISTRIBUTED_NAT" = 1; " + REGBIT_NAT_REDIRECT" = 0; next;", + op->od->l3dgw_port->json_key, + nat->external_mac); + ovn_lflow_add(lflows, op->od, S_ROUTER_IN_IP_ROUTING, 400, + ds_cstr(&match), ds_cstr(&actions)); + ds_clear(&match); + ds_clear(&actions); + for (size_t j = 0; j < op->od->nbr->n_nat; j++) { const struct nbrec_nat *nat2 = op->od->nbr->nat[j];