patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@nvidia.com>
To: Bing Zhao <bingz@nvidia.com>,
	Slava Ovsiienko <viacheslavo@nvidia.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Ori Kam <orika@nvidia.com>,
	Dariusz Sosnowski <dsosnowski@nvidia.com>,
	Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>, Xueming Li <xuemingl@nvidia.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH] net/mlx5: fix the counters map in bonding mode
Date: Thu, 29 Feb 2024 13:36:27 +0000	[thread overview]
Message-ID: <MN0PR12MB6056E21515DADA36B02907D7CF5F2@MN0PR12MB6056.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20240229093456.306768-1-bingz@nvidia.com>

Hi,

> -----Original Message-----
> From: Bing Zhao <bingz@nvidia.com>
> Sent: Thursday, February 29, 2024 11:35 AM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; dev@dpdk.org; Raslan
> Darawsheh <rasland@nvidia.com>
> Cc: Ori Kam <orika@nvidia.com>; Dariusz Sosnowski
> <dsosnowski@nvidia.com>; Suanming Mou <suanmingm@nvidia.com>;
> Matan Azrad <matan@nvidia.com>; Xueming Li <xuemingl@nvidia.com>;
> stable@dpdk.org
> Subject: [PATCH] net/mlx5: fix the counters map in bonding mode
> 
> In the HW-LAG mode, there is only one mlx5 IB device with 2 ETH interfaces. In
> theory, the settings on both ports should be the same.
> But in the real life, some inconsistent settings may be done by the user and the
> PMD is not aware of this.
> 
> In the previous implementation, the xstats map was generated from the
> information fetched on the 1st port of a bonding interface. If the 2nd port had
> a different settings, the number and the order of the counters may differ from
> that of the 1st one. The ioctl() call may corrupt the user buffers (copy_to_user)
> and cause a crash.
> 
> The commit will change the map between the driver counters to the PMD user
> counters.
>   1. Switch the inner and outer loop to speed up the initialization
>      time AMAP - since there will be >300 counters returned from the
>      driver.
>   2. Generate an unique map for both ports in LAG mode.
>     a. Scan the 1st port and find the supported counters' strings,
>        then add to the map.
>     b. In bonding, scan the 2nd port and find the strings. If one is
>        already in the map, use the index. Or append to the next free
>        slot.
>     c. Append the device counters that needs to be fetched via sysfs
>        or Devx command. This kind of counter(s) is unique per IB
>        device.
> 
> After querying the statistics from the driver, the value will be read from the
> proper offset in the "struct ethtool_stats" and then added into the output
> array based on the map information. In bonding mode, the statistics from
> both ports will be accumulated if the counters are valid on both ports.
> 
> Compared to the system call or Devx command, the overhead introduced by
> the extra index comparison is light and should not cause a significant
> degradation.
> 
> The application should ensure that the port settings should not be changed
> out of the DPDK application dynamically in most cases. Or else the change
> cannot be notified and the counters map might not be valid when the number
> doesn't change but the counters set had changed. A device restart will help to
> re-initialize the map from scrath.
> 
> Fixes: 7ed15acdcd69 ("net/mlx5: improve xstats of bonding port")
> Cc: xuemingl@nvidia.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bing Zhao <bingz@nvidia.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh

      reply	other threads:[~2024-02-29 13:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29  9:34 Bing Zhao
2024-02-29 13:36 ` Raslan Darawsheh [this message]

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=MN0PR12MB6056E21515DADA36B02907D7CF5F2@MN0PR12MB6056.namprd12.prod.outlook.com \
    --to=rasland@nvidia.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=suanmingm@nvidia.com \
    --cc=viacheslavo@nvidia.com \
    --cc=xuemingl@nvidia.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).