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=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,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 91E76C4361B for ; Sat, 19 Dec 2020 23:32:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B4C6239EB for ; Sat, 19 Dec 2020 23:32:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726928AbgLSXcJ (ORCPT ); Sat, 19 Dec 2020 18:32:09 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:34496 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbgLSXcI (ORCPT ); Sat, 19 Dec 2020 18:32:08 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kqlgt-00Cud8-6i; Sun, 20 Dec 2020 00:31:11 +0100 Date: Sun, 20 Dec 2020 00:31:11 +0100 From: Andrew Lunn To: Steen Hegelund Cc: "David S. Miller" , Jakub Kicinski , Russell King , Lars Povlsen , Bjarni Jonasson , Microchip Linux Driver Support , Alexandre Belloni , Madalin Bucur , Nicolas Ferre , Mark Einon , Masahiro Yamada , Arnd Bergmann , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH v2 7/8] net: sparx5: add ethtool configuration and statistics support Message-ID: <20201219233111.GF3008889@lunn.ch> References: <20201217075134.919699-1-steen.hegelund@microchip.com> <20201217075134.919699-8-steen.hegelund@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201217075134.919699-8-steen.hegelund@microchip.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +void sparx5_get_stats64(struct net_device *ndev, > + struct rtnl_link_stats64 *stats) > +{ > + struct sparx5_port *port = netdev_priv(ndev); > + struct sparx5 *sparx5 = port->sparx5; > + u64 *portstats; > + > + if (!sparx5->stats) > + return; /* Not initialized yet */ > + > + portstats = &sparx5->stats[port->portno * sparx5->num_stats]; > + > + mutex_lock(&sparx5->stats_lock); There was a big discussion about stats64 not being able to take a lock a few weeks ago. You probably want to go read the thread. The aim was to allow sleeping, but i don't know if that as been achieved yet. Andrew 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=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 44FBAC0018C for ; Sat, 19 Dec 2020 23:33:37 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12F1E22D0A for ; Sat, 19 Dec 2020 23:33:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12F1E22D0A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lunn.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lVB7y2KycdOhAKKhlgdTsy+0XDXOtvL27qRvHmuHOu0=; b=znfhnJAJsaQRAloPsPq4uX5rR WntUg+iP1zXcAgBk7HHi423MZkOX/fZwOt6RsWhMByx6VyLvRbzFXq2FbyMQ3hzhDD/ea9G/vUFBo BDb7+VRefRx4VodnZ2UwAGpFDFKV38Cq7fwO3+oJWAr3nCB6Am4a7yItLBNAYo8Sdz3y3Vt+r150V +P50q9bFnjUROFkMf12dDo3mBnKZN9IDK58uLQqjFNkXboZwKEt3ZyrxroAgKOc+/h/ReFnDNzUOQ IjOKiN7gP/GC+sAfzJSwaoqpp/5Fx9eTR+hFB9hynng3naduHXmQwtiR7sgETYKioP0rk9AiCTUeh FMslmNPjw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kqlhK-00043o-1I; Sat, 19 Dec 2020 23:31:38 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kqlhG-00043J-5i for linux-arm-kernel@lists.infradead.org; Sat, 19 Dec 2020 23:31:35 +0000 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kqlgt-00Cud8-6i; Sun, 20 Dec 2020 00:31:11 +0100 Date: Sun, 20 Dec 2020 00:31:11 +0100 From: Andrew Lunn To: Steen Hegelund Subject: Re: [RFC PATCH v2 7/8] net: sparx5: add ethtool configuration and statistics support Message-ID: <20201219233111.GF3008889@lunn.ch> References: <20201217075134.919699-1-steen.hegelund@microchip.com> <20201217075134.919699-8-steen.hegelund@microchip.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201217075134.919699-8-steen.hegelund@microchip.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201219_183134_273115_E3E61929 X-CRM114-Status: GOOD ( 11.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bjarni Jonasson , Alexandre Belloni , linux-kernel@vger.kernel.org, Arnd Bergmann , Madalin Bucur , netdev@vger.kernel.org, Masahiro Yamada , Russell King , Microchip Linux Driver Support , linux-arm-kernel@lists.infradead.org, Mark Einon , Jakub Kicinski , "David S. Miller" , Lars Povlsen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org > +void sparx5_get_stats64(struct net_device *ndev, > + struct rtnl_link_stats64 *stats) > +{ > + struct sparx5_port *port = netdev_priv(ndev); > + struct sparx5 *sparx5 = port->sparx5; > + u64 *portstats; > + > + if (!sparx5->stats) > + return; /* Not initialized yet */ > + > + portstats = &sparx5->stats[port->portno * sparx5->num_stats]; > + > + mutex_lock(&sparx5->stats_lock); There was a big discussion about stats64 not being able to take a lock a few weeks ago. You probably want to go read the thread. The aim was to allow sleeping, but i don't know if that as been achieved yet. Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel