netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: <edward.cree@amd.com>, <linux-net-drivers@amd.com>,
	<davem@davemloft.net>, <kuba@kernel.org>, <edumazet@google.com>,
	<pabeni@redhat.com>
Cc: Edward Cree <ecree.xilinx@gmail.com>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 5/6] sfc: implement per-queue TSO (hw_gso) stats
Date: Wed, 28 Aug 2024 15:25:07 -0700	[thread overview]
Message-ID: <d24bc833-e407-4323-9bb7-7149de35748a@intel.com> (raw)
In-Reply-To: <35782d70ad89c72d5dc819f9a12b2e5b4e742141.1724852597.git.ecree.xilinx@gmail.com>



On 8/28/2024 6:45 AM, edward.cree@amd.com wrote:
> From: Edward Cree <ecree.xilinx@gmail.com>
> 
> Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
> ---

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

>  drivers/net/ethernet/sfc/efx.c        | 20 +++++++++++++++++---
>  drivers/net/ethernet/sfc/net_driver.h |  4 ++++
>  drivers/net/ethernet/sfc/tx_common.c  |  2 ++
>  3 files changed, 23 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> index 8b46d143b6c7..bf06fbcdcbff 100644
> --- a/drivers/net/ethernet/sfc/efx.c
> +++ b/drivers/net/ethernet/sfc/efx.c
> @@ -653,14 +653,21 @@ static void efx_get_queue_stats_tx(struct net_device *net_dev, int idx,
>  
>  	channel = efx_get_tx_channel(efx, idx);
>  	stats->packets = 0;
> +	stats->hw_gso_packets = 0;
> +	stats->hw_gso_wire_packets = 0;
>  	/* If a TX channel has XDP TXQs, the stats for these will be counted
>  	 * under the channel rather than in base stats.  Unclear whether this
>  	 * is correct behaviour, but we can't reliably exclude XDP TXes from
>  	 * these stats anyway because in EFX_XDP_TX_QUEUES_BORROWED we use
>  	 * the same TXQ as the core.
>  	 */
> -	efx_for_each_channel_tx_queue(tx_queue, channel)
> +	efx_for_each_channel_tx_queue(tx_queue, channel) {
>  		stats->packets += tx_queue->tx_packets - tx_queue->old_tx_packets;
> +		stats->hw_gso_packets += tx_queue->tso_bursts -
> +					 tx_queue->old_tso_bursts;
> +		stats->hw_gso_wire_packets += tx_queue->tso_packets -
> +					      tx_queue->old_tso_packets;
> +	}
>  }
>  
>  static void efx_get_base_stats(struct net_device *net_dev,
> @@ -676,6 +683,8 @@ static void efx_get_base_stats(struct net_device *net_dev,
>  	rx->hw_drops = 0;
>  	rx->hw_drop_overruns = 0;
>  	tx->packets = 0;
> +	tx->hw_gso_packets = 0;
> +	tx->hw_gso_wire_packets = 0;
>  
>  	/* Count all packets on non-core queues, and packets before last
>  	 * datapath start on core queues.
> @@ -694,10 +703,15 @@ static void efx_get_base_stats(struct net_device *net_dev,
>  		efx_for_each_channel_tx_queue(tx_queue, channel) {
>  			if (channel->channel < efx->tx_channel_offset ||
>  			    channel->channel >= efx->tx_channel_offset +
> -						net_dev->real_num_tx_queues)
> +						net_dev->real_num_tx_queues) {
>  				tx->packets += tx_queue->tx_packets;
> -			else
> +				tx->hw_gso_packets += tx_queue->tso_bursts;
> +				tx->hw_gso_wire_packets += tx_queue->tso_packets;
> +			} else {
>  				tx->packets += tx_queue->old_tx_packets;
> +				tx->hw_gso_packets += tx_queue->old_tso_bursts;
> +				tx->hw_gso_wire_packets += tx_queue->old_tso_packets;
> +			}
>  		}
>  	}
>  }
> diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
> index 25701f37aa40..2cf2935a713c 100644
> --- a/drivers/net/ethernet/sfc/net_driver.h
> +++ b/drivers/net/ethernet/sfc/net_driver.h
> @@ -234,6 +234,8 @@ struct efx_tx_buffer {
>   * @notify_count: Count of notified descriptors to the NIC
>   * @tx_packets: Number of packets sent since this struct was created
>   * @old_tx_packets: Value of @tx_packets as of last efx_init_tx_queue()
> + * @old_tso_bursts: Value of @tso_bursts as of last efx_init_tx_queue()
> + * @old_tso_packets: Value of @tso_packets as of last efx_init_tx_queue()
>   * @empty_read_count: If the completion path has seen the queue as empty
>   *	and the transmission path has not yet checked this, the value of
>   *	@read_count bitwise-added to %EFX_EMPTY_COUNT_VALID; otherwise 0.
> @@ -284,6 +286,8 @@ struct efx_tx_queue {
>  	/* Statistics to supplement MAC stats */
>  	unsigned long tx_packets;
>  	unsigned long old_tx_packets;
> +	unsigned int old_tso_bursts;
> +	unsigned int old_tso_packets;
>  
>  	/* Members shared between paths and sometimes updated */
>  	unsigned int empty_read_count ____cacheline_aligned_in_smp;
> diff --git a/drivers/net/ethernet/sfc/tx_common.c b/drivers/net/ethernet/sfc/tx_common.c
> index f1694900e0f0..cd0857131aa8 100644
> --- a/drivers/net/ethernet/sfc/tx_common.c
> +++ b/drivers/net/ethernet/sfc/tx_common.c
> @@ -87,6 +87,8 @@ void efx_init_tx_queue(struct efx_tx_queue *tx_queue)
>  	tx_queue->completed_timestamp_minor = 0;
>  
>  	tx_queue->old_tx_packets = tx_queue->tx_packets;
> +	tx_queue->old_tso_bursts = tx_queue->tso_bursts;
> +	tx_queue->old_tso_packets = tx_queue->tso_packets;
>  
>  	tx_queue->xdp_tx = efx_channel_is_xdp_tx(tx_queue->channel);
>  	tx_queue->tso_version = 0;
> 

  reply	other threads:[~2024-08-28 22:25 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 13:45 [PATCH net-next 0/6] sfc: per-queue stats edward.cree
2024-08-28 13:45 ` [PATCH net-next 1/6] sfc: remove obsolete counters from struct efx_channel edward.cree
2024-08-28 22:17   ` Jacob Keller
2024-08-28 13:45 ` [PATCH net-next 2/6] sfc: implement basic per-queue stats edward.cree
2024-08-28 22:20   ` Jacob Keller
2024-08-29  0:44     ` Jakub Kicinski
2024-08-29  0:41   ` Jakub Kicinski
2024-08-29 12:03     ` Alexander Lobakin
2024-09-05 10:57     ` Edward Cree
2024-09-05 14:56       ` Jakub Kicinski
2024-08-28 13:45 ` [PATCH net-next 3/6] sfc: add n_rx_overlength to ethtool stats edward.cree
2024-08-28 22:22   ` Jacob Keller
2024-08-29  0:47   ` Jakub Kicinski
2024-09-05 10:50     ` Edward Cree
2024-08-28 13:45 ` [PATCH net-next 4/6] sfc: implement per-queue rx drop and overrun stats edward.cree
2024-08-28 22:24   ` Jacob Keller
2024-08-28 13:45 ` [PATCH net-next 5/6] sfc: implement per-queue TSO (hw_gso) stats edward.cree
2024-08-28 22:25   ` Jacob Keller [this message]
2024-08-28 13:45 ` [PATCH net-next 6/6] sfc: add per-queue RX and TX bytes stats edward.cree
2024-08-28 22:25   ` Jacob Keller
2024-08-29  0:49     ` Jakub Kicinski

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=d24bc833-e407-4323-9bb7-7149de35748a@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=davem@davemloft.net \
    --cc=ecree.xilinx@gmail.com \
    --cc=edumazet@google.com \
    --cc=edward.cree@amd.com \
    --cc=kuba@kernel.org \
    --cc=linux-net-drivers@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).