From patchwork Wed Aug 14 01:29:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankur Sharma X-Patchwork-Id: 1146711 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="D3zKYgp/"; 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 467X8M2VpTz9sN1 for ; Wed, 14 Aug 2019 11:30:27 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 8CC48C77; Wed, 14 Aug 2019 01:29:50 +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 894C1B79 for ; Wed, 14 Aug 2019 01:29:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx0a-002c1b01.pphosted.com (mx0a-002c1b01.pphosted.com [148.163.151.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9BCE467F for ; Wed, 14 Aug 2019 01:29:47 +0000 (UTC) Received: from pps.filterd (m0127838.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x7E1Tl0T012430 for ; Tue, 13 Aug 2019 18:29:47 -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=D3bSdSOmr41STS0Xo69XKNKtPkxxjJRjkPU22SaV9gY=; b=D3zKYgp/z7BKmzOyItXZ4DWJJgSciRzC7WWTR2rtA/WpON7WNiEjsA/xg0GJXmZb6Gqi vphGnwDfkSk93Zm3SIP2cauodA81+hpe29C08WkujZCW3AP4WRUrqER5KtxZPZwdPJLO efMvjYXuQkE0gVa8y96kqZcKnPeifAdpWtdJeIAqHB1aJaA8gjU6bDPyJbj2yCvEK2Oq AGdzPFV1JySNUX/8fQ++tYPa0eAL/6z3lPuikv0RBEl35F/FBkYYCWSfR1qz2X5enUfH mkIMqsUVWtFeYdtmrMntAeG4GHOPLyXII1fLZ9V5cj9fTDlv9HZPy2J0HWInHYZiLzHp Hw== Received: from nam01-by2-obe.outbound.protection.outlook.com (mail-by2nam01lp2055.outbound.protection.outlook.com [104.47.34.55]) by mx0a-002c1b01.pphosted.com with ESMTP id 2ubf9u2kx5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 13 Aug 2019 18:29:47 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZKcQ0wrVF26p/ER8NKVH2fW70beVR/RNBz0NH1ClA6emqz3QdIPk5D75MwrQBrDDi0erIVHzSjSyvVrmhikHwT35mEX1dF3SPnlpb9Td+agCRo6KPdDjl0sAdOnkoZvdAQpZYyLU38sgz9y6nvX/XySTNVcf2Cme4wrGxiQYrZcFBqPHGtRpNsDC3bSJ9qsCRtg3kxaT7btDCsmSgkhpu4AgtEsnCfwB5+kqKA2DYf66cHMnxcJ+FX5d/R9Ggiw5/qzNR0aEABUHtQY9lH8Y5NeQWB7mKYVcyIyZjS9u0p9QNHNCSD/zaUnVaMoaB9sIHc32QmOB9zaliU46+b2oiQ== 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=D3bSdSOmr41STS0Xo69XKNKtPkxxjJRjkPU22SaV9gY=; b=TrnSmRE4YmH6Su9dGKDe9ttfWL3B9bTfB8to3THMeaGRISLK9bcNa6Xm+FAUm3YzwWCk3i+D7xbAj2e5qfaOcWoLiLrJK+TpBZY03EXeUml606j0Uv6dmJAoPQZLMb0I3ZESZQrzLccT8Il31e1PJisTfs+l5Marcfe0lDTKaLdN68cH3kSQIWEx6hh+6+IUz5453NjFSFZKQ29ZEbrLyZsiK/r5MhVM4dWp9KFVcDDSNDqeTmDo4VrQnWZt/QtpSs8K8tSPd36iX3zJme8w6Hs0uS+DBeIhJy+WDjr7DcSbpeXKhShBn4IPFjYpsVjoY2YTRYi0dOTKtRK9NCx4xw== 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 MW2PR02MB3738.namprd02.prod.outlook.com (52.132.177.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2157.18; Wed, 14 Aug 2019 01:29:44 +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.2157.022; Wed, 14 Aug 2019 01:29:44 +0000 From: Ankur Sharma To: "ovs-dev@openvswitch.org" Thread-Topic: [PATCH v4 2/4 ovn] OVN: Vlan backed DVR N-S, redirect-type option Thread-Index: AQHVUj/Axdgx9F7CeUOVfVjAHGZboQ== Date: Wed, 14 Aug 2019 01:29:43 +0000 Message-ID: <1565746172-22237-3-git-send-email-ankur.sharma@nutanix.com> References: <1565746172-22237-1-git-send-email-ankur.sharma@nutanix.com> In-Reply-To: <1565746172-22237-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: BYAPR01CA0019.prod.exchangelabs.com (2603:10b6:a02:80::32) 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.98] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 89df591f-6811-4fde-712a-08d72056e2a4 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:MW2PR02MB3738; x-ms-traffictypediagnostic: MW2PR02MB3738: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-proofpoint-crosstenant: true x-ms-oob-tlc-oobclassifiers: OLM:843; x-forefront-prvs: 01294F875B x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(39860400002)(396003)(366004)(346002)(376002)(189003)(199004)(36756003)(26005)(11346002)(86362001)(53936002)(5024004)(2351001)(8936002)(14454004)(7736002)(2501003)(14444005)(476003)(316002)(6512007)(5660300002)(3846002)(2616005)(446003)(107886003)(50226002)(66066001)(2906002)(256004)(478600001)(186003)(71200400001)(6916009)(71190400001)(81156014)(4326008)(66446008)(66476007)(8676002)(102836004)(6436002)(44832011)(81166006)(64756008)(386003)(99286004)(66556008)(6506007)(4720700003)(66946007)(76176011)(52116002)(66574012)(6486002)(6116002)(25786009)(5640700003)(486006)(305945005)(64030200001); DIR:OUT; SFP:1102; SCL:1; SRVR:MW2PR02MB3738; H:MW2PR02MB3899.namprd02.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A: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: t+e4CIMhw06pO8ZdjNG9C013TQcbRf1wqy9JxwMn8dxQquliwHFFHaVrgA8qrlds6QFu250MozWHYTI66gBEZ6RVdbSZPobMAQDEvklZIl6qav8zxbz+7sXHJtC9i38HHMXcOGotHmrKNGvNi6qAJSjGb8X4tO/pMVnfwT4ZCeX0uo79keT1mAvXXAkeO9H2GLniwcPf+C7FcpPWOKPSVSuJWt0cF+4JcCYLsrVfbN7a+D/6H8/uNYvTFQ3zcv0P3tRi5HtKn7Z3dsTuU23W+yXGCii+rP0+dgvYXrDpz4v2+tSFV2E3h4+E90QyNvTo5kN69jr3tDWm9ot2w40YexQPPc8+tje2qdNqwMSxT27dSeavvZ9ygdkmhpXsIUgbY9whvbKqNzJmi3iQOKalHMfv7EaeuCEDaIr+yx9H2yY= MIME-Version: 1.0 X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89df591f-6811-4fde-712a-08d72056e2a4 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Aug 2019 01:29:43.9707 (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: il4geU+wjyFUSDkiNK9AKufXdh+m8Oj/iVMmsCk3C68W0UIEyesjqDkBHJ1Kl1JhQCWcy1ehrzZZf0jK+3YuLhuVdZvAN6mtGOkdUpGZ2Cs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR02MB3738 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-13_07:2019-08-13,2019-08-13 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 v4 2/4 ovn] OVN: Vlan backed DVR N-S, redirect-type option 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. Add a new key-value in options of a router port. b. This new config key will be used by ovn-controller to determine if a redirected packet will go out of tunnel port or localnet port. c. key is "redirect-type" and it takes "overlay" and "vlan" as values. d. Added ovn-nbctl command to set and get redirect-type option on a router port. e. This new configuration is added because vlan or overlay based forwarding is considered to be a logical switch property, hence for a router configuration has to be done at the router port level. f. Restored the function ovsdb_datum_to_smap, which helps in ensuring that we do not overwrite existing options, while adding a new key-value pair to it. This function exists in 2.8.5, i am not able to figure out so far, which release/why it was removed. I do not see a harm in adding it back. Signed-off-by: Ankur Sharma --- northd/ovn-northd.c | 6 +++++ ovn-nb.xml | 43 ++++++++++++++++++++++++++++++++ ovs/lib/ovsdb-data.c | 11 +++++++++ ovs/lib/ovsdb-data.h | 2 ++ tests/ovn-nbctl.at | 25 +++++++++++++++++++ tests/ovn-northd.at | 31 +++++++++++++++++++++++ utilities/ovn-nbctl.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 186 insertions(+) diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index e861344..89ca8df 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -2445,6 +2445,9 @@ ovn_port_update_sbrec(struct northd_context *ctx, if (op->derived) { const char *redirect_chassis = smap_get(&op->nbrp->options, "redirect-chassis"); + const char *redirect_type = smap_get(&op->nbrp->options, + "redirect-type"); + int n_gw_options_set = 0; if (op->nbrp->ha_chassis_group) { n_gw_options_set++; @@ -2536,6 +2539,9 @@ ovn_port_update_sbrec(struct northd_context *ctx, sbrec_port_binding_set_gateway_chassis(op->sb, NULL, 0); } smap_add(&new, "distributed-port", op->nbrp->name); + if (redirect_type) { + smap_add(&new, "redirect-type", redirect_type); + } } else { if (op->peer) { smap_add(&new, "peer", op->peer->key); diff --git a/ovn-nb.xml b/ovn-nb.xml index e166190..8bb6221 100644 --- a/ovn-nb.xml +++ b/ovn-nb.xml @@ -1948,6 +1948,49 @@ issues.

+ + +

+ This options dictates if a packet redirected to + gateway chassis will be overlay encapsulated + or go as a regular vlan packet. +

+ +

+ Option takes following values +

+ +
    +
  • + OVERLAY +
  • + +
  • + VLAN +
  • +
+ +

+ OVERLAY option will ensure that redirected packet goes out as + encapsulation via the tunnel port. +

+ +

+ VLAN option will ensure that redirected packet goes out as vlan + tagged via the localnet port. +

+ +

+ OVERLAY is the default redirection type. +

+ +

+ Option is applicable only to gateway chassis attached logical + router ports. +

+ +
+ diff --git a/ovs/lib/ovsdb-data.c b/ovs/lib/ovsdb-data.c index b0fb20d..c7fcb8a 100644 --- a/ovs/lib/ovsdb-data.c +++ b/ovs/lib/ovsdb-data.c @@ -1691,6 +1691,17 @@ ovsdb_datum_from_smap(struct ovsdb_datum *datum, const struct smap *smap) ovsdb_datum_sort_unique(datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING); } +/* Initializes smap from a string-to-string datum map. */ +void +ovsdb_datum_to_smap(struct smap *smap, const struct ovsdb_datum *datum) +{ + size_t i = 0; + for (; i < datum->n; i++) { + smap_add(smap, datum->keys[i].string, datum->values[i].string); + } + ovs_assert(i == smap_count(smap)); +} + struct ovsdb_error * OVS_WARN_UNUSED_RESULT ovsdb_datum_convert(struct ovsdb_datum *dst, const struct ovsdb_type *dst_type, diff --git a/ovs/lib/ovsdb-data.h b/ovs/lib/ovsdb-data.h index c5a80ee..bf2cd8a 100644 --- a/ovs/lib/ovsdb-data.h +++ b/ovs/lib/ovsdb-data.h @@ -191,6 +191,8 @@ void ovsdb_datum_to_bare(const struct ovsdb_datum *, const struct ovsdb_type *, struct ds *); void ovsdb_datum_from_smap(struct ovsdb_datum *, const struct smap *); +void ovsdb_datum_to_smap(struct smap *smap, const struct ovsdb_datum *datum); + struct ovsdb_error *ovsdb_datum_convert(struct ovsdb_datum *dst, const struct ovsdb_type *dst_type, diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at index cf06966..39b0bff 100644 --- a/tests/ovn-nbctl.at +++ b/tests/ovn-nbctl.at @@ -1220,6 +1220,31 @@ lrp0-chassis1 1 dnl --------------------------------------------------------------------- +OVN_NBCTL_TEST([ovn_nbctl_redirect_type], [logical router port redirect type], [ +AT_CHECK([ovn-nbctl lr-add lr0]) +AT_CHECK([ovn-nbctl lrp-add lr0 lrp0 00:00:00:01:02:03 192.168.1.1/24]) +AT_CHECK([ovn-nbctl lrp-get-redirect-type lrp0], [0], [dnl +overlay +]) +AT_CHECK([ovn-nbctl lrp-set-redirect-type lp0 vlan], [1], [], +[ovn-nbctl: lp0: port name not found +]) +AT_CHECK([ovn-nbctl lrp-set-redirect-type lrp0 vlan], [0], []) +AT_CHECK([ovn-nbctl lrp-get-redirect-type lrp0], [0], [dnl +vlan +]) +AT_CHECK([ovn-nbctl lrp-set-redirect-type lrp0 overlay], [0], []) +AT_CHECK([ovn-nbctl lrp-get-redirect-type lrp0], [0], [dnl +overlay +]) +AT_CHECK([ovn-nbctl lrp-set-redirect-type lrp0 abcd], [1], [], +[ovn-nbctl: Invalid redirect type: abcd +]) + +]) + +dnl --------------------------------------------------------------------- + OVN_NBCTL_TEST([ovn_nbctl_lrp_enable], [logical router port enable and disable], [ AT_CHECK([ovn-nbctl lr-add lr0]) AT_CHECK([ovn-nbctl lrp-add lr0 lrp0 00:00:00:01:02:03 192.168.1.1/24]) diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index 0dea04e..8718130 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -936,3 +936,34 @@ OVS_WAIT_UNTIL([ test 0 = $?]) AT_CLEANUP + +AT_SETUP([ovn -- check Redirect Chassis propagation from NB to SB]) +AT_SKIP_IF([test $HAVE_PYTHON = no]) +ovn_start + +ovn-sbctl chassis-add gw1 geneve 127.0.0.1 + +ovn-nbctl lr-add R1 +ovn-nbctl lrp-add R1 R1-S1 02:ac:10:01:00:01 172.16.1.1/24 + +ovn-nbctl ls-add S1 +ovn-nbctl lsp-add S1 S1-R1 +ovn-nbctl lsp-set-type S1-R1 router +ovn-nbctl lsp-set-addresses S1-R1 router +ovn-nbctl --wait=sb lsp-set-options S1-R1 router-port=R1-S1 + +ovn-nbctl lrp-set-gateway-chassis R1-S1 gw1 + +uuid=`ovn-sbctl --columns=_uuid --bare find Port_Binding logical_port=cr-R1-S1` +echo "CR-LRP UUID is: " $uuid + +ovn-nbctl lrp-set-redirect-type R1-S1 vlan +AT_CHECK([ovn-sbctl get Port_Binding ${uuid} options:redirect-type], [0], [vlan +]) + +ovn-nbctl lrp-set-redirect-type R1-S1 overlay +AT_CHECK([ovn-sbctl get Port_Binding ${uuid} options:redirect-type], [0], [overlay +]) + + +AT_CLEANUP diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c index b8b440e..5444fc7 100644 --- a/utilities/ovn-nbctl.c +++ b/utilities/ovn-nbctl.c @@ -667,6 +667,14 @@ Logical router port commands:\n\ ('enabled' or 'disabled')\n\ lrp-get-enabled PORT get administrative state PORT\n\ ('enabled' or 'disabled')\n\ + lrp-set-redirect-type PORT TYPE\n\ + set whether redirected packet to gateway chassis\n\ + of PORT will be encapsulated or not\n\ + ('overlay' or 'vlan')\n\ + lrp-get-redirect-type PORT\n\ + get whether redirected packet to gateway chassis\n\ + of PORT will be encapsulated or not\n\ + ('overlay' or 'vlan')\n\ \n\ Route commands:\n\ [--policy=POLICY] lr-route-add ROUTER PREFIX NEXTHOP [PORT]\n\ @@ -4597,6 +4605,62 @@ nbctl_lrp_get_enabled(struct ctl_context *ctx) !lrp->enabled || *lrp->enabled ? "enabled" : "disabled"); } + +/* Set the logical router port redirect type. */ +static void +nbctl_lrp_set_redirect_type(struct ctl_context *ctx) +{ + const char *id = ctx->argv[1]; + const char *type = ctx->argv[2]; + const struct nbrec_logical_router_port *lrp = NULL; + struct smap lrp_options; + + char *error = lrp_by_name_or_uuid(ctx, id, true, &lrp); + if (error) { + ctx->error = error; + return; + } + + if (strcasecmp(type, "vlan") && strcasecmp(type, "overlay")) { + error = xasprintf("Invalid redirect type: %s", type); + ctx->error = error; + return; + } + + smap_init(&lrp_options); + + ovsdb_datum_to_smap(&lrp_options, + nbrec_logical_router_port_get_options + (lrp, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING)); + + if (smap_get(&lrp_options, "redirect-type")) { + smap_replace(&lrp_options, "redirect-type", type); + } else { + smap_add(&lrp_options, "redirect-type", type); + } + + nbrec_logical_router_port_set_options(lrp, &lrp_options); + + smap_destroy(&lrp_options); +} + +static void +nbctl_lrp_get_redirect_type(struct ctl_context *ctx) +{ + const char *id = ctx->argv[1]; + const struct nbrec_logical_router_port *lrp = NULL; + + char *error = lrp_by_name_or_uuid(ctx, id, true, &lrp); + if (error) { + ctx->error = error; + return; + } + + const char *redirect_type = smap_get(&lrp->options, "redirect-type"); + ds_put_format(&ctx->output, "%s\n", + !redirect_type ? "overlay": redirect_type); +} + struct ipv4_route { int priority; @@ -5604,6 +5668,10 @@ static const struct ctl_command_syntax nbctl_commands[] = { NULL, "", RW }, { "lrp-get-enabled", 1, 1, "PORT", NULL, nbctl_lrp_get_enabled, NULL, "", RO }, + { "lrp-set-redirect-type", 2, 2, "PORT TYPE", NULL, + nbctl_lrp_set_redirect_type, NULL, "", RW }, + { "lrp-get-redirect-type", 1, 1, "PORT", NULL, nbctl_lrp_get_redirect_type, + NULL, "", RO }, /* logical router route commands. */ { "lr-route-add", 3, 4, "ROUTER PREFIX NEXTHOP [PORT]", NULL,