From patchwork Wed Jul 31 05:53:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Sharma X-Patchwork-Id: 1139518 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="j7BkZWW4"; 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 45z2yl1czTz9s00 for ; Wed, 31 Jul 2019 16:07:43 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 63FC93784; Wed, 31 Jul 2019 06:06:34 +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 A7E4A36CB for ; Wed, 31 Jul 2019 05:53:08 +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 6AC34A8 for ; Wed, 31 Jul 2019 05:53:07 +0000 (UTC) Received: from pps.filterd (m0127842.ppops.net [127.0.0.1]) by mx0b-002c1b01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x6V5oMwf016924 for ; Tue, 30 Jul 2019 22:53:06 -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=5nwgGU3Fc79EzBAsiYKj1gu29BuFxcIoHNmUxJ4AH34=; b=j7BkZWW4NXH0lHF0ivh+T0APCvi0jHRMcp+ZUwJOqXvv2HH2dEzm+vHjw7of5IHwTbrb eW1cVb8xyvSTnooyofuGIZbFsiSX9EtvdBtXqEQ4CcvUYrIriu9FivCSHSPcAl4OefC7 P5F52tJLalz6Te+AAxl0qJ2du+Guoy/D4LAeh+cnoRNiBcaDvWbCX0rgbBsSL7LmoJmj 2MvC5AwdHS2ZBGTteiFXTW6cOQ5wn2CP5RHHi72vMhT9zJuX62T+QPZVDl6bIohQV/ld KrvjVg/MhXtKkpBPxrv6msF9dXZgXdUrCCt17MNigySVf/1eVVHYY4oQO51TDtRznr/z 8Q== Received: from nam05-by2-obe.outbound.protection.outlook.com (mail-by2nam05lp2056.outbound.protection.outlook.com [104.47.50.56]) by mx0b-002c1b01.pphosted.com with ESMTP id 2u0nxexf17-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 30 Jul 2019 22:53:06 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ezq71dkuWa6oQdF2DX2Wwi1mBhJ/YinXZkIFbDvSDuHnNyVvNLnPfY+VE0xCxtlbgMTYpp4p4eyiZE5Ktp7Q7Ow6EM6ZUUYMN4rZV/UKJPJCV578sg/rdGWMA6faUMWd4R+j76DPFIERq57aZi1PWK/n7y2aT2H8ov2rYGUE/ibyQSIUzxBWm/8bKqiogRfFzCCiTxvFqrCN0YJt9NyXw2G/GwbotAPkjzdStv6JCVRS4aNX94BaiYWL9bVtt5fDXoO51UF1Fpy5guJOPUonG0JEb6hSuCugVrdLv7iVoxTvB79rBY//Xan/BBi3yDcDdNToVDiXxU9q72G93FFA/A== 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=5nwgGU3Fc79EzBAsiYKj1gu29BuFxcIoHNmUxJ4AH34=; b=Toou575jGDnG7EYqMi6B40WYgqmutcEgpS8GDOanTCMg4rgV6i+TLeFLlzz1kTv9ZP8uCGU2Nof6v97aZiXHYvIcZHgzsG5mSK5CIOj7ZhTIPVhXNoTWZzt3kdTs16ltwLhxbUG08/Miufm0028zAvpcUxh1lMaUUByimW8lfp2pR5a3Ko0gFtrBrhuCiWLAWVG+N9bPYBwGFuG4OvqWoj9O4zNmsvHmoXxQDAElKR++S2F8Ax1vRpmxaQr+hqnQ8sGS9bQ/56odh7w1/Vt2jbPsb55QZ3chS1e6SOln3EQc95sfmf6GhoZn0kolB5BkgVkoaokrS02YxQrpxG90yQ== 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 MW2PR02MB3676.namprd02.prod.outlook.com (52.132.177.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.12; Wed, 31 Jul 2019 05:53:04 +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.2115.005; Wed, 31 Jul 2019 05:53:04 +0000 From: Ankur Sharma To: "ovs-dev@openvswitch.org" Thread-Topic: [PATCH v1 3/4] OVN: Vlan backed DVR N-S, avoid get_arp on non redirect chassis. Thread-Index: AQHVR2Q4+Mff6C2wHUq4T78qP6emVg== Date: Wed, 31 Jul 2019 05:53:04 +0000 Message-ID: <1564552462-17131-4-git-send-email-ankur.sharma@nutanix.com> References: <1564552462-17131-1-git-send-email-ankur.sharma@nutanix.com> In-Reply-To: <1564552462-17131-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: BYAPR06CA0024.namprd06.prod.outlook.com (2603:10b6:a03:d4::37) 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: fdc3ca9a-f22a-4963-02d1-08d7157b5ae4 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MW2PR02MB3676; x-ms-traffictypediagnostic: MW2PR02MB3676: x-microsoft-antispam-prvs: x-proofpoint-crosstenant: true x-ms-oob-tlc-oobclassifiers: OLM:3044; x-forefront-prvs: 011579F31F x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(39860400002)(376002)(396003)(346002)(136003)(199004)(189003)(66556008)(81166006)(316002)(14454004)(8676002)(4326008)(81156014)(36756003)(107886003)(5024004)(14444005)(53936002)(2501003)(256004)(52116002)(86362001)(68736007)(6916009)(4720700003)(478600001)(305945005)(476003)(7736002)(25786009)(2906002)(64756008)(26005)(6486002)(6506007)(71190400001)(76176011)(6436002)(44832011)(102836004)(8936002)(6512007)(5640700003)(2616005)(66066001)(486006)(71200400001)(50226002)(66946007)(11346002)(186003)(446003)(66446008)(66574012)(2351001)(6116002)(3846002)(5660300002)(66476007)(386003)(99286004)(64030200001); DIR:OUT; SFP:1102; SCL:1; SRVR:MW2PR02MB3676; 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: DdZB764asqrPMpqKBC/FzHrz5nFAv/3FOwgtG6Vr2iu/wAqEBcn1PHG+0AHxEMNJQaK4hZFX49ad9o92vxGhE4B82i8F9NmrR5v+et/PAPWI4WHWwV6/Vk9VZIqHB3HTd/WMKzBIzPnkv6CI7vCi30KKna+nYdh2QXBiYkpgJIPS/N8EuNqNERey9E+0K4VqXBgLMDp5QEo549z7O9vRYB0qltzCPb8nvqJlCUtIs1fN93XlSsk1RPqRSIkNR1Ib8JwLtqzMCJBvydvjf9lmJ/QPKWzttOxZl9y9qqkl0FavRemuRywP9cOd8AgGEMUhtkvHzWBy3w81bHIhRAzwWlZeOuTHBpFxjd01nPcWOh5uEIDJ99YE+BamIsBU9iG6ebosDjAlWNxSUPqwHafPuRRwRD2TPs5XLjT09o+msyo= MIME-Version: 1.0 X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: fdc3ca9a-f22a-4963-02d1-08d7157b5ae4 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jul 2019 05:53:04.8426 (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: MW2PR02MB3676 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-07-31_02:2019-07-31,2019-07-31 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 v1 3/4] 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 --- northd/ovn-northd.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 25c58e8..cbfbb2c 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -7510,6 +7510,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")) { /* This is a logical switch port that backs a VM or a container. * Extract its addresses. For each of the address, go through all