From patchwork Wed May 12 20:06:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 1477816 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=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) 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=SEelsLIx; dkim-atps=neutral Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FgQmL4m3yz9sCD for ; Thu, 13 May 2021 06:06:42 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 713D56080E; Wed, 12 May 2021 20:06:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QZXz3Ah4pDlj; Wed, 12 May 2021 20:06:38 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTP id AD0366073A; Wed, 12 May 2021 20:06:37 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 72442C000D; Wed, 12 May 2021 20:06:37 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 39599C0001 for ; Wed, 12 May 2021 20:06:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 1A9A960705 for ; Wed, 12 May 2021 20:06:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jtqwP2E2Y4Hn for ; Wed, 12 May 2021 20:06:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id E25C4606CC for ; Wed, 12 May 2021 20:06:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620849993; 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=r2klIR0V1zbxio4FlkqX6NV8M+hQZ8BUH9ZuqBJbzL4=; b=SEelsLIxmb5KKnqPcJb5XFEXgtK7wZEz+o6amrb70Gg2QMgfyQ74IQzJK7+V8SJeZd7yXK FDn6LZkEglsupaO+QKu6FT4pSvmIlSIa7YrTg2Ppg6dEf8dkLt3jIsaB8O3W6xskfEO4vK bGg4uzLg2CAEvtvlU7DujkP+ZgTaGhA= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-363-CvZWCN7yMoyIowSjj2KFng-1; Wed, 12 May 2021 16:06:28 -0400 X-MC-Unique: CvZWCN7yMoyIowSjj2KFng-1 Received: by mail-wm1-f69.google.com with SMTP id j136-20020a1c238e0000b029014675462236so2995566wmj.7 for ; Wed, 12 May 2021 13:06:27 -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:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=r2klIR0V1zbxio4FlkqX6NV8M+hQZ8BUH9ZuqBJbzL4=; b=CPE69MYtSRXKF5AN9jn3DLyKk9xLzPfr1a1sjBBlhms9KqDbaP9x+qg8dgTKzORTBy 5sg8oWO0qGXLj0k3iLf+NL4aL4BPHFglG5L6QJ+pVFJIa1UDJHfatxQ+HDsgUUAxEn7t lc85GHV9I3Lu4fMuF62afKSUazb1PWnqxctTZ+u889yrUanx2UvLn2Rs51sGsPNWzYmm neN4Wn71aD3Bi/qhE58PbIA/pAahxhwWdZ2N9A5I1aEM6vYwer3yRW0/UGT6FwuKo0Nv 4C2L7r206ztcNSdX7ARcpH8pRQz+Bi9k/WsSRmKQQSBb1+ID3jF+y4yNG831uLlbk0g2 ZQsA== X-Gm-Message-State: AOAM530haXNuiTJkO8Xe09sFJoPxevYCpRDcF9TQruuntdAqmaMW9GRA p25ggNMDQksRDU4Fwzh8TswZ58ZeZ0xuFjpjE6x4X7I4owXH8ygbVsxjdRVzJpbgc2DtT9R/ZBL vh7McvNnmvv/3BjBRhYrJiaTPMaj5lJpBj/fzYPOs8xzkM0XXumD7pyH6Mqd5AIyr5tSw6+yjq7 Y= X-Received: by 2002:a5d:40c4:: with SMTP id b4mr48642311wrq.307.1620849986763; Wed, 12 May 2021 13:06:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8PClrCY4K8P+3q5dxL5D2KQo13Z4cafxOsc8xUbMkqYQmdZRT4+IMzjP8W1l5357GfDCdfQ== X-Received: by 2002:a5d:40c4:: with SMTP id b4mr48642292wrq.307.1620849986485; Wed, 12 May 2021 13:06:26 -0700 (PDT) Received: from localhost.localdomain.com ([151.66.126.194]) by smtp.gmail.com with ESMTPSA id o129sm7029970wmo.22.2021.05.12.13.06.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 13:06:26 -0700 (PDT) From: Lorenzo Bianconi To: dev@openvswitch.org Date: Wed, 12 May 2021 22:06:20 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lorenzo.bianconi@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: trozet@redhat.com Subject: [ovs-dev] [PATCH ovn] ovn-nbctl: do not report an error for duplicated ecmp routes with --may-exist 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" Do not report an error adding a duplicated ecmp route if --may-exist parameter is provided. Related bz: https://bugzilla.redhat.com/show_bug.cgi?id=1959909 Signed-off-by: Lorenzo Bianconi --- tests/ovn-nbctl.at | 2 ++ utilities/ovn-nbctl.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/ovn-nbctl.at b/tests/ovn-nbctl.at index 6d91aa4c5..8af55161f 100644 --- a/tests/ovn-nbctl.at +++ b/tests/ovn-nbctl.at @@ -1551,6 +1551,7 @@ IPv4 Routes AT_CHECK([ovn-nbctl --ecmp lr-route-add lr0 10.0.0.0/24 11.0.0.2], [1], [], [ovn-nbctl: duplicate nexthop for the same ECMP route ]) +AT_CHECK([ovn-nbctl --may-exist --ecmp lr-route-add lr0 10.0.0.0/24 11.0.0.2]) dnl Delete ecmp routes AT_CHECK([ovn-nbctl lr-route-del lr0 10.0.0.0/24 11.0.0.1]) @@ -1614,6 +1615,7 @@ AT_CHECK([ovn-nbctl --ecmp-symmetric-reply lr-route-add lr0 2003:0db8:1::/64 200 AT_CHECK([ovn-nbctl --ecmp-symmetric-reply lr-route-add lr0 2003:0db8:1::/64 2001:0db8:0:f103::6], [1], [], [ovn-nbctl: duplicate nexthop for the same ECMP route ]) +AT_CHECK([ovn-nbctl --may-exist --ecmp-symmetric-reply lr-route-add lr0 2003:0db8:1::/64 2001:0db8:0:f103::6]) AT_CHECK([ovn-nbctl lr-route-list lr0], [0], [dnl IPv4 Routes diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c index 48fd0b7ee..84e228f02 100644 --- a/utilities/ovn-nbctl.c +++ b/utilities/ovn-nbctl.c @@ -4073,7 +4073,9 @@ nbctl_lr_route_add(struct ctl_context *ctx) goto cleanup; } } else if (route) { - ctl_error(ctx, "duplicate nexthop for the same ECMP route"); + if (!may_exist) { + ctl_error(ctx, "duplicate nexthop for the same ECMP route"); + } goto cleanup; }