From patchwork Mon Aug 24 07:36:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tonghao Zhang X-Patchwork-Id: 1350107 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.133; helo=hemlock.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=dF3PGoyR; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BZkW40WDpz9sSG for ; Mon, 24 Aug 2020 17:38:07 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 011E287FB9; Mon, 24 Aug 2020 07:38:06 +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 xUMCr59DhfMf; Mon, 24 Aug 2020 07:38:04 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id E31928816A; Mon, 24 Aug 2020 07:38:03 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C9466C07FF; Mon, 24 Aug 2020 07:38:03 +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 E4C0EC0051 for ; Mon, 24 Aug 2020 07:38:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CECE8204BD for ; Mon, 24 Aug 2020 07:38:02 +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 f6UrLuJA7dtV for ; Mon, 24 Aug 2020 07:38:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) by silver.osuosl.org (Postfix) with ESMTPS id 787DF204DE for ; Mon, 24 Aug 2020 07:37:58 +0000 (UTC) Received: by mail-qt1-f179.google.com with SMTP id c12so5522676qtn.9 for ; Mon, 24 Aug 2020 00:37:58 -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=5eCGLgLNenZ566UZPUM5B88289BkX6rGslWGkr4wp0Q=; b=dF3PGoyRdkh+ejT/bJxGucIVmaKa6B6dYibGEaYQXOYHOX1Kjvblcg6NrxuLBtPP+B WWmNu1ZAiTJoSUHTonkabDrUYT09cNPvhN+yyhy+6YXkoBn5NiJdcOipR8ZSxlz/qOVO Ew2640Tv+ZLMS0ZmQZHRxN+MVRftfY8Oj9MKRPNEgD2shnArAR/sAyVEqeQcPoEdzgwb wA6XhdCXYfiYKdfd6Z4HBSVHeWo48dtk8jD+yS+LazqLluNWl/ytSIE7utACV+X/wk24 B2U7/MjNRUTMteekWc42d108qo3ZeY1eKIlU2MvWMTabrxv4EB4FLheBSyuojFx5w8Nf ayLA== 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=5eCGLgLNenZ566UZPUM5B88289BkX6rGslWGkr4wp0Q=; b=hC8/u95pLh8WDx0bNpcePFVfJlUsqXDmUeKEI685fQxYyn2SF1QOMPn/omJyiA0Jm3 8+bOLZBN+yDdSqS28j+H9Pj1Pvx4DYbVlAJ/dFFM79B5e0vZjnuuuaPQRE9MvAGB1Ri8 x+3N+xjYVGDep7txfCD9Bmx2lO3vYpqE+YJvE5TVMeaC++wkh9dhbLESp07DR+ksfZRm d+W+Fnx8cb7MOpZG7vTU8L3PPodnS8imG5BS0I75gNLAjQC8u/0iQeCOKtS5Nml8qDx8 yrQ19emLQQJepUygD+On77ucDnjBxXZSu0CcfsUiy+uSicACfgkFUZtanXALY2LAps/q 4kUQ== X-Gm-Message-State: AOAM532O0/I+Mp7g0Mg0VDt5wQoY0y2PWg/vFDPe1V5esVZZ6MMTGezb 2NIrX19WbHCiwPXkomXiqn4= X-Google-Smtp-Source: ABdhPJwK/Hj3CCDD9m+72hBs8laL15bod+DgIRMKMli+Y63P4Qv0ITzGZVv+RbJ48YYug5Dgm4je+Q== X-Received: by 2002:ac8:1c6a:: with SMTP id j39mr1919228qtk.127.1598254677526; Mon, 24 Aug 2020 00:37:57 -0700 (PDT) Received: from localhost.localdomain ([50.236.19.102]) by smtp.gmail.com with ESMTPSA id y9sm9092322qka.0.2020.08.24.00.37.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Aug 2020 00:37:56 -0700 (PDT) From: xiangxia.m.yue@gmail.com To: davem@davemloft.net, pshelar@ovn.org, xiyou.wangcong@gmail.com Date: Mon, 24 Aug 2020 15:36:02 +0800 Message-Id: <20200824073602.70812-4-xiangxia.m.yue@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20200824073602.70812-1-xiangxia.m.yue@gmail.com> References: <20200824073602.70812-1-xiangxia.m.yue@gmail.com> Cc: dev@openvswitch.org, netdev@vger.kernel.org Subject: [ovs-dev] [PATCH net-next v2 3/3] net: openvswitch: remove unused 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 --- v2: change unnused -> unused --- 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 {