From patchwork Tue Aug 18 10:09:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 1346747 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.138; helo=whitealder.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=UNG9L9cp; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BW6BF58Dwz9sPC for ; Tue, 18 Aug 2020 20:11:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B105B86292; Tue, 18 Aug 2020 10:10:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rfJsLSIbbKub; Tue, 18 Aug 2020 10:10:56 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id ACDB686252; Tue, 18 Aug 2020 10:10:56 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 953F9C0051; Tue, 18 Aug 2020 10:10:56 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9680AC088B for ; Tue, 18 Aug 2020 10:10:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 801D6203AD for ; Tue, 18 Aug 2020 10:10:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23JzlmJF2UgJ for ; Tue, 18 Aug 2020 10:10:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) by silver.osuosl.org (Postfix) with ESMTPS id 242362040B for ; Tue, 18 Aug 2020 10:10:37 +0000 (UTC) Received: by mail-qk1-f195.google.com with SMTP id x69so17704872qkb.1 for ; Tue, 18 Aug 2020 03:10:37 -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=K44nLHLCzQuJMecWboH9C54UmBPakohQAbAnvZKlIJU=; b=UNG9L9cpgJ+Qx8+CmKvSghq8v0WdN6jNaAbGD8i4Vsr3jOGnzgJ1LVkmadmMC3cLnY h+rbvNKRB4zrp/BH7kujIwqYKyMrQ/yznJ7ssIn0PjgVB8ZSkxPzMzqV96sY2FJxn2I6 xX7rLGuW8sDyVfscmhd3u8mtM57gBx8a2mw/TJnqsu+hXG94pqGKWfoyJ2YRMGhRQi4W 3XePvzf40fTiNMR+vs/dEc3/vr9qyoZEkrkDxWcrtKcgRuYttqwUXtu+329cIhiar532 mRQob5A6VeQCn0kpyHe/Nd0os9sUdQ5laarG5wwjrkubei6WaAYm3NGfsDKhPMp73t7X IhnA== 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=K44nLHLCzQuJMecWboH9C54UmBPakohQAbAnvZKlIJU=; b=dx9mKO1FLr3UoSf8VxEnHwlwc/m1OROI6vyUBVyUJKBsi8nvxcXY/Kacjn820APWC+ KlNYcRkRFCzKEaWAzvJowbdkuxhHq6N8hkzBjyaznqx9DFqP+q9OQ3k2F4ZYMfmAPiMx qUxrvyCS0XaN3njPDRXDKxNxmXnfqGzau+LEQmlU9WdkLmQtMGbAC7DzyhrRjSmEFQs8 EfwPbv253Bzwvs9GjiEEN9NkFgBUXFro21YFhFFdhAcqZ9ISOW9XzTvgOmV85CsJGvFj io+4QKbMrqFSPLp7C+rknd5omXlNk7f0F/+mh6x9z/z0bIixkqOHY7JDAGsoSS3URa2u 6/gw== X-Gm-Message-State: AOAM533gswIr0i+XffRE3NoMBI1k+pYzSuGvepsXlmAKM7iX+b8yKcie 4jjU+im+eIJpm99y7wY5hPVL6bxvGIA= X-Google-Smtp-Source: ABdhPJzNvhVraJfNijcbgcNuMcjHOwTTaThP97iEc1N8rfE3IsM0gXbCGYs6HsYTe4++ioPCrGIqJQ== X-Received: by 2002:a05:620a:13f7:: with SMTP id h23mr16809302qkl.396.1597745435515; Tue, 18 Aug 2020 03:10:35 -0700 (PDT) Received: from localhost.localdomain ([50.236.19.102]) by smtp.gmail.com with ESMTPSA id 20sm20632139qkh.110.2020.08.18.03.10.32 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Aug 2020 03:10:34 -0700 (PDT) From: xiangxia.m.yue@gmail.com To: dev@openvswitch.org, netdev@vger.kernel.org Date: Tue, 18 Aug 2020 18:09:23 +0800 Message-Id: <20200818100923.46840-4-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20200818100923.46840-1-xiangxia.m.yue@gmail.com> References: <20200818100923.46840-1-xiangxia.m.yue@gmail.com> Subject: [ovs-dev] [PATCH net-next v1 3/3] net: openvswitch: remove unnused keep_flows 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 keep_flows was introduced by [1], which used as flag to delete flows or not. When rehashing or expanding the table instance, we will not flush the flows. Now don't use it anymore, remove it. [1] - https://github.com/openvswitch/ovs/commit/acd051f1761569205827dc9b037e15568a8d59f8 Cc: Pravin B Shelar Signed-off-by: Tonghao Zhang --- net/openvswitch/flow_table.c | 6 ------ net/openvswitch/flow_table.h | 1 - 2 files changed, 7 deletions(-) diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c index f8a21dd80e72..0473758035b5 100644 --- a/net/openvswitch/flow_table.c +++ b/net/openvswitch/flow_table.c @@ -166,7 +166,6 @@ static struct table_instance *table_instance_alloc(int new_size) ti->n_buckets = new_size; ti->node_ver = 0; - ti->keep_flows = false; get_random_bytes(&ti->hash_seed, sizeof(u32)); return ti; @@ -479,9 +478,6 @@ void table_instance_flow_flush(struct flow_table *table, { int i; - if (ti->keep_flows) - return; - for (i = 0; i < ti->n_buckets; i++) { struct hlist_head *head = &ti->buckets[i]; struct hlist_node *n; @@ -598,8 +594,6 @@ static void flow_table_copy_flows(struct table_instance *old, lockdep_ovsl_is_held()) table_instance_insert(new, flow); } - - old->keep_flows = true; } static struct table_instance *table_instance_rehash(struct table_instance *ti, diff --git a/net/openvswitch/flow_table.h b/net/openvswitch/flow_table.h index 6e7d4ac59353..d8fb7a3a3dfd 100644 --- a/net/openvswitch/flow_table.h +++ b/net/openvswitch/flow_table.h @@ -53,7 +53,6 @@ struct table_instance { struct rcu_head rcu; int node_ver; u32 hash_seed; - bool keep_flows; }; struct flow_table {