From patchwork Mon Sep 28 13:54:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurucharan Shetty X-Patchwork-Id: 523352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 750F1140157 for ; Tue, 29 Sep 2015 00:05:06 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id F0E3310312; Mon, 28 Sep 2015 07:05:05 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 849CD1030E for ; Mon, 28 Sep 2015 07:05:03 -0700 (PDT) Received: from bar4.cudamail.com (bar2 [192.168.15.2]) by mx3v1.cudamail.com (Postfix) with ESMTP id 6FDF4618E47 for ; Mon, 28 Sep 2015 08:05:02 -0600 (MDT) X-ASG-Debug-ID: 1443449099-03dc216fbd12a660001-byXFYA Received: from mx3-pf3.cudamail.com ([192.168.14.3]) by bar4.cudamail.com with ESMTP id 2Fg5fCz9sCzA2bVu (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 28 Sep 2015 08:04:59 -0600 (MDT) X-Barracuda-Envelope-From: shettyg@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.3 Received: from unknown (HELO mail-pa0-f53.google.com) (209.85.220.53) by mx3-pf3.cudamail.com with ESMTPS (RC4-SHA encrypted); 28 Sep 2015 14:04:57 -0000 Received-SPF: unknown (mx3-pf3.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.53 Received: by pacfv12 with SMTP id fv12so179417920pac.2 for ; Mon, 28 Sep 2015 07:04:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=ttrBmhEgbK6sq4ma1ScNWaJEVy5rZFvdSvpLmdzZxAo=; b=UM0k4XIc3MJhzkEEQyaavdwCG+ir3tSYSyUrQAse7Zr3I/rxtRWgIrkKVqMe7fmVfL C08dwss3iUWANK6azTv7Mofi1Zo1+AxLMceabeLhW3EAHYFeH4JrVpIt6tIYGKWKbhZq 1UKH0TiET4Tm4yIIBmC9mB+61WPoQ/qVuSR09Al6DAxcmYk5VLqlxPE9CHbEqKq/qwRs zHLFzkmdqcc1y1g5WefJPeEpig6tffgkG983ZApZ4FiAV53AXzY/E+1Mv7WymjYaMPAu lhkUMhZwZlSOb8RhMY3+J+98G3Hz1X2Ptxt4/j/W5xs+rdqDQ1rU/LbIZ6qorrlKh7F4 aPuQ== X-Gm-Message-State: ALoCoQknSt5oG1abaw4KAquc53hcGMdRJ/KXBCTUAy8dUmVABUwGIZpHFt1g7lgUqQV8cjeS8NFf X-Received: by 10.68.103.5 with SMTP id fs5mr27292243pbb.55.1443449097785; Mon, 28 Sep 2015 07:04:57 -0700 (PDT) Received: from htb-1n-eng-dhcp378.eng.vmware.com ([208.91.1.34]) by smtp.gmail.com with ESMTPSA id da3sm13678814pbb.91.2015.09.28.07.04.57 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Sep 2015 07:04:57 -0700 (PDT) X-CudaMail-Envelope-Sender: shettyg@nicira.com X-Barracuda-Apparent-Source-IP: 208.91.1.34 From: Gurucharan Shetty X-Google-Original-From: Gurucharan Shetty To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V3-927017835 X-CudaMail-DTE: 092815 X-CudaMail-Originating-IP: 209.85.220.53 Date: Mon, 28 Sep 2015 06:54:57 -0700 X-ASG-Orig-Subj: [##CM-V3-927017835##][PATCH] ovn-controller: Fix table 33 flows for containers. Message-Id: <1443448497-14226-1-git-send-email-gshetty@nicira.com> X-Mailer: git-send-email 1.9.1 X-Barracuda-Connect: UNKNOWN[192.168.14.3] X-Barracuda-Start-Time: 1443449099 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH] ovn-controller: Fix table 33 flows for containers. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" When containers are inside a VM, the broadcast flow generated in table 33 was faulty. This was because 'lport_to_ofport' did not include logical ports associated with containers. Signed-off-by: Gurucharan Shetty --- ovn/controller/physical.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/ovn/controller/physical.c b/ovn/controller/physical.c index bdb02da..c9bc9de 100644 --- a/ovn/controller/physical.c +++ b/ovn/controller/physical.c @@ -221,9 +221,21 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve, * of datapaths with at least one local port binding. */ struct hmap local_datapaths = HMAP_INITIALIZER(&local_datapaths); + const struct sbrec_port_binding *binding; + /* Populate 'lport_to_ofport' with containers behind local vif. */ + SBREC_PORT_BINDING_FOR_EACH (binding, ctx->ovnsb_idl) { + if (binding->parent_port) { + ofp_port_t ofport; + ofport = u16_to_ofp(simap_get(&lport_to_ofport, + binding->parent_port)); + if (ofport) { + simap_put(&lport_to_ofport, binding->logical_port, ofport); + } + } + } + /* Set up flows in table 0 for physical-to-logical translation and in table * 64 for logical-to-physical translation. */ - const struct sbrec_port_binding *binding; SBREC_PORT_BINDING_FOR_EACH (binding, ctx->ovnsb_idl) { /* Find the OpenFlow port for the logical port, as 'ofport'. This is * one of: @@ -252,15 +264,16 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve, continue; } ofport = u16_to_ofp(simap_get(&localnet_to_ofport, network)); - } else if (binding->parent_port) { - ofport = u16_to_ofp(simap_get(&lport_to_ofport, - binding->parent_port)); - if (ofport && binding->tag) { - tag = *binding->tag; - } } else { ofport = u16_to_ofp(simap_get(&lport_to_ofport, binding->logical_port)); + if (ofport && binding->parent_port) { + if (binding->tag) { + tag = *binding->tag; + } else { + continue; + } + } } const struct chassis_tunnel *tun = NULL;