From patchwork Sat Jan 8 14:58:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng Li X-Patchwork-Id: 1577253 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=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4JWNWt0mF2z9t6h for ; Sun, 9 Jan 2022 01:58:48 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7DBB240902; Sat, 8 Jan 2022 14:58:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e4zCGZGgvycx; Sat, 8 Jan 2022 14:58:45 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id B21734089F; Sat, 8 Jan 2022 14:58:44 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 758F4C0030; Sat, 8 Jan 2022 14:58:44 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id EEA3AC001E for ; Sat, 8 Jan 2022 14:58:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id EB0D2408BB for ; Sat, 8 Jan 2022 14:58:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MAsKFHYfpjRn for ; Sat, 8 Jan 2022 14:58:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from chinatelecom.cn (prt-mail.chinatelecom.cn [42.123.76.228]) by smtp4.osuosl.org (Postfix) with ESMTP id 975BC4089F for ; Sat, 8 Jan 2022 14:58:39 +0000 (UTC) HMM_SOURCE_IP: 172.18.0.218:43590.1103793323 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-110.184.64.64 (unknown [172.18.0.218]) by chinatelecom.cn (HERMES) with SMTP id 295E92800DD for ; Sat, 8 Jan 2022 22:58:32 +0800 (CST) X-189-SAVE-TO-SEND: lic121@chinatelecom.cn Received: from ([172.18.0.218]) by app0025 with ESMTP id b7288bf02dee48a4918323386e94ea59 for dev@openvswitch.org; Sat, 08 Jan 2022 22:58:33 CST X-Transaction-ID: b7288bf02dee48a4918323386e94ea59 X-Real-From: lic121@chinatelecom.cn X-Receive-IP: 172.18.0.218 X-MEDUSA-Status: 0 Date: Sat, 8 Jan 2022 22:58:31 +0800 From: lic121 To: "dev@openvswitch.org" X-Priority: 3 X-Has-Attach: no X-Mailer: Foxmail 7.2.23.114[cn] Mime-Version: 1.0 Message-ID: <2022010822583077861788@chinatelecom.cn> X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [ovs-dev] [PATCH v1] ofproto-dpif: avoid unneccesary backer revalidation 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" If lldp didn't change, we are not supposed to trigger backer revalidation. Signed-off-by: lic121 --- ofproto/ofproto-dpif.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 1.8.3.1 diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index bc3df8e..eb0e412 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -2456,10 +2456,10 @@ set_lldp(struct ofport *ofport_, struct ofport_dpif *ofport = ofport_dpif_cast(ofport_); struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto); int error = 0; + struct lldp *old_lldp = ofport->lldp; if (cfg) { if (!ofport->lldp) { - ofproto->backer->need_revalidate = REV_RECONFIGURE; ofport->lldp = lldp_create(ofport->up.netdev, ofport_->mtu, cfg); } @@ -2471,6 +2471,8 @@ set_lldp(struct ofport *ofport_, } else if (ofport->lldp) { lldp_unref(ofport->lldp); ofport->lldp = NULL; + } + if (old_lldp != ofport->lldp) { ofproto->backer->need_revalidate = REV_RECONFIGURE; }