From patchwork Sat Jun 4 14:35:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng He X-Patchwork-Id: 1638941 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=DAcxHdea; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LFj3M0zjxz9sGG for ; Sun, 5 Jun 2022 00:35:43 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 610C36059B; Sat, 4 Jun 2022 14:35:41 +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 41GtJFpyY35L; Sat, 4 Jun 2022 14:35:40 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id A536360AD1; Sat, 4 Jun 2022 14:35:39 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6D8CFC0039; Sat, 4 Jun 2022 14:35:39 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 82A82C002D for ; Sat, 4 Jun 2022 14:35:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 72316842E7 for ; Sat, 4 Jun 2022 14:35:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GdHav48rMfJV for ; Sat, 4 Jun 2022 14:35:37 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by smtp1.osuosl.org (Postfix) with ESMTPS id EE9CC842E4 for ; Sat, 4 Jun 2022 14:35:36 +0000 (UTC) Received: by mail-pj1-x1036.google.com with SMTP id e24so9465525pjt.0 for ; Sat, 04 Jun 2022 07:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=1lDxrKMgOMSZ9zqjwtfRRifv72zpweh6n82dsgAmreY=; b=DAcxHdeajQ1Z/S2tL3ssx/gF6cBKkXppameSXZmkNKOa8i+cnUDb9+BAkFtqIxYAki sPCLL++8rA8rOZ9+XRRYeP0dYq6BNq37wkoHJy2NuBGaaZB7QNnLAo7kqR8KoSGnCOWA 5fNLIlP62oZ4GMMKiYsp+lDR1ZBpHrTXHa7JejNAUi87+PGNJfmx+z+rGgkMvnMOPlC1 PosoVmzLLLJWchDTTGnJuNGUc9F8y8mA/VO0c0KfO1CsM8UVp65/kvvlThaiDYPN9x4q vsRh+HEHM2TE0LGL2yktpw6AC2m014tKhR857SYmV36TaveH0+jxL5+ieRypUIWKzeMT 4K3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=1lDxrKMgOMSZ9zqjwtfRRifv72zpweh6n82dsgAmreY=; b=Lan70XLfe31qOHfJYfd7byOpgtSb2XC4A5YYVZfwuyY4En22ZOw49dHaZDoB1sUGMh kc2q8c08fKB8QuQfOwz4LaV/xZ0Vdsec8hUQKbdVS3JZSh3FC84KCioThwUW6/y6l5pC gKoEge6YWoRFUTmKW+KYx7zM20jr1Yn7XH+bqgnre3FR4XJz04NluYrjX+9wDNzO2whd NmEpYUntoBAmViby7YQRyX4rYngp+zS+o2Iq9M4bPHp3aD0YQ98i8jyeNWuTtXRe9JYN UH5H4ycYBuiUGBNc5kFBIQDOhzuQe3Zu2eCBtjrAAK/7XpbspIY2+ETkciAJjFo2U7uF RRPw== X-Gm-Message-State: AOAM531l1jgqrxY6EdrPq4HFopcJmknZJVHJg2HfNPRdKozm9qnVuRRR T6+iFPMQRdKJJ2RkCy2Lr3h1WbMZt9aCJg== X-Google-Smtp-Source: ABdhPJyKaebCHcR3ITZr1R8WDS6wjjLDvVnH7cHe3JOcYK3h4RsQHUIfvns+nPn1oLlzM2zv3AZHFQ== X-Received: by 2002:a17:90b:d98:b0:1e3:2a7f:4ce1 with SMTP id bg24-20020a17090b0d9800b001e32a7f4ce1mr28882938pjb.226.1654353335955; Sat, 04 Jun 2022 07:35:35 -0700 (PDT) Received: from localhost ([221.194.138.131]) by smtp.gmail.com with ESMTPSA id q6-20020a170902a3c600b0016203a92865sm1606002plb.107.2022.06.04.07.35.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jun 2022 07:35:35 -0700 (PDT) From: Peng He X-Google-Original-From: Peng He To: dev@openvswitch.org Date: Sat, 4 Jun 2022 14:35:27 +0000 Message-Id: <20220604143530.65815-1-hepeng.0320@bytedance.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [ovs-dev] [ovs-dev v1 1/4] ofproto-dpif-upcall: fix push_dp_ops 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" push_dp_ops only handles delete ops errors but ignores the modify ops results. While currently the modify ops would not report any errors, it's better to handle all the dp operation errors in a consistent way. Signed-off-by: Peng He --- ofproto/ofproto-dpif-upcall.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 57f94df54..4f68f14f2 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -2407,23 +2407,26 @@ push_dp_ops(struct udpif *udpif, struct ukey_op *ops, size_t n_ops) for (i = 0; i < n_ops; i++) { struct ukey_op *op = &ops[i]; - struct dpif_flow_stats *push, *stats, push_buf; - - stats = op->dop.flow_del.stats; - push = &push_buf; - - if (op->dop.type != DPIF_OP_FLOW_DEL) { - /* Only deleted flows need their stats pushed. */ - continue; - } if (op->dop.error) { - /* flow_del error, 'stats' is unusable. */ if (op->ukey) { ovs_mutex_lock(&op->ukey->mutex); transition_ukey(op->ukey, UKEY_EVICTED); ovs_mutex_unlock(&op->ukey->mutex); } + /* if it's a flow_del error, 'stats' is unusable, it's ok + * to discard the stats. + */ + continue; + } + + struct dpif_flow_stats *push, *stats, push_buf; + + stats = op->dop.flow_del.stats; + push = &push_buf; + + if (op->dop.type != DPIF_OP_FLOW_DEL) { + /* Only deleted flows need their stats pushed. */ continue; }