From patchwork Tue Jun 25 10:35:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1121962 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 45Y2cc3Fg1z9s3C for ; Tue, 25 Jun 2019 20:35:43 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 16D1BE35; Tue, 25 Jun 2019 10:35:40 +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 15BB2E2D for ; Tue, 25 Jun 2019 10:35:38 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 6E281710 for ; Tue, 25 Jun 2019 10:35:37 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id c66so2279240wmf.0 for ; Tue, 25 Jun 2019 03:35:37 -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:subject:date:message-id:mime-version :content-transfer-encoding; bh=9GcTesTGFEr5L4CLt+oF/3dtiv/VtW4m+5wjCDp+wV8=; b=Pzmu38mEn3RF9bc0tQIEeKqd17hO78t/Uw407eolnu5e6pWlHA2Bm4aaqp9fNNX5/H T/TmLaUz6iBFarSRsAcMMixNFXl9Q22uzxIs0w8p4Zbuu8NcyUKceCwOnAyEfTIBKGGm nAa2xiUXyPM9+11j3bj6PWcz09E2pqwiOaJXx10iBY5nMB1+HY/pCJwCmv3c4sqAQSxe Na6nydiDmjbbkMMZzNWpqpm7P/MKNMoX2ZUGQESe3BY7uSCaDQwPnl8H8uVOWw2dM+He Ze541wDvYrO0sD9A7CfS9KWQgs6hDlTItnref4o2McG6vf+AQj9eoI+6jkR+QjNCUYax xerg== X-Gm-Message-State: APjAAAWJmJM5dus7C6Qwwu8igR8Y9WGxOLglS/t8UJUbe7g36wTavOpr +5dpfeEx4lqvcSHXwzMaUvLC8CzHv0Y= X-Google-Smtp-Source: APXvYqxrD8V4hp5gFpkbokid86oJIzj14qK8Gc7XOZXqs/KyWKZrETHPL6aRwx5ZJbpbz6GwS5gjeA== X-Received: by 2002:a1c:d107:: with SMTP id i7mr19766661wmg.92.1561458935723; Tue, 25 Jun 2019 03:35:35 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id v65sm2816845wme.31.2019.06.25.03.35.34 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 25 Jun 2019 03:35:35 -0700 (PDT) From: Lorenzo Bianconi To: ovs-dev@openvswitch.org Date: Tue, 25 Jun 2019 12:35:26 +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: add the possibility to specify tunnel dst port 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 Introduce dst_port in options column of Encap table in order to add the capability to configure destination port used for tunnel encapsulation Signed-off-by: Lorenzo Bianconi Acked-by: Numan Siddique Signed-off-by: Lorenzo Bianconi Signed-off-by: Ben Pfaff --- ovn/controller/encaps.c | 4 ++++ ovn/ovn-sb.xml | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ovn/controller/encaps.c b/ovn/controller/encaps.c index 3b3921a73..d4a436df3 100644 --- a/ovn/controller/encaps.c +++ b/ovn/controller/encaps.c @@ -156,6 +156,7 @@ tunnel_add(struct tunnel_ctx *tc, const struct sbrec_sb_global *sbg, struct smap options = SMAP_INITIALIZER(&options); smap_add(&options, "remote_ip", encap->ip); smap_add(&options, "key", "flow"); + const char *dst_port = smap_get(&encap->options, "dst_port"); const char *csum = smap_get(&encap->options, "csum"); char *tunnel_entry_id = NULL; @@ -169,6 +170,9 @@ tunnel_add(struct tunnel_ctx *tc, const struct sbrec_sb_global *sbg, if (csum && (!strcmp(csum, "true") || !strcmp(csum, "false"))) { smap_add(&options, "csum", csum); } + if (dst_port) { + smap_add(&options, "dst_port", dst_port); + } /* Add auth info if ipsec is enabled. */ if (sbg->ipsec) { diff --git a/ovn/ovn-sb.xml b/ovn/ovn-sb.xml index 1a2bc1da9..2dae2768f 100644 --- a/ovn/ovn-sb.xml +++ b/ovn/ovn-sb.xml @@ -364,7 +364,8 @@

Options for configuring the encapsulation. Currently, the only - option that has been defined is csum. + options that has been defined are csum and + dst_port.

@@ -408,6 +409,11 @@ csum defaults to false for hardware VTEPs and true for all other cases.

+ +

+ dst_port is used to define the destination port used + in tunnel encapsulation +