From patchwork Thu Nov 19 03:35:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihar Hrachyshka X-Patchwork-Id: 1402715 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=eF6L4TrD; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cc51W19Pcz9sTR for ; Thu, 19 Nov 2020 14:35:58 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 812298652A; Thu, 19 Nov 2020 03:35:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V98_agnVRz10; Thu, 19 Nov 2020 03:35:56 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9EA9E860E0; Thu, 19 Nov 2020 03:35:56 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 816DEC0800; Thu, 19 Nov 2020 03:35:56 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 70AC5C07FF for ; Thu, 19 Nov 2020 03:35:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5710D86149 for ; Thu, 19 Nov 2020 03:35:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PjlpiJLV4DyJ for ; Thu, 19 Nov 2020 03:35:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by fraxinus.osuosl.org (Postfix) with ESMTPS id BDF69860E0 for ; Thu, 19 Nov 2020 03:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605756953; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LCzd6nOXog6A6QSlRwlKyyQMAtrL9yPO2kePcEprBB8=; b=eF6L4TrDGXj+XSZ5G4LuOA9UZjU+6kF0lfutl7UAugaOmo76mm3deWmOfJAtC4Qpv548u1 NYkx2u5rFDCRVNl9ztehDyjroiLPk53GxszKqPh0/GDxdZ923ihffUtGfq0mRbIfkGRbnv ZWUF/EAgQ9aVif0nCu/Hf7GhHWRmiPk= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-539-CHbk-EguPUeF8HcX5TlOzw-1; Wed, 18 Nov 2020 22:35:52 -0500 X-MC-Unique: CHbk-EguPUeF8HcX5TlOzw-1 Received: by mail-qv1-f69.google.com with SMTP id m11so3418813qvu.6 for ; Wed, 18 Nov 2020 19:35:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LCzd6nOXog6A6QSlRwlKyyQMAtrL9yPO2kePcEprBB8=; b=J6va2BCUA1SgDtSGlUMvl9wuKbKSnIn/rjB3yDGOEeVk2G1VAdzZkp+ytQuhzcqULG 4x9wvAmH7ZpBjIsFZFrMEQaieIMUWckyIyfBr8f3pH95A0Kyg3SPIE9SgTZjQDTne3GG EQqSsMGp+QNVnyEC/nWma9eeeXTI7p5WExOFJcpxo6RquIrO5oC/J2vnbdMP8nTwEHkx bquxbc+C9YZVUM6i4BrVNKqccsuDENh2v+1y1+G/kkNTZC0ps11/ECPVrLiKFVnu8rv9 fGaGTmJaDCfFmznoo3MCeptencPGgWYEdvHng35GHZp0mk6uzqIWRyS6FUH71t9M+S95 zaew== X-Gm-Message-State: AOAM531PjJz2P5ytGfze2749lE/NSy/uQZto3AW3E5wXvVvO0F+BS0ud VW3IiVlj+B1rqq5DnShZhCOJ4mZvP/3/bcWeHFb94KADIIDAioBBEbqJJGpvxN+VQeh12NFtwGY dx4i6/IWkYrycn1ZF+2Rs5ec4EOyaRsJKHH3cU+i8rL4nNOZTgJ1ZJ2NIxg3rwbRA X-Received: by 2002:aed:2744:: with SMTP id n62mr9162870qtd.67.1605756951228; Wed, 18 Nov 2020 19:35:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzuvrWnWxbCrElzYSOjduDZe8cvSmSULZs/BFzAFFtL1Tlkkdu2+026KQMnipcSZsY0lMiSnQ== X-Received: by 2002:aed:2744:: with SMTP id n62mr9162857qtd.67.1605756950971; Wed, 18 Nov 2020 19:35:50 -0800 (PST) Received: from localhost.localdomain.com (cpe-172-73-180-250.carolina.res.rr.com. [172.73.180.250]) by smtp.googlemail.com with ESMTPSA id t133sm18269860qke.82.2020.11.18.19.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 19:35:49 -0800 (PST) From: Ihar Hrachyshka To: dev@openvswitch.org Date: Wed, 18 Nov 2020 22:35:01 -0500 Message-Id: <20201119033501.798597-1-ihrachys@redhat.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ihrachys@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH] Allow to create tunnel ports with the same config X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" It's a legal setup where tunnel ports with the same config are created on different bridges served by Open vSwitch. Specifically, multiple OVN controllers may emulate multiple chassis running on the same physical host, in which case they may need to create separate tunnel ports to connect to the same remote chassis on their respective bridges. Signed-off-by: Ihar Hrachyshka --- ofproto/tunnel.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c index 3455ed233..fc45d40f9 100644 --- a/ofproto/tunnel.c +++ b/ofproto/tunnel.c @@ -148,11 +148,11 @@ ofproto_tunnel_init(void) static bool tnl_port_add__(const struct ofport_dpif *ofport, const struct netdev *netdev, - odp_port_t odp_port, bool warn, bool native_tnl, const char name[]) + odp_port_t odp_port, bool warn OVS_UNUSED, bool native_tnl, + const char name[]) OVS_REQ_WRLOCK(rwlock) { const struct netdev_tunnel_config *cfg; - struct tnl_port *existing_port; struct tnl_port *tnl_port; struct hmap **map; @@ -174,21 +174,6 @@ tnl_port_add__(const struct ofport_dpif *ofport, const struct netdev *netdev, tnl_port->match.pt_mode = netdev_get_pt_mode(netdev); map = tnl_match_map(&tnl_port->match); - existing_port = tnl_find_exact(&tnl_port->match, *map); - if (existing_port) { - if (warn) { - struct ds ds = DS_EMPTY_INITIALIZER; - tnl_match_fmt(&tnl_port->match, &ds); - VLOG_WARN("%s: attempting to add tunnel port with same config as " - "port '%s' (%s)", tnl_port_get_name(tnl_port), - tnl_port_get_name(existing_port), ds_cstr(&ds)); - ds_destroy(&ds); - } - netdev_close(tnl_port->netdev); - free(tnl_port); - return false; - } - hmap_insert(ofport_map, &tnl_port->ofport_node, hash_pointer(ofport, 0)); if (!*map) {