From patchwork Fri Jul 12 08:01:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: patchwork-bot+netdevbpf--- via dev X-Patchwork-Id: 1959762 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=qq.com header.i=@qq.com header.a=rsa-sha256 header.s=s201512 header.b=qDFm0TbI; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WL7JK0S99z1xqx for ; Fri, 12 Jul 2024 20:34:40 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 288D881E48; Fri, 12 Jul 2024 10:34:39 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id MZ6bgBO1oS7H; Fri, 12 Jul 2024 10:34:38 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.9.56; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 61C6B81854 Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=qq.com header.i=@qq.com header.a=rsa-sha256 header.s=s201512 header.b=qDFm0TbI Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 61C6B81854; Fri, 12 Jul 2024 10:34:37 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 34A10C0A97; Fri, 12 Jul 2024 10:34: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 UTF8SMTP id 26489C0A96 for ; Fri, 12 Jul 2024 08:16:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with UTF8SMTP id 008EA60AC3 for ; Fri, 12 Jul 2024 08:16:46 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with UTF8SMTP id cJZ3ibYv8U6i for ; Fri, 12 Jul 2024 08:16:45 +0000 (UTC) X-Greylist: delayed 731 seconds by postgrey-1.37 at util1.osuosl.org; Fri, 12 Jul 2024 08:16:44 UTC DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 29AFC60AB1 Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 29AFC60AB1 Authentication-Results: smtp3.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=qq.com header.i=@qq.com header.a=rsa-sha256 header.s=s201512 header.b=qDFm0TbI Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=203.205.221.155; helo=out203-205-221-155.mail.qq.com; envelope-from=1130911995@qq.com; receiver= Received: from out203-205-221-155.mail.qq.com (out203-205-221-155.mail.qq.com [203.205.221.155]) by smtp3.osuosl.org (Postfix) with UTF8SMTPS id 29AFC60AB1 for ; Fri, 12 Jul 2024 08:16:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1720772200; bh=mv1KEDL9QDT4RaxGHgj/2fn3pV5kHGUpry/qtN3tIWM=; h=Date:From:To:Subject; b=qDFm0TbIm0O83FSXspnk7VLHOAGtJLZ5a/Aq5SXzfgG4UCZ313B2/KU7WjlqaY3RM o9UEmiAbYmWzY9o5FuMK26FM4VYQ/rxi6rLw7OVcYboOjtafga4Xx+CBPw7GCIqPST exSkdZiMIPvGAAsZZ+d/+4F7ai+NPT1weQbIe0Go= Received: from vm001.zhangqiang45.lenovo ([221.197.41.162]) by newxmesmtplogicsvrszb9-0.qq.com (NewEsmtp) with SMTP id 4C0E0A4; Fri, 12 Jul 2024 16:01:12 +0800 X-QQ-mid: xmsmtpt1720771272tjs8igx91 Message-ID: X-QQ-XMAILINFO: M3ziZXKDk+iO6f46rx8D/IjiS5+L1ZxhCzCVQxCMZ99dd/GyneOHmOxvf9+xtP RLWyOWbM5ge7fBZqYycTm+uiigBWGmljUKrdHExzGG1GLZYdCf+3Y3YGzi3osdW0UJpXCgr27To7 zKGeEN7E1kEEAhxUtOYU0cnQYc80xFGM4iL0lVKUAHJAuw6Mynhj4q/ASMToBeKvh9qffY4JCqv2 vrudP4syekVcXLnaWoGDfPlCPre02DSYZ6CdstIBi7MwcMfbpPWo9zMp+E/rEfZj/WbQBJA/2uv5 lnZEKKE5iyLL8WOsTQ89aibN8DZYNlCjbTHDKY0uX9h25hTGhzXDSv22iWm64LmZxuMerusebtl6 s5uf6W/KaZNZgYeeeUT3YRh7tF969Vzgd/uu6ingibBamkGxv7pFxG8EpVo14pg/bY/GEr5mECWt 7fHo/RJPlRXlUCwjdLSt6P80Govlk1ORfT7UWm50gUwl6gM9yvMwZkaeeDChgqsgPE7DMi0dD1w/ gp0CIklsjdUWjAngNEpK498KbEHPkmBKjlksOusTzRSWaR7TvHu2ykRD2nmjC+I1rdf5EV/3qZ+g wF6aQcaENNetn2Gb0w+0zvLMQDPItrbmDyRG5EFkPJOwV9E6jLUi+rnZaWAzJXsHcmV4D+Fghv4M Tb1Fz8ksIWzga4k0N8metE7U8G/6GLJcYB6qAzmqtObv1TXNSLuMpqixl0UfENxlirobGv6F67vY sydKy2jWKuwzBk0Cz4ldk/3SeOzgHmXEJwEkb8yWWX0xTiDLwv6qpJgGA/PrJ/okVtRMUu3MsDmH BTKHxBkjssIWjxV+UStXM5/dqaHFmD9zE0t7Cg81cX+sKk0svhKV4KOMow2bMNF29HTsbgExQZ/E 5BTeFIxXSyDlPzHLMZsENW+Lxa0VOgUis5FwmrLfKYVoqNxsQCfNZlOet/gWDIA7KyfcANumss8u HqVbPzarjFEe6faLWk+A== X-QQ-XMRINFO: OWPUhxQsoeAVDbp3OJHYyFg= Date: Fri, 12 Jul 2024 16:01:12 +0800 To: dev@openvswitch.org X-OQ-MSGID: <6690e2c8.LwE27RgeZWKW+6TZ%1130911995@qq.com> User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 12 Jul 2024 10:34:35 +0000 Subject: [ovs-dev] [PATCH ovn] northd: Fix issues for Forwarding_Group X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: 1130911995--- via dev From: patchwork-bot+netdevbpf--- via dev Reply-To: 1130911995@qq.com Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From 805422a85cf839bdff5330cd173f3ae55861efe9 Mon Sep 17 00:00:00 2001 From: zhangqiang45 Date: Mon, 8 Jul 2024 14:25:04 +0800 Subject: [PATCH ovn] northd:Fix issues for Forwarding_Group The use of variables from the outer loop in the inner loop causes the outer loop to terminate prematurely. eg. LVS are three fwgs, fwg1(p1,p2,p3,p4),fwg2(p11,p22), fwg3(p31,p32),only fwg1 in logical_flows. Submitted-at: https://github.com/ovn-org/ovn/pull/250 Signed-off-by: zhangqiang45 --- northd/northd.c | 7 +++++-- tests/ovn.at | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/northd/northd.c b/northd/northd.c index 6898daa00..be1a1e288 100644 --- a/northd/northd.c +++ b/northd/northd.c @@ -7929,6 +7929,9 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct lflow_table *lflows, continue; } + ds_clear(&match); + ds_clear(&actions); + /* ARP responder for the forwarding group's virtual IP */ ds_put_format(&match, "arp.tpa == %s && arp.op == 1", fwd_group->vip); @@ -7959,9 +7962,9 @@ build_fwd_group_lflows(struct ovn_datapath *od, struct lflow_table *lflows, ds_put_cstr(&group_ports, "liveness=\"true\","); } ds_put_cstr(&group_ports, "childports="); - for (i = 0; i < (fwd_group->n_child_port - 1); ++i) { + for (size_t j = 0; j < (fwd_group->n_child_port - 1); ++j) { ds_put_format(&group_ports, "\"%s\",", - fwd_group->child_port[i]); + fwd_group->child_port[j]); } ds_put_format(&group_ports, "\"%s\"", fwd_group->child_port[fwd_group->n_child_port - 1]); diff --git a/tests/ovn.at b/tests/ovn.at index 185ba4a21..b1fd8c69b 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -27054,7 +27054,14 @@ check ovs-vsctl add-port br-int vif3 -- set Interface vif3 external-ids:iface-id # Add a forwarding group on ls2 with lsp21 and lsp22 as child ports # virtual IP - 172.16.1.11, virtual MAC - 00:11:de:ad:be:ef check ovn-nbctl --wait=hv fwd-group-add fwd_grp1 ls2 172.16.1.11 00:11:de:ad:be:ef lsp21 lsp22 +check ovn-nbctl --wait=hv fwd-group-add fwd_grp2 ls2 172.16.2.11 00:22:de:ad:be:ef lsp21 lsp22 +# Check logical flow +AT_CAPTURE_FILE([sbflows]) +ovn-sbctl dump-flows > sbflows +AT_CHECK([grep ls_in_l2_lkup sbflows | grep fwd_group | wc -l], [0], [2 +]) +check ovn-nbctl --wait=hv fwd-group-del fwd_grp2 # Check logical flow AT_CAPTURE_FILE([sbflows]) ovn-sbctl dump-flows > sbflows