From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37C60C433E1 for ; Wed, 12 Aug 2020 00:48:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0627220756 for ; Wed, 12 Aug 2020 00:48:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ifuDOOFI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726468AbgHLAsM (ORCPT ); Tue, 11 Aug 2020 20:48:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726143AbgHLAsL (ORCPT ); Tue, 11 Aug 2020 20:48:11 -0400 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67929C06174A; Tue, 11 Aug 2020 17:48:11 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id g19so830737ioh.8; Tue, 11 Aug 2020 17:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0XDgyn5BUfWSTBbklR5G9pMdaqRcJjaCci9jdLlWOiU=; b=ifuDOOFI2ZulTTZy5err/8h0FwMgYiiIidKn2aMbeCraw9vCxzGgQ+eqgFqLPzTK7n x+qxGHq2Y+oLA2ih08aW888aT1YQBwzKv8sRs0aRowvmlmYheifiSokqNNGbSJhbZW3G KFkkQZEfpvBc0KVsopTgZHKrBHUvCTo7P6bWvLG9lBgXXIqkC7v3di9d74SNSq/Ly25W 8rdCpapuJ3hZy5VAbWIMMErvu6G7VrtXftk1ltusP2YHsrtu7z+42PEYacNjT0On0yr0 YxxCvcC1GH1ivQ4F16Rr4Sqvpf+LrLq5S7zm/Dc3rhIpJbInXJYO4rbqxcwFW6qUKwyM U8jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0XDgyn5BUfWSTBbklR5G9pMdaqRcJjaCci9jdLlWOiU=; b=KuGazHn7w9DhW6vrYaINHW803v/+BnN8xNrD5bBCP82s7xNf4VZo9m1Et+wGr20QRK caP934NSLd++fnXB0qRQj2/I2dAaIv1V4J1Lcjb5hwzYv/eb7b21sBZ/PFDRqkvPgOGt OgQadB6WfwZt7SR8BA2Rc2YN+5rbMTsfP2Hw9hvtpFjvW2g/9UzdadQ+ZZK/OtroNlRQ VPQVZPP9h5DR9alUgecrUO01gDT1OPtck9NP9xDhj+2FoCxbthQU42Yl/JQvzEhuQLos noSw+RTBBGSdCDKs7c8/Al3H2JEYhmM62BaI0/sRxZcDwYGrz7lUTAEZgD5MA2+KUBeK i1Jw== X-Gm-Message-State: AOAM5317VDf5iOdvSL7yG4f1yD86/j9YW7G0jVUbWnuFLKt2Wc/IXCbh zcnN8FPRLQ/OEaqAEajAucrexuB2TEbD4DXnzoCbZw== X-Google-Smtp-Source: ABdhPJxWwLTeImwsj5VIsbnlOUDj74WtvkmdkuQMqptYzqv+dNeIsOU0JZwSBhL92bl/GRt8E9uqXgqeZfSfXU8u7/4= X-Received: by 2002:a05:6638:250f:: with SMTP id v15mr29197761jat.75.1597193290690; Tue, 11 Aug 2020 17:48:10 -0700 (PDT) MIME-Version: 1.0 References: <20200811011001.75690-1-xiangxia.m.yue@gmail.com> In-Reply-To: <20200811011001.75690-1-xiangxia.m.yue@gmail.com> From: Cong Wang Date: Tue, 11 Aug 2020 17:47:59 -0700 Message-ID: Subject: Re: [PATCH] net: openvswitch: introduce common code for flushing flows To: Tonghao Zhang Cc: Joel Fernandes , =?UTF-8?B?Sm9oYW4gS27DtsO2cw==?= , Gregory Rose , "Uladzislau Rezki (Sony)" , "Paul E . McKenney" , dev@openvswitch.org, Linux Kernel Network Developers , rcu Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Aug 10, 2020 at 6:14 PM wrote: > > From: Tonghao Zhang > > To avoid some issues, for example RCU usage warning, we should > flush the flows under ovs_lock. This patch refactors > table_instance_destroy and introduces table_instance_flow_flush > which can be invoked by __dp_destroy or ovs_flow_tbl_flush. > > Signed-off-by: Tonghao Zhang Please add a Fixes tag here, I think it is probably your memory leak fix which introduced this issue. And a Reported-by, to give credits to bug reporters. Plus one minor issue below: > -static void table_instance_destroy(struct flow_table *table, > - struct table_instance *ti, > - struct table_instance *ufid_ti, > - bool deferred) > +/* Must be called with OVS mutex held. */ > +void table_instance_flow_flush(struct flow_table *table, > + struct table_instance *ti, > + struct table_instance *ufid_ti) > { > int i; > > - if (!ti) > - return; > - > - BUG_ON(!ufid_ti); > if (ti->keep_flows) > - goto skip_flows; > + return; > > for (i = 0; i < ti->n_buckets; i++) { > - struct sw_flow *flow; > struct hlist_head *head = &ti->buckets[i]; > struct hlist_node *n; > + struct sw_flow *flow; This is at most a coding style change, please do not mix coding style changes in bug fixes. You can always push coding style changes separately when net-next is open. Thanks.