From patchwork Wed Sep 9 19:20:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1360975 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=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: 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=20161025 header.b=TeAgk+SJ; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BmsM43Y21z9sTN for ; Thu, 10 Sep 2020 05:21:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C880D8714F; Wed, 9 Sep 2020 19:21:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id clpQ86-eRgMo; Wed, 9 Sep 2020 19:21:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 40DF986FB4; Wed, 9 Sep 2020 19:20:59 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1A484C1AE2; Wed, 9 Sep 2020 19:20:59 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 009CCC18DA for ; Wed, 9 Sep 2020 19:20:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E478887552 for ; Wed, 9 Sep 2020 19:20:55 +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 sNgu9vLnQS2T for ; Wed, 9 Sep 2020 19:20:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by hemlock.osuosl.org (Postfix) with ESMTPS id A551F8751D for ; Wed, 9 Sep 2020 19:20:52 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id t14so2767047pgl.10 for ; Wed, 09 Sep 2020 12:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4/MzeZNctuRQkImYXe+RvlH0UxCYI0/QPjCuH56ISfE=; b=TeAgk+SJYlIlaEzSX1ahGKCdfgQtYfpoECRQzq5z1skW83OtWUz+VxXX2SadvtW/M8 rp6rDV6XZlgZKk+RUDkO4H0S4wC/bCiQKrUjy7nYEvqoIo6K5ZstqxkenPnG58Lt8vGG J2fJbClDedHcqZLjGZC4rnlP+gxJQQJ9Mmf27dHsEdNuC4zjgygZ0vfXbo2BmhkqDizu ZHDpjmxMb7kJWiQNQcOqDjz0EkervZRFBrq1C6cOThoVGpZH3Ee/1tggznui9bJBhJwO MGmLMA8lgSkYYiII3csehktevUwf6mYqOxBY9YBzGFHzGI1DGs6xZvYuKEHhzVYGioaD qoRA== 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:in-reply-to :references; bh=4/MzeZNctuRQkImYXe+RvlH0UxCYI0/QPjCuH56ISfE=; b=Ub0eAxYIvZ0OaELp5ah+LN9O83BGdfxhCkgrt19PkHpG2+p3WUVvROFKI1oPRAznhe 1eFxF/J5xN2tMMV6Vy64VH+eq2brHQmYlbz8Ie2Ve//wuupxCZk4fg72G81WCRSL/IWy BDiQa4xlCiMHi5kUpJB+BwJ26BxZ/4p4cs+luUWKaNsOP9E/f7ffw7aXyEvjzyjZ1/jn 1lVZpvJZFkZcI1blJtUvXmZu+wIlx1+OysupuHzJ0Kl1BFucUBYepE+CCvQvzByhLzQl wpABxMbnrOjwPN++MTDWdPJSntPQ+i4FB5A9FJ327iD87QBa7O64ABLvVfzNZ7nhbZf/ dbOA== X-Gm-Message-State: AOAM533f4SJ4U7u63drsw1JQjwwOcYhHXS6jCbEa4BZC6k2Wj19WGA03 7t/R51BnL/EPo7+tNI+zGYGeu6pnyy4AkQ== X-Google-Smtp-Source: ABdhPJwKaIPbmmTSZ/6yOKiZ/rnex18tEdAGTziZ8Z3uEAsu4sysqIwFbeAR3LS+SKMv3cZmrkK4qA== X-Received: by 2002:a17:902:20a:: with SMTP id 10mr2149954plc.114.1599679251748; Wed, 09 Sep 2020 12:20:51 -0700 (PDT) Received: from VMware-box.domain ([97.115.183.169]) by smtp.googlemail.com with ESMTPSA id x29sm2866338pga.23.2020.09.09.12.20.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 12:20:50 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Wed, 9 Sep 2020 12:20:18 -0700 Message-Id: <20200909192021.9545-22-gvrose8192@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200909192021.9545-1-gvrose8192@gmail.com> References: <20200909192021.9545-1-gvrose8192@gmail.com> Subject: [ovs-dev] [PATCH v2 21/24] datapath: use hlist_for_each_entry_rcu instead of hlist_for_each_entry 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: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Tonghao Zhang Upstream commit: commit 64948427a63f49dd0ce403388d232f22cc1971a8 Author: Tonghao Zhang Date: Thu Mar 26 04:27:24 2020 +0800 net: openvswitch: use hlist_for_each_entry_rcu instead of hlist_for_each_entry The struct sw_flow is protected by RCU, when traversing them, use hlist_for_each_entry_rcu. Signed-off-by: Tonghao Zhang Tested-by: Greg Rose Reviewed-by: Greg Rose Signed-off-by: David S. Miller Compat fixup - OVS doesn't support lockdep_ovsl_is_held() yet Cc: Tonghao Zhang Reviewed-by: Tonghao Zhang Signed-off-by: Greg Rose --- datapath/flow_table.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datapath/flow_table.c b/datapath/flow_table.c index bd05dd394..650338fb0 100644 --- a/datapath/flow_table.c +++ b/datapath/flow_table.c @@ -485,12 +485,12 @@ static void flow_table_copy_flows(struct table_instance *old, struct hlist_head *head = &old->buckets[i]; if (ufid) - hlist_for_each_entry(flow, head, - ufid_table.node[old_ver]) + hlist_for_each_entry_rcu(flow, head, + ufid_table.node[old_ver]) ufid_table_instance_insert(new, flow); else - hlist_for_each_entry(flow, head, - flow_table.node[old_ver]) + hlist_for_each_entry_rcu(flow, head, + flow_table.node[old_ver]) table_instance_insert(new, flow); }