From patchwork Thu Aug 20 22:49:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gregory Rose X-Patchwork-Id: 1348664 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=nJrMLs48; 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 4BXfyC4j5Bz9sPB for ; Fri, 21 Aug 2020 08:50:59 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CA9A086C95; Thu, 20 Aug 2020 22:50:56 +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 bA53QI9KLhVT; Thu, 20 Aug 2020 22:50:55 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 29B6486CA6; Thu, 20 Aug 2020 22:50:54 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EA477C089F; Thu, 20 Aug 2020 22:50:53 +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 518F2C0051 for ; Thu, 20 Aug 2020 22:50:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 42E7088603 for ; Thu, 20 Aug 2020 22:50:52 +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 UyORToUo1aOr for ; Thu, 20 Aug 2020 22:50:51 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by hemlock.osuosl.org (Postfix) with ESMTPS id C2E57885C1 for ; Thu, 20 Aug 2020 22:50:41 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id 128so63056pgd.5 for ; Thu, 20 Aug 2020 15:50:41 -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=p8nmMaS3Ps12BATIc6RIcr+vkNhRi87G6clO4DHDiVc=; b=nJrMLs485PXdXuLF3SGQ3mo9HJAIw7fvUR12Xolm1HTqpOoC5bX+mAyo/8OD8euvrZ JoXrcLr+PRDmCh91yIX/MUBjQKDT3NeyFICkJ60XnBhfEWqqB+FOCkfVfpevQCLmCkbw pwCBnJ9UWL08VetDCIPu816hWcQ3Y8QzFIj8gx77svZS7XOd4OYNqV2bzbLlLj2Isu3x leygZvfmT10D95GqlmX8BfKGl2IeKPvKLF9WBZUobqc2BGAKPUgg67MfuDgWA3g67w6b edS7K7KBDLbw1IRFN0AQD20yePeDwNCP/W+Pd9WBugWeP+dOuGM6Td4saLL3BvWMhQWP sG/w== 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=p8nmMaS3Ps12BATIc6RIcr+vkNhRi87G6clO4DHDiVc=; b=L4/HUDJ1m7rz/1Snm7oN9o6o+f8Oo/yVRiipzn7ZQP8M+aJAepT/BoAz5pOhyv9Nlo l3P1jklPBUKHuVWwhbG9bUrwOWlwxt8vf5kh4rJJgB3C95qESpJhnCvnwa9NyplKaKIz zTnzF6D5GHtwjwgvC05BORkXuhjkdy51DvmInSOM9Uyi/F8SXgeZJ/Wjp0QBpah/v1FX 4qGIVdy+nJy6zuQbSNqSIFmvqu+WWLdIDsYoYUhqOuItfrecuVJZvftwHS+H2l3HZz2b ROdLqgZ2MderRMby4kGIa7R/76sCxcCZqocsuOiFHDE4IsXubDjcBl/2FJE4PeNdJ3A0 lAPQ== X-Gm-Message-State: AOAM53173bR+z2N/Xlk45XSVBYTUYJBFmyy31AkLq6mz25C6UlMplRdm sN9GJc0rtdAzLUlbxTlBgw2odrU6fVsfsg== X-Google-Smtp-Source: ABdhPJyLIARTNOz23BV24wcf7hnGtiUd8mkLF+uOPcV8VrU3fAXbMm/GBJ3AbYYpL/AmevgbXen2QA== X-Received: by 2002:a65:67c8:: with SMTP id b8mr250208pgs.206.1597963840928; Thu, 20 Aug 2020 15:50:40 -0700 (PDT) Received: from gizo.domain (97-115-99-106.ptld.qwest.net. [97.115.99.106]) by smtp.gmail.com with ESMTPSA id y6sm116866pfr.61.2020.08.20.15.50.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Aug 2020 15:50:40 -0700 (PDT) From: Greg Rose To: dev@openvswitch.org Date: Thu, 20 Aug 2020 15:49:49 -0700 Message-Id: <1597963790-12362-23-git-send-email-gvrose8192@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1597963790-12362-1-git-send-email-gvrose8192@gmail.com> References: <1597963790-12362-1-git-send-email-gvrose8192@gmail.com> Subject: [ovs-dev] [PATCH 22/23] 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 Signed-off-by: Greg Rose Reviewed-by: Tonghao Zhang --- 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 bd05dd3..650338f 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); }