Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp598442pxb; Mon, 8 Nov 2021 19:26:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZ9xH3v7eLbA2JTj0eRP13Y2LtF4Mg1Cz8xfgXmXyrLSDMJluL48PMFS6RBZE9Y0QBnqTk X-Received: by 2002:a5d:8152:: with SMTP id f18mr2670839ioo.135.1636428376873; Mon, 08 Nov 2021 19:26:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636428376; cv=none; d=google.com; s=arc-20160816; b=iO3lbz6oeN+iXiVT2LW6FVaHrpgnDqOcDz0bETy4s4I8LxOM0gyPo87g8u+rWCt4l1 07EzqqmR3of/2vkQKIP4a6BHqU6rQMz/A5kKR99w/nrpQubn34Okt0asOSsV8jeofE6P XbYqGgVPgLlcJv3l0J1ssQzrTq44jcG0Pjrh5FM2N3Zs1qmtVMZC1RmcyEptnAbS2QyV ++1ZpyTx1f3wufJcmv8+ChP8GHlw/UsuUu7mkJDeOaU6ZzBgalJhBU/kCG9/TD7ZWArP Z/v7oBo09zH8N4Ax/XIlXYtJ0hho7D+F6/2bp0XNbJbpSXR+1Hmz7JlQ4Ip5W7hr+NxV UX5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=tkHOqRl65t9wybmGiKhhe/EfI/jcQW1AOyReaAVadCU=; b=w5DUKTv3bO12TNU6Mj/CcZrhAGIXIEL3iNyNDFF0JY27nbMVVpZqpiX+IiFasrV1Hp E4Vp910Lbgc8OnCSLtnk7P2e21rLXnksZVLowhZMtViEJ+lhnCvK7uw0xupgtiRs+Cgm ab3tFmZni4UCLpqJDTdqHY10+AqJUwzILRoDwG2vk+btvPmmXSJ7uGmlQS7w/PyiCa12 mmBRt1iZjJwt3Btv2UjN19zQv7YwZgYHY2IecTq3KizUKH0A10uN3pt5VRJ0LaK3nfWc Lmk3HFTmLsHm5Vm+zT9OyAZIcdxOVMZcmJ02uJkVTj33KLNE2reWj+4jsPam3NAVV+Wq 1Ieg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=fqeyTs0x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v14si47175817ilu.170.2021.11.08.19.26.03; Mon, 08 Nov 2021 19:26:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=fqeyTs0x; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238006AbhKHT4b (ORCPT + 99 others); Mon, 8 Nov 2021 14:56:31 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:51336 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237891AbhKHT4a (ORCPT ); Mon, 8 Nov 2021 14:56:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=tkHOqRl65t9wybmGiKhhe/EfI/jcQW1AOyReaAVadCU=; b=fqeyTs0xe5dnBpErQ5uU1VCqWl a3T7OuP/xp/XGuaDOLyEt/21UVOpo/jAYTWQqKNsEa/CK6akVxAatzaxHaJekgOAKClQHY5DSmFVr qcrXeH8zfrm2hmD728eYgau2CFQgOs1Zg1HXDWDMCInaks3tux+x4nHZQBQYdRJ+qm2c=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mkAi0-00CvWI-Ky; Mon, 08 Nov 2021 20:53:36 +0100 Date: Mon, 8 Nov 2021 20:53:36 +0100 From: Andrew Lunn To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: Ansuel Smith , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Jonathan Corbet , Pavel Machek , John Crispin , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [RFC PATCH v2 1/5] leds: trigger: add API for HW offloading of triggers Message-ID: References: <20211108002500.19115-1-ansuelsmth@gmail.com> <20211108002500.19115-2-ansuelsmth@gmail.com> <20211108171312.0318b960@thinkpad> <20211108185637.21b63d40@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211108185637.21b63d40@thinkpad> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > I guess I will have to work on this again ASAP or we will end up with > solution that I don't like. > > Nonetheless, what is your opinion about offloading netdev trigger vs > introducing another trigger? It is a solution that fits the general pattern, do it in software, and offload it if possible. However, i'm not sure the software solution actually works very well. At least for switches. The two DSA drivers which implement get_stats64() simply copy the cached statistics. The XRS700X updates its cached values every 3000ms. The ar9331 is the same. Those are the only two switch drivers which implement get_stats64 and none implement get_stats. There was also was an issue that get_stats64() cannot perform blocking calls. I don't remember if that was fixed, but if not, get_stats64() is going to be pretty useless on switches. We also need to handle drivers which don't actually implement dev_get_stats(). That probably means only supporting offloads, all modes which cannot be offloaded need to be rejected. This is pretty much the same case of software control of the LEDs is not possible. Unfortunately, dev_get_stats() does not return -EOPNOTSUPP, you need to look at dev->netdev_ops->ndo_get_stats64 and dev->netdev_ops->ndo_get_stats. Are you working on Marvell switches? Have you implemented get_stats64() for mv88e6xxx? How often do you poll the hardware for the stats? Given this, i think we need to bias the API so that it very likely ends up offloading, if offloading is available. Andrew