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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 AC6F2C76188 for ; Fri, 19 Jul 2019 05:27:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E853621849 for ; Fri, 19 Jul 2019 05:27:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726347AbfGSF1C (ORCPT ); Fri, 19 Jul 2019 01:27:02 -0400 Received: from mx2.suse.de ([195.135.220.15]:54136 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725777AbfGSF1B (ORCPT ); Fri, 19 Jul 2019 01:27:01 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A13BEAD51; Fri, 19 Jul 2019 05:27:00 +0000 (UTC) Date: Fri, 19 Jul 2019 14:26:52 +0900 From: Benjamin Poirier To: Florian Fainelli Cc: David Miller , Ajit Khaparde , Sathya Perla , Somnath Kotur , Sriharsha Basavapatna , Saeed Mahameed , Firo Yang , netdev@vger.kernel.org Subject: Re: [PATCH net] be2net: Synchronize be_update_queues with dev_watchdog Message-ID: <20190719052652.GA19727@f1> References: <20190718014218.16610-1-bpoirier@suse.com> <42269a37-0353-29c8-ce13-51cb2feeb9af@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42269a37-0353-29c8-ce13-51cb2feeb9af@gmail.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2019/07/18 10:23, Florian Fainelli wrote: > On 7/17/19 6:42 PM, Benjamin Poirier wrote: > > As pointed out by Firo Yang, a netdev tx timeout may trigger just before an > > ethtool set_channels operation is started. be_tx_timeout(), which dumps > > some queue structures, is not written to run concurrently with > > be_update_queues(), which frees/allocates those queues structures. Add some > > synchronization between the two. > > > > Message-id: > > Signed-off-by: Benjamin Poirier > > Would not moving the netif_tx_disable() in be_close() further up in the > function resolve that problem as well? Thanks for your review Florian, No, netif_tx_disable() doesn't provide mutual exclusion with dev_watchdog(). You can have: cpu0 cpu1 \ dev_watchdog \ netif_tx_lock \ be_tx_timeout ... \ be_set_channels \ be_update_queues \ netif_carrier_off \ netif_tx_disable ... \ be_clear_queues still running in be_tx_timeout(), boom!