From patchwork Thu Aug 1 23:52:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Sharma X-Patchwork-Id: 1140845 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=nutanix.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nutanix.com header.i=@nutanix.com header.b="NqFrqycL"; dkim-atps=neutral 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 4606b76hRsz9sBF for ; Fri, 2 Aug 2019 09:54:27 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 4454C14D6; Thu, 1 Aug 2019 23:52:26 +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 E8C8D14B8 for ; Thu, 1 Aug 2019 23:52:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx0b-002c1b01.pphosted.com (mx0b-002c1b01.pphosted.com [148.163.155.12]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 5D6A1E7 for ; Thu, 1 Aug 2019 23:52:24 +0000 (UTC) Received: from pps.filterd (m0127841.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x71No2f3009191 for ; Thu, 1 Aug 2019 16:52:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=proofpoint20171006; bh=dsKF0T11K4gaxa/wtd/1obzTi3d+oxqVL6IaAb9SRKw=; b=NqFrqycL0PPqZC8jNRQwa0vIdqUcdjx7yk3AB7VZchXtYnqZC+aqb0hjh2IHfHc7dcgD mXkL3pWqEAwOtq3zLnd3ejasC3B5ADxqGCr70Dc3HDxPnbW3njTQXY1Srbc4RSGq0P1s 99xwodn5inmtcDC8Vum88q+s4S9ygVkmEtMGXg2V+1Cqkt7IoHVnva89F6PkGNXwPouI K4c/vXobt2LT7YZjNx3UeI7NYqUFiYQuRaoyDMbmecv14M9EZ/voG+XXhvcjwkOfsniA MGcEYEafxw5ipct/SvmXtmedud8FwJ4sus12qh8PD6k2g96MAgWwxNMM2TTZlWkzECzu yQ== Received: from nam02-cy1-obe.outbound.protection.outlook.com (mail-cys01nam02lp2057.outbound.protection.outlook.com [104.47.37.57]) by mx0b-002c1b01.pphosted.com with ESMTP id 2u0m58jget-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 01 Aug 2019 16:52:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=daN5yXevWuPxAxT+dpPmbCzEuNCYxvvReF9WRDNep08OQlEz33vWI+8GlpvNylF7YqYzpTuR2n3RUd0WAaMQ4scX+ml8o3Ff+U/k3D1emsqFdAAhn9GxJBzjm1mRI8NCPhVFTPbD1OmZzCuh1gXfPSM21oczdca1t3ORgqXYSXIdcyvY1dqV8XbKeSRrmVKXFVzuh5LyJnuNq+FD36twdvLxBQtLKGzJkTgPWj5oRGC47NtHSnVOh4wI8lQkXrLv7E/3mLS+4Yi2pseOS7LuUo7V4COO6MWkAsebPRaQ4GJTwxL4mSYrBinjbLXZ0GQ71KB36h6tfSwzDI6bFdJnhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dsKF0T11K4gaxa/wtd/1obzTi3d+oxqVL6IaAb9SRKw=; b=e6o0CQrLiYArND/YWyfbRiDI1GtJxpMBYszGIwm/oVWZ/L91Zy16yB3NZPQ4j/rFX+XTmIttoIgNNJO940+SG/7a8YqMwHxB/RR7iN1hoDCtYE+RssqYWbRs30RrQpcMfwiPxauBrkvKOD3kbK7wv6OePjl5/bW0ozXxPjf7uu+KjL7jkR595jB/t+5WF6myEyq5KoYpfMlcNFZkDtVjFUGSNVUhTNVZpTMloLcQTbb+TnpnQEFxIR5JoD+fr70BK2kkLTk1TjM8WMgb6rJ+Zyj1z1YRj2uPW82hbMDLWDpTpMeXurjhKJy9fsIKuVolY76xWPiNqlMYj4o+Fugfeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=nutanix.com;dmarc=pass action=none header.from=nutanix.com;dkim=pass header.d=nutanix.com;arc=none Received: from MW2PR02MB3899.namprd02.prod.outlook.com (52.132.178.28) by MW2PR02MB3657.namprd02.prod.outlook.com (52.132.177.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.13; Thu, 1 Aug 2019 23:52:20 +0000 Received: from MW2PR02MB3899.namprd02.prod.outlook.com ([fe80::a4e3:ca62:dfc6:1149]) by MW2PR02MB3899.namprd02.prod.outlook.com ([fe80::a4e3:ca62:dfc6:1149%3]) with mapi id 15.20.2136.010; Thu, 1 Aug 2019 23:52:20 +0000 From: Ankur Sharma To: "ovs-dev@openvswitch.org" Thread-Topic: [PATCH v3 3/4 ovn] OVN: Vlan backed DVR N-S, avoid get_arp on non redirect chassis. Thread-Index: AQHVSMQoAeYnt18sWU2pnpdpHLrtGg== Date: Thu, 1 Aug 2019 23:52:20 +0000 Message-ID: <1564703707-21545-4-git-send-email-ankur.sharma@nutanix.com> References: <1564703707-21545-1-git-send-email-ankur.sharma@nutanix.com> In-Reply-To: <1564703707-21545-1-git-send-email-ankur.sharma@nutanix.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR06CA0041.namprd06.prod.outlook.com (2603:10b6:a03:14b::18) To MW2PR02MB3899.namprd02.prod.outlook.com (2603:10b6:907:4::28) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 1.8.3.1 x-originating-ip: [192.146.154.1] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 77e6d32c-83fa-4774-1cc0-08d716db4a9f x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MW2PR02MB3657; x-ms-traffictypediagnostic: MW2PR02MB3657: x-microsoft-antispam-prvs: x-proofpoint-crosstenant: true x-ms-oob-tlc-oobclassifiers: OLM:3044; x-forefront-prvs: 01165471DB x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(396003)(346002)(366004)(376002)(136003)(199004)(189003)(76176011)(2501003)(6512007)(2351001)(25786009)(5640700003)(36756003)(8676002)(7736002)(316002)(6506007)(14444005)(6436002)(8936002)(53936002)(71200400001)(305945005)(102836004)(66946007)(2906002)(256004)(5024004)(81156014)(81166006)(6486002)(3846002)(386003)(26005)(86362001)(50226002)(68736007)(2616005)(6916009)(14454004)(478600001)(66574012)(5660300002)(486006)(66476007)(66556008)(64756008)(66446008)(66066001)(52116002)(107886003)(4720700003)(186003)(446003)(4326008)(44832011)(6116002)(99286004)(11346002)(71190400001)(476003)(64030200001); DIR:OUT; SFP:1102; SCL:1; SRVR:MW2PR02MB3657; H:MW2PR02MB3899.namprd02.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nutanix.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: w2FwsygeBCzk1i7pdBn+gQhS07YLuSesYBDXUTDXEDI6van6XBISh5063cJxej9tjNW2QUmx4ifOGVpCk6+4NRI0HvWsDsu2BvtEMZkNb0x1qdNJHAfaVBsJJ/vY/an4dttIgH42n5fOpX+qc7Tgn3g9gv616+BHheLKO4spdkNpQ6ghCErcrlItmR9YFugQtrgJuefj47CUmC0mtS136xRHd7PkKj3L60FmCGwN6A1ZFAEUL82rIk329cRR3lbpu8dnzVIffVeJIyvSszyMpT5LVcRDwqC0LgNTU5Kz7JsWlhtpxpF4h/vD2E712GtYWDPvXOsgt93OxA/Fx2LvJqjAgUctBMUm4PnYSn8uzLBTF2+cDpWHDNXPh7xUyfscslulpYVULVckbTXyumYlRBRuc3sTBHeCKAuJPFCxuVU= MIME-Version: 1.0 X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77e6d32c-83fa-4774-1cc0-08d716db4a9f X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Aug 2019 23:52:20.3603 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ankur.sharma@nutanix.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR02MB3657 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-01_10:2019-07-31,2019-08-01 signatures=0 X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_LOW 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 v3 3/4 ovn] OVN: Vlan backed DVR N-S, avoid get_arp on non redirect chassis. 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 Background: With c0974331b7a19a87ab8f1f2cec8fbe366af92fa2, we have added support for E-W workflow for vlan backed DVRs. This series enables N-S workflow for vlan backed DVRs. Key difference between E-W and N-S traffic flow is that N-S flow requires a gateway chassis. A gateway chassis will be respondible for following: a. Doing Network Address Translation (NAT). b. Becoming entry and exit point for North->South and South->North traffic respectively. OVN by default always uses overlay encapsulation to redirect the packet to gateway chassis. This series will enable the redirection to gateway chassis in the absence of encapsulation. This patch: a. Make sure that ARP request for endpoint behind the gateway router port is sent from gateway chassis only and not from host(compute) chassis. b. This is achieved by adding a new logical flow in lr_in_arp_resolve at priority=50. c. This flow run on non gateway chassis and sets the destination mac to router port mac, if outport is a gateway chassis attached router port and redirect-type is set as "vlan". Example logical flow: table=9 (lr_in_arp_resolve ), priority=50 , match=(outport == "router-to-underlay" && !is_chassis_resident("cr-router-to-underlay")), action=(eth.dst = 00:00:01:01:02:04; next;) d. This change is needed because other wise for non resolved ARPs, we will end up doing get_arp in host chassis. Doing so will have following issues: i. We want all the interation with North bound endpoints via gateway chassis only, doing so on host chassis will violate that. ii. With get_arp, ovn-controller will generate the ARP using router port's mac as source mac, which will lead us to the same issue, where router port mac will be going through continous mac moves in physical network. Worst, it would affect the redirection, since it uses router port mac as destination mac. Signed-off-by: Ankur Sharma Signed-off-by: Ankur Sharma > --- northd/ovn-northd.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 7c0fd6c..ba38ef6 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -7565,6 +7565,28 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, 100, ds_cstr(&match), ds_cstr(&actions)); } } + + if (op->nbrp->n_gateway_chassis && !op->derived) { + const char *redirect_type = smap_get(&op->nbrp->options, + "redirect-type"); + if (redirect_type && !strcasecmp(redirect_type, "vlan")) { + /* Packet is on a non gateway chassis and + * has an unresolved ARP on a network behind gateway + * chassis attached router port. Since, redirect type + * is set to vlan, hence instead of calling "get_arp" + * on this node, we will redirect the packet to gateway + * chassis, by setting destination mac router port mac.*/ + ds_clear(&match); + ds_put_format(&match, "outport == %s && " + "!is_chassis_resident(%s)", op->json_key, + op->od->l3redirect_port->json_key); + ds_clear(&actions); + ds_put_format(&actions, "eth.dst = %s; next;", + op->lrp_networks.ea_s); + ovn_lflow_add(lflows, op->od, S_ROUTER_IN_ARP_RESOLVE, + 50, ds_cstr(&match), ds_cstr(&actions)); + } + } } else if (op->od->n_router_ports && strcmp(op->nbsp->type, "router") && strcmp(op->nbsp->type, "virtual")) { /* This is a logical switch port that backs a VM or a container.