Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp78016lqq; Wed, 12 Jun 2024 17:39:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU2TAmhSo0Mx0vjqu/JXU0hN7HZb4dokrzY/MfSVz/Y3YoKLb+dxjYJBuPs6kn5ZrBTODsqBiXjOJI7AfXKk5n5DHqlRi5bWDkCwP8jnQ== X-Google-Smtp-Source: AGHT+IEVBnOoQRTNkEaxF5cE5kgj+KRtWbRbz0Dap8hj7lwueOz9015qKmKbuxOjwLjVEsORhAGW X-Received: by 2002:a05:6512:108a:b0:52c:a014:afd1 with SMTP id 2adb3069b0e04-52ca014b22emr787564e87.39.1718239196431; Wed, 12 Jun 2024 17:39:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718239196; cv=pass; d=google.com; s=arc-20160816; b=RnCnybkRJEOLL36Q/TnIZCcrX0Yw6iwtdADZjv2io2zMTx64+Vu54IZRbcdbPYGdHo 9d6SnBn8d0+LAxMa9ee8WNcSf9XdQHlN7aSKZmkm8Q0riYkIBCuDwUDe1QRiZ5SFyR89 c3I3GBIBH+kVGbKu4YU2dPtVuONyxVMTqehjkPXIzlPuuAVlblbr2vHjkEwFJevEpnrW gpgWI4TpZJqYL1ylmZY+KjyNDonb41kqFGWQ5LGr9Ag5e7oXNJHQyx0X2DjVbO0y4pd4 PJ3U3nHhFROQgqwdpyghpXNLtjQGyx2OCIImzAtgkVfOI/2nZnsWxzyHAzqKRGdt8nWX a/gQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=/pUmnyfKtrBY7CJSqsOHPMoDXxwqwv2ZphnpXbPXSvU=; fh=wTjlYgRKP2O73Dp0pl0D+l6DnKGxbMJEO4v2cDzkT8Y=; b=aiR6Rtl0kmIG8/jDCzZpCtltcFrBNagSrseJgthPxvmrEZD6/OuleoHyjVRqpoXt6j rvdsvHtF9HkazolFQDbmr1ULZWShcj1WfEkQmMUipcKvWTut6TaDpc4PgspnU7R62H9S S8RUFR9zPf1Y+W88OSJIAi2leN774QG+FdGSFxNGloirTJkEsSccVwQ+iAlSttOjKN94 g05zysbS698NMgA0sbBTu1zPU/tyq4naGdxn0/k3NyQK5w3MWImpplPxb4vdhAjXmT+1 lv3S0pLNuNPKlRV/wGht+G4L5eaeS0RYo+RyZ4vnMx+AGcdVbNwvEZabqjrIkzG79DAW d+BA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kJ9XNKHY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-212410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212410-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56d218aasi10644066b.185.2024.06.12.17.39.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 17:39:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kJ9XNKHY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-212410-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212410-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1A08E1F22011 for ; Thu, 13 Jun 2024 00:39:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC7538F5D; Thu, 13 Jun 2024 00:39:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kJ9XNKHY" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F0F2811; Thu, 13 Jun 2024 00:39:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718239186; cv=none; b=EULvyud9kIoTdAzWDhA47hyoDn+fJxa+mHB+1JEJYtY42kECQqEEWA7ntpEQkA4IS3vz1oPvqJnb1RUX50co+Q+wv09z5tyGoYcYJfgCMBBWbEMSLbFm1u2qfC2/wOZ0YamiClxFDSy+qEotjI1nyNT2a8p28OKvscJfQiL3ErU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718239186; c=relaxed/simple; bh=nWAMku+xbI0GhotCu17YZ8ZpkhtijhiBMYU1kQYy1qk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pK8soVefszyF6hCgaFdjyEvpN26TZQY4RUXQaNW+zcXqJq9T9k6vFEzNQuw/p7QNkQUeZZqXJgLxvAutYOtSfDlnpK8n+rAFxUE9d61LHjOgbfNGGB5gDZflmHap57oD/tLyyw24rRK9Sle1fC7NKzZcxbbyfFARNqs/OX/i+a4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kJ9XNKHY; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39403C116B1; Thu, 13 Jun 2024 00:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718239185; bh=nWAMku+xbI0GhotCu17YZ8ZpkhtijhiBMYU1kQYy1qk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kJ9XNKHY8DXHbJRMbruK6v4Uh4HpARwm6EL8RQv8TeurXvmI7AVVimMwZ44jP7+Vn WP8dQaPZvR/A2PeW+JPvHoT2LA25OEWQaNpHwJ9L0gGvLPbsbTAJqQveFcgb4mQ1/6 STorpsEBEOk/iEKyBEakexHN3m8op6kRab3VQBmxp6oU4sXzBabe6XWD9/y9vjy8Ii 3HbP88+vOdu5hYV2VyzinNYD7fatRph9IlwYxlmjbPhe/rnelS+OxHGnWblXsA0RG/ CYjRUHaBJCyUCmivqoxkHPLUfD270AJqRpEHmemTvqVCVKLGtkBqAiCSNh56XgYNeJ rFfGeyd4D78Zw== Date: Wed, 12 Jun 2024 17:39:44 -0700 From: Jakub Kicinski To: Justin Lai Cc: , , , , , , , , , , Subject: Re: [PATCH net-next v20 08/13] rtase: Implement net_device_ops Message-ID: <20240612173944.05121bf0@kernel.org> In-Reply-To: <20240607084321.7254-9-justinlai0215@realtek.com> References: <20240607084321.7254-1-justinlai0215@realtek.com> <20240607084321.7254-9-justinlai0215@realtek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 7 Jun 2024 16:43:16 +0800 Justin Lai wrote: > +static void rtase_get_stats64(struct net_device *dev, > + struct rtnl_link_stats64 *stats) > +{ > + const struct rtase_private *tp = netdev_priv(dev); > + const struct rtase_counters *counters; > + > + counters = tp->tally_vaddr; > + > + if (!counters) > + return; Same question about how this can be null as in the ethtool patch.. > + netdev_stats_to_stats64(stats, &dev->stats); Please dont use this field, there is a comment on it: struct net_device_stats stats; /* not used by modern drivers */ You can store the fields you need for counters in struct rtase_private > + dev_fetch_sw_netstats(stats, dev->tstats);