Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: Gal Pressman <gal@nvidia.com>
To: Yafang Shao <laoar.shao@gmail.com>,
	Tariq Toukan <ttoukan.linux@gmail.com>
Cc: saeedm@nvidia.com, tariqt@nvidia.com, leon@kernel.org,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH] net/mlx5e: Report rx_discards_phy via rx_missed_errors
Date: Wed, 6 Nov 2024 21:23:47 +0200	[thread overview]
Message-ID: <9b3af2dd-8b56-4817-b223-c6a85ba80562@nvidia.com> (raw)
In-Reply-To: <CALOAHbDPbwH7vqV2_NAm=_YnN2KnmVLOe7avWOYG+Rynd295Vg@mail.gmail.com>

On 06/11/2024 13:49, Yafang Shao wrote:
> On Wed, Nov 6, 2024 at 5:56 PM Tariq Toukan <ttoukan.linux@gmail.com> wrote:
>>
>>
>>
>> On 06/11/2024 8:40, Yafang Shao wrote:
>>> We observed a high number of rx_discards_phy events on some servers when
>>> running `ethtool -S`. However, this important counter is not currently
>>> reflected in the /proc/net/dev statistics file, making it challenging to
>>> monitor effectively.
>>>
>>> Since rx_missed_errors represents packets dropped due to buffer exhaustion,
>>> it makes sense to include rx_discards_phy in this counter to enhance
>>> monitoring visibility. This change will help administrators track these
>>> events more effectively through standard interfaces.
>>>
>>
>> Hi,
>>
>> Thanks for your patch.
>>
>> It's a matter of interpretation...
>> The documentation in
>> Documentation/ABI/testing/sysfs-class-net-statistics refers to the
>> driver for the exact meaning.

I think this documentation is outdated, a more recent one is in if_link.h:

 * @rx_missed_errors: Count of packets missed by the host.
 *   Folded into the "drop" counter in `/proc/net/dev`.
 *
 *   Counts number of packets dropped by the device due to lack
 *   of buffer space. This usually indicates that the host interface
 *   is slower than the network interface, or host is not keeping up
 *   with the receive packet rate.
 *
 *   This statistic corresponds to hardware events and is not used
 *   on software devices.

>>
>> rx_discards_phy counts packet drops due to exhaustion of the physical
>> port memory (not in the host), this happen way before steering the
>> packet to any receive queue.
>> Today, rx_missed_errors counts SW/host memory buffer exhaustion of the
>> receive queues.
>> I don't think that rx_missed_errors should mix both.
> 
> Thanks for your detailed explanation.
> 
>>
>> Maybe some other counter can be used for rx_discards_phy, like
>> rx_fifo_errors?
> 
> It appears that rx_fifo_errors is a more appropriate counter for this purpose.
> I will submit a v2. Thanks for your suggestion.

Probably not a good idea:
 *   This statistics was used interchangeably with @rx_over_errors.
 *   Not recommended for use in drivers for high speed interfaces.

  reply	other threads:[~2024-11-06 19:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-06  6:40 [PATCH] net/mlx5e: Report rx_discards_phy via rx_missed_errors Yafang Shao
2024-11-06  9:56 ` Tariq Toukan
2024-11-06 11:49   ` Yafang Shao
2024-11-06 19:23     ` Gal Pressman [this message]
2024-11-07  1:17       ` Jakub Kicinski
2024-11-08  8:39         ` Yafang Shao
2024-11-08  8:37       ` Yafang Shao

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=9b3af2dd-8b56-4817-b223-c6a85ba80562@nvidia.com \
    --to=gal@nvidia.com \
    --cc=laoar.shao@gmail.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.com \
    --cc=ttoukan.linux@gmail.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