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=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 54DD9C43381 for ; Fri, 15 Mar 2019 21:26:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1B080218D0 for ; Fri, 15 Mar 2019 21:26:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XIgszQKg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726487AbfCOV0O (ORCPT ); Fri, 15 Mar 2019 17:26:14 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:41787 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbfCOV0O (ORCPT ); Fri, 15 Mar 2019 17:26:14 -0400 Received: by mail-pf1-f195.google.com with SMTP id d25so7179535pfn.8 for ; Fri, 15 Mar 2019 14:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hfhNEwu/NDh5yE59uv1vhRyHRhgRzMUTAHYXfE91kN8=; b=XIgszQKgAbqT8kNQmdeHAayWrpIAYilKavKltg5J+YdNzy8VSRn8PuDITK0OvIohLe pr0W+4z4BFKDCJ2gdUwWTu9ecN9UEYgJhQqNJ/LLbaRg6LR68etsrAv8fCwzwCIa8qtx 2gXCWWNg/3WMynDWalh4i4EdLmjnbdjU4qwCjlJRsVfu7Uu8fHzQB5KCOa3i+uRqwDub 4qKoJ9tlAnV6E2P8XY3ORxIU37B96ndkNwqywzF2/AAQOjk9oBOik+XxyzgQwbpxb3aB O2IqWhQ+jT2QW6EaSmW9NEiMCrYkRss+2uer7euje+D0IsgeB/2iHIgAk6j7hrWo4HMc xVEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=hfhNEwu/NDh5yE59uv1vhRyHRhgRzMUTAHYXfE91kN8=; b=EGx01/pCQ5OD+fjPFONIoKdf5ZIIGn1M96WAM0P1g9wPAFTULu2ja1szqr1o8/+U4Z ot5/vVev4+0hjpcp7D9vdCKeRADnwFAiAdQOJRHUToFl0dEzDcMGgHEVKAVJD/TrFE6h 4IWvEQ30ajAxpmCn1AA0tydjGkZHRJrbpljclw9eh6xrdJQ8lgWYE83fzzKFSBGP8D9J lBGtlapSPvbEtIWr5EA/Bcqbsi5dlyN9oG/h/yo+SAU4jfzKTYd1iGaZwAFxSP636SKR CKoncC1WI0ODziahJE61RzRv//6pECeYE3k2s9zaGdjCcU/7MWCCk3LR73F6PUi0Itgc deUw== X-Gm-Message-State: APjAAAXWRvsCjWIf4fcO9FeR0j1hGFK6bHQUXtIJwNLbbyyAD7lvBJ/e q6pTidcX7FqDHq1cvhE8snJ+PVas X-Google-Smtp-Source: APXvYqynlNtOEatQMrDoTsqES9UeWoWBXP1WMrwq9bACYjOYRWa+cA4fs2CSmAo69iCiDuLstRkFng== X-Received: by 2002:a17:902:b201:: with SMTP id t1mr6496005plr.55.1552685173299; Fri, 15 Mar 2019 14:26:13 -0700 (PDT) Received: from ?IPv6:2620:15c:2c1:200:55c7:81e6:c7d8:94b? ([2620:15c:2c1:200:55c7:81e6:c7d8:94b]) by smtp.gmail.com with ESMTPSA id c10sm3793058pfo.19.2019.03.15.14.26.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 14:26:12 -0700 (PDT) Subject: Re: [PATCH v2] vxlan: remove the redundant gro_cells_destroy() calling. To: Stefano Brivio , Eric Dumazet Cc: David Miller , liuzhiqiang26@huawei.com, petrm@mellanox.com, idosch@mellanox.com, sd@queasysnail.net, mousuanming@huawei.com, netdev@vger.kernel.org, mingfangsen@huawei.com, zhoukang7@huawei.com, wangxiaogang3@huawei.com References: <20190315162824.732b18ac@elisabeth> <005ad387-8d51-561e-a5b9-8e851e03d5e9@gmail.com> <20190315.110249.648596993203657814.davem@davemloft.net> <20190315220841.078e15b7@elisabeth> From: Eric Dumazet Message-ID: <1b09614f-e500-f59b-5f1e-f896c3fd39ac@gmail.com> Date: Fri, 15 Mar 2019 14:26:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190315220841.078e15b7@elisabeth> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 03/15/2019 02:08 PM, Stefano Brivio wrote: > On Fri, 15 Mar 2019 11:56:01 -0700 > Eric Dumazet wrote: > >> On 03/15/2019 11:02 AM, David Miller wrote: >>> From: Eric Dumazet >>> Date: Fri, 15 Mar 2019 09:06:25 -0700 >>> >>>> >>>> >>>> On 03/15/2019 08:28 AM, Stefano Brivio wrote: >>>>> On Fri, 15 Mar 2019 23:18:52 +0800 >>>>> Zhiqiang Liu wrote: >>>>> >>>>>> In vxlan_destroy_tunnels func, unregister_netdevice_queue is called after >>>>>> gro_cells_destroy func. However, in unregister_netdevice_queue func, the >>>>>> gro_cells_destroy func will also call the gro_cells_destroy func as the >>>>>> following routine: >>>>>> unregister_netdevice_many() -> rollback_registered_many() >>>>>> -> ndo_uninit() -> gro_cells_destroy() >>>>>> >>>>>> Signed-off-by: Suanming.Mou >>>>>> Reviewed-by: Zhiqiang Liu >>>>>> Reviewed-by: Stefano Brivio >>>>> >>>>> NACK, please read my and Eric's comments to v1 -- giving me more than 23 >>>>> minutes to answer would have been a nice touch as well :) >>>>> >>>> >>>> Sorry for the confusion, I forgot to add the question marks to my sentences. >>>> >>>> In fact, this is a bug fix, that we missed in the previous fix. >>>> >>>> Technically the bug is older. >>> >>> Please elaborate. >>> >> >> Commit ad6c9986bcb62 >> ("vxlan: Fix GRO cells race condition between receive and link delete") >> >> fixed a race condition for the typical case a vxlan device is dismantled from the >> current netns. >> >> But if a netns is dismantled, we call vxlan_destroy_tunnels() >> to schedule a unregister_netdevice_queue() of all the vxlan tunnels >> that are related to this netns. > > Won't that happen via ops_exit_list() only after synchronize_rcu() is > called by cleanup_net(), though? Is there another path I missed? Just look at vxlan_destroy_tunnels(). The call to gro_cells_destroy(&vxlan->gro_cells); is done _before_ unregister_netdevice_queue(vxlan->dev, head); So packets can still fly, the RCU grace period has not yet started.