Received: by 10.213.65.68 with SMTP id h4csp148315imn; Fri, 30 Mar 2018 02:50:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx48IidbPdpx47ruQ2EiMtoP7m4UMSCr+ckA3x12LrIgTiO9GUmH3QeotTXRWkbgdQLK/VURS X-Received: by 10.101.100.202 with SMTP id t10mr8040734pgv.229.1522403457791; Fri, 30 Mar 2018 02:50:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522403457; cv=none; d=google.com; s=arc-20160816; b=r4tvXR+LZlPNPKoOWWicxhUSpR/BHE0GuOI5XoQMW5+DxsigmYcZDyNdbrMsdOGDqm fpCipyfGrzl+6C1ULdZmIxX3bnWYEGOUuu00UmDY2/Fj7IgGHl3+DdYmfzY6xW4WQLqg yRAOSnq+fqM/6SaVNSlNTfKk3B6pfhqcSvzg7gWuHkr3XUjZ1As+/3u97Uiq2M4fdH6J g+POut8ato2trySyU1rUgfQ86peQGwnbAjDUm0012mER7eSVqQk36nalYKzIcWpl2vzr NE6TYCxKiPMSUCL5G9dzgLYj5mhy0SidnhPX7wx7snbEKyVrP90WG5yQyHxqp1C4/nlV +/Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=DJZIlyDVzXzbyi1Ggp0ChxCl7ZQctJZqXqwiqrFj0jY=; b=Vkdiw/9RzNwxo0uQ7vcbS9svphBifz9xhqk+kpIS9EtRsMrVBVR5AqUnys+UkYqcty FkalQv+xficngGplyz1hIbswD1SJmgU9venKJfjMHXu2anW3PHnb1VtmgTbpDF8j02e4 svqt8ger7h2KSfaLRlhnJIlL2XJEr6QoWRZFXQ+WoylkbyndKI7cXTfPiuqY2vf3o3EX e0Q8/b/kRaiXeITIchMNLgNZ2HKi2jf+FRJBR17n5UvbTE+pTYm3irFLK7dexmx/WHLp HybKk/GwxdAzK91DGuY9kj7015okfE5sU2Qabv1aarZV59LDLd1EnJEmQ91BPB3ET4W8 DQ0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si6070394pfi.28.2018.03.30.02.50.43; Fri, 30 Mar 2018 02:50:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751264AbeC3Jta (ORCPT + 99 others); Fri, 30 Mar 2018 05:49:30 -0400 Received: from mail.bootlin.com ([62.4.15.54]:34513 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750802AbeC3Jt2 (ORCPT ); Fri, 30 Mar 2018 05:49:28 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 4C366208A5; Fri, 30 Mar 2018 11:49:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from windsurf (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id 099652070D; Fri, 30 Mar 2018 11:49:17 +0200 (CEST) Date: Fri, 30 Mar 2018 11:49:16 +0200 From: Thomas Petazzoni To: Jisheng Zhang Cc: David Miller , , , Subject: Re: [PATCH 2/2] net: mvneta: improve suspend/resume Message-ID: <20180330114916.4e786de2@windsurf> In-Reply-To: <20180330171547.5f96bbff@xhacker.debian> References: <20180329181220.61d63c92@xhacker.debian> <20180329181536.46e065d2@xhacker.debian> <20180329135432.7da1299b@windsurf> <20180330171547.5f96bbff@xhacker.debian> Organization: Bootlin (formerly Free Electrons) X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Fri, 30 Mar 2018 17:15:47 +0800, Jisheng Zhang wrote: > > > + cpuhp_state_remove_instance_nocalls(online_hpstate, > > > + &pp->node_online); > > > + cpuhp_state_remove_instance_nocalls(CPUHP_NET_MVNETA_DEAD, > > > + &pp->node_dead); > > > > Do we need to remove/add those CPU notifiers when suspending/resuming ? > > Take mvneta_cpu_online() as an example, if we don't remove it during > suspend, when system is resume back, it will touch mac when secondary > cpu is ON, but at this point the mvneta isn't resumed, this is not safe. Hm. I'm still a bit confused by this new CPU hotplug API. I understand the issue you have and indeed unregistering the CPU hotplug callbacks is a way to solve the problem, but I find it weird that we have to do this. Anyway, it's OK to do it, because it's anyway what was done so far. It is just annoying that there is a duplication of the logic between mvneta_suspend() and mvneta_stop() on one side, and duplication between mvneta_resume() and mvnete_start() on the other side. > > > + for (queue = 0; queue < rxq_number; queue++) { > > > + struct mvneta_rx_queue *rxq = &pp->rxqs[queue]; > > > + > > > + mvneta_rxq_drop_pkts(pp, rxq); > > > + } > > > > Wouldn't it make sense to have > > mvneta_rxq_sw_deinit/mvneta_rxq_hw_deinit(), like you did for the > > initialization ? > > For rxq deinit, we'd like to drop rx pkts, this is both HW and SW operation. > So we reuse mvneta_rxq_drop_pkts() here. Hum, OK, indeed. It would have been nicer to have something symmetric, with the hw/sw parts split in a similar way for the init and deinit of both txqs and rxqs, but I agree that dropping the RX packets before going into suspend involves both HW and SW operations. Thanks! Thomas Petazzoni -- Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com