From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (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 2BA3BDDA1 for ; Wed, 29 May 2024 18:15:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717006532; cv=none; b=DB8Z4qIocFjO8w3J+cO8GK0nHati+BB4LyAm8IbpwUkrypZKbJ85gvOCjFu+r3Ki+J+oW7qG6ESbICH4Tdmbt3yVuc5w87CKhX+prtLiNzfJwr+850xwXO8YyT+LcgMCtGe/4wmSg+2qShc8ephPMAtqRD0BbQm2Ds1k1GLkPdY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717006532; c=relaxed/simple; bh=HTLg8gpaySDZIn8hsaOA9Fcw46r5Vbl/FIqB2I6xCd4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HWaLIcWTLVsv3RB3PvBtdxJn98s+IYxQX9RUikvZz9NvXxmM9SYDLpd4fVURoXHcF8IVZU44XRbkUbXlVIkq5S/ny0vU4TlJyuwsg1y72Vl0ctRtz6lRprLlkcq9AVXl5tZg252dWB7roc0sxrryLsw+wtwLiJ2dBEsrHIbXCp0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=tAzpF/hQ; arc=none smtp.client-ip=91.218.175.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="tAzpF/hQ" X-Envelope-To: michael.chan@broadcom.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1717006527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mLV8YG90+RW/NZMtQguI4MS1dEUDJxLqJpvYULeqJAM=; b=tAzpF/hQL9CFphPkBeGqG1kZivmYfTc9bbZ3GC7gAljdUcvH0bBh+PoKG71uYh6lx8RSO1 u4anr2MS+hl4LyUEnlKUduUnRwDNDB3PH21+qWXtciB2MZva2pcVgzlvMpAiA2lQFkJRTP fUqlst/zpy/xFu6IfkUlUuQ+mVmVv5s= X-Envelope-To: vadfed@meta.com X-Envelope-To: davem@davemloft.net X-Envelope-To: kuba@kernel.org X-Envelope-To: richardcochran@gmail.com X-Envelope-To: netdev@vger.kernel.org Message-ID: Date: Wed, 29 May 2024 11:15:21 -0700 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH net-next] bnxt_en: add timestamping statistics support To: Michael Chan , Vadim Fedorenko Cc: "David S. Miller" , Jakub Kicinski , Richard Cochran , netdev@vger.kernel.org References: <20240529171946.2866274-1-vadfed@meta.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vadim Fedorenko In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 29/05/2024 18:48, Michael Chan wrote: > On Wed, May 29, 2024 at 10:19 AM Vadim Fedorenko wrote: >> >> The ethtool_ts_stats structure was introduced earlier this year. Now >> it's time to support this group of counters in more drivers. >> This patch adds support to bnxt driver. >> >> Signed-off-by: Vadim Fedorenko >> --- >> drivers/net/ethernet/broadcom/bnxt/bnxt.c | 18 +++++++++++++----- >> .../net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 18 ++++++++++++++++++ >> drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 18 ++++++++++++++++++ >> drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h | 8 ++++++++ >> 4 files changed, 57 insertions(+), 5 deletions(-) >> > >> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h >> index 2c3415c8fc03..589e093b1608 100644 >> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h >> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h >> @@ -79,6 +79,12 @@ struct bnxt_pps { >> struct pps_pin pins[BNXT_MAX_TSIO_PINS]; >> }; >> >> +struct bnxt_ptp_stats { >> + u64 ts_pkts; >> + u64 ts_lost; >> + atomic64_t ts_err; >> +}; >> + >> struct bnxt_ptp_cfg { >> struct ptp_clock_info ptp_info; >> struct ptp_clock *ptp_clock; >> @@ -125,6 +131,8 @@ struct bnxt_ptp_cfg { >> u32 refclk_mapped_regs[2]; >> u32 txts_tmo; >> unsigned long abs_txts_tmo; >> + >> + struct bnxt_ptp_stats *stats; > > I think there is no need to allocate this small stats structure > separately. It can just be: > > struct bnxt_ptp_stats stats; > > The struct bnxt_ptp_cfg will only be allocated if the device supports > PTP. So the stats can always be a part of struct bnxt_ptp_cfg. Yeah, I was thinking about embedding the struct into bnxt_ptp_cfg. Ok, I'll make v2 in 24hr then. Thanks! > Other than that, it looks good to me. Thanks. > >> }; >>