From patchwork Tue Nov 19 01:27:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell Bryant X-Patchwork-Id: 1197085 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.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47H7dk3ZpLz9sPW for ; Tue, 19 Nov 2019 12:34:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id CFCF888137; Tue, 19 Nov 2019 01:33:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id apKAkQfMn3y1; Tue, 19 Nov 2019 01:33:53 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 246E18790F; Tue, 19 Nov 2019 01:33:53 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0D127C18DA; Tue, 19 Nov 2019 01:33:53 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5372EC07AC for ; Tue, 19 Nov 2019 01:33:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 3C23221F76 for ; Tue, 19 Nov 2019 01:33:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FVkMhhM2kYf2 for ; Tue, 19 Nov 2019 01:33:48 +0000 (UTC) X-Greylist: delayed 00:05:09 by SQLgrey-1.7.6 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by silver.osuosl.org (Postfix) with ESMTPS id 8E42A20371 for ; Tue, 19 Nov 2019 01:33:47 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-266-hXA2ZsZBMa2X7qDjsqnyOA-1; Mon, 18 Nov 2019 20:27:24 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F141918B9F82; Tue, 19 Nov 2019 01:27:23 +0000 (UTC) Received: from t480s.redhat.com (ovpn-121-76.rdu2.redhat.com [10.10.121.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8C905E24F; Tue, 19 Nov 2019 01:27:18 +0000 (UTC) From: Russell Bryant To: dev@openvswitch.org Date: Mon, 18 Nov 2019 20:27:12 -0500 Message-Id: <20191119012712.344975-1-russell@ovn.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: hXA2ZsZBMa2X7qDjsqnyOA-1 X-Mimecast-Spam-Score: 0 Subject: [ovs-dev] [PATCH ovn] northd: Match IPv4 or IPv6 for MAC resolution 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" While debugging some problems in a cluster using ovn-kubernetes, I noticed that we're creating two conflicting logical flows. These two flows only matched on the destination MAC address. It was not deterministic whether you'd hit the IPv4 (ARP) or IPv6 (NS) version. This change adds an ip4 or ip6 match to each flow as appropriate. Signed-off-by: Russell Bryant Acked-by: Numan Siddique --- northd/ovn-northd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- NOTE --- I've only tested this by running "make check" and "make check-kernel" so far, and all tests still pass. If I'm reading this code right, I'm really surprised this hasn't come up sooner? I guess we also don't have adequate test coverage for these flows? diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 41e97f841..f0ab43b27 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -9319,7 +9319,7 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, } ovn_lflow_add(lflows, od, S_ROUTER_IN_ARP_REQUEST, 100, - "eth.dst == 00:00:00:00:00:00", + "eth.dst == 00:00:00:00:00:00 && ip4", "arp { " "eth.dst = ff:ff:ff:ff:ff:ff; " "arp.spa = reg1; " @@ -9328,7 +9328,7 @@ build_lrouter_flows(struct hmap *datapaths, struct hmap *ports, "output; " "};"); ovn_lflow_add(lflows, od, S_ROUTER_IN_ARP_REQUEST, 100, - "eth.dst == 00:00:00:00:00:00", + "eth.dst == 00:00:00:00:00:00 && ip6", "nd_ns { " "nd.target = xxreg0; " "output; "