mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ravi Gunasekaran <r-gunasekaran@ti.com>
To: MD Danish Anwar <danishanwar@ti.com>,
	Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<srk@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>,
	Roger Quadros <rogerq@kernel.org>
Subject: Re: [PATCH] net: ti: icssg-prueth: Fix tx_total_bytes count
Date: Wed, 11 Oct 2023 15:16:50 +0530	[thread overview]
Message-ID: <3bc32261-fdcf-2cea-cae2-f4dddc147d96@ti.com> (raw)
In-Reply-To: <20231011063700.1824093-1-danishanwar@ti.com>



On 10/11/23 12:07 PM, MD Danish Anwar wrote:
> ICSSG HW stats on TX side considers 8 preamble bytes as data bytes. Due
> to this the tx_total_bytes of one interface doesn't match the
> rx_total_bytes of other interface when two ICSSG interfaces are

The errata is on the ICSSG Tx side regardless of which interface it is
connected to. Please rephrase this part of the message to something like,
"rx_total_bytes of the link partner".

> connected with each other. There is no public errata available yet.
> 
> As a workaround to fix this, decrease tx_total_bytes by 8 bytes for every
> tx frame.
> 
> Fixes: c1e10d5dc7a1 ("net: ti: icssg-prueth: Add ICSSG Stats")
> Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
> ---
>  drivers/net/ethernet/ti/icssg/icssg_stats.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_stats.c b/drivers/net/ethernet/ti/icssg/icssg_stats.c
> index bb0b33927e3b..dc12edcbac02 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_stats.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_stats.c
> @@ -18,6 +18,7 @@ void emac_update_hardware_stats(struct prueth_emac *emac)
>  	struct prueth *prueth = emac->prueth;
>  	int slice = prueth_emac_slice(emac);
>  	u32 base = stats_base[slice];
> +	u32 tx_pkt_cnt = 0;
>  	u32 val;
>  	int i;
>  
> @@ -29,7 +30,12 @@ void emac_update_hardware_stats(struct prueth_emac *emac)
>  			     base + icssg_all_stats[i].offset,
>  			     val);
>  
> +		if (!strncmp(icssg_ethtool_stats[i].name, "tx_good_frames", ETH_GSTRING_LEN))
> +			tx_pkt_cnt = val;
> +
>  		emac->stats[i] += val;
> +		if (!strncmp(icssg_ethtool_stats[i].name, "tx_total_bytes", ETH_GSTRING_LEN))
> +			emac->stats[i] -= tx_pkt_cnt * 8;
>  	}
>  }
>  

-- 
Regards,
Ravi

  reply	other threads:[~2023-10-11  9:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11  6:37 MD Danish Anwar
2023-10-11  9:46 ` Ravi Gunasekaran [this message]
2023-10-12  5:22   ` MD Danish Anwar
2023-10-11 12:41 ` Andrew Lunn
2023-10-12  5:21   ` MD Danish Anwar
2023-10-12 15:28     ` Andrew Lunn
2023-10-12 16:38       ` Anwar, Md Danish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3bc32261-fdcf-2cea-cae2-f4dddc147d96@ti.com \
    --to=r-gunasekaran@ti.com \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rogerq@kernel.org \
    --cc=srk@ti.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®