From: Slava Ovsiienko <viacheslavo@mellanox.com>
To: Mordechay Haimovsky <motih@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Mordechay Haimovsky <motih@mellanox.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 1/3] net/mlx5: fix shared counter allocation logic
Date: Sat, 29 Dec 2018 20:12:42 +0000 [thread overview]
Message-ID: <AM4PR05MB3265CC1646D0DA09E6346B77D2B00@AM4PR05MB3265.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <1545949196-3355-2-git-send-email-motih@mellanox.com>
Moti, don't you forget to update flow_verbs_counter_release() ?
Only shared counters should be removed from the list.
WBR,
Slava
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Mordechay Haimovsky
> Sent: Friday, December 28, 2018 0:20
> To: dev@dpdk.org
> Cc: Mordechay Haimovsky <motih@mellanox.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v2 1/3] net/mlx5: fix shared counter allocation
> logic
>
> This commit fixes the logic for searching and allocating a shared counter in
> mlx5_flow_verbs.
> Now only the shared counters in the counters list are checked for a match
> and not all the counters as before.
>
> Fixes: 84c406e74524 ("net/mlx5: add flow translate function")
> Cc: stable@dpdk.org
>
> Signed-off-by: Moti Haimovsky <motih@mellanox.com>
> ---
> v2:
> * Modified commit header
> ---
> drivers/net/mlx5/mlx5_flow_verbs.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c
> b/drivers/net/mlx5/mlx5_flow_verbs.c
> index 81ec59d..409e1cd 100644
> --- a/drivers/net/mlx5/mlx5_flow_verbs.c
> +++ b/drivers/net/mlx5/mlx5_flow_verbs.c
> @@ -121,13 +121,13 @@
> struct mlx5_flow_counter *cnt;
> int ret;
>
> - LIST_FOREACH(cnt, &priv->flow_counters, next) {
> - if (!cnt->shared || cnt->shared != shared)
> - continue;
> - if (cnt->id != id)
> - continue;
> - cnt->ref_cnt++;
> - return cnt;
> + if (shared) {
> + LIST_FOREACH(cnt, &priv->flow_counters, next) {
> + if (cnt->shared && cnt->id == id) {
> + cnt->ref_cnt++;
> + return cnt;
> + }
> + }
> }
> cnt = rte_calloc(__func__, 1, sizeof(*cnt), 0);
> if (!cnt) {
> --
> 1.8.3.1
next prev parent reply other threads:[~2018-12-29 20:12 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-25 14:38 [dpdk-dev] [PATCH v1 0/3] support flow counters using devx Mordechay Haimovsky
2018-12-25 14:38 ` [dpdk-dev] [PATCH v1 1/3] net/mlx5: modify shared counter allocation logic Mordechay Haimovsky
2018-12-27 8:12 ` Shahaf Shuler
2018-12-25 14:38 ` [dpdk-dev] [PATCH v1 2/3] net/mlx5: add devx functions to glue Mordechay Haimovsky
2018-12-27 8:12 ` Shahaf Shuler
2018-12-25 14:38 ` [dpdk-dev] [PATCH v1 3/3] net/mlx5: support flow counters using devx Mordechay Haimovsky
2018-12-27 8:15 ` Shahaf Shuler
2018-12-27 22:20 ` [dpdk-dev] [PATCH v2 0/3] " Mordechay Haimovsky
2018-12-27 22:20 ` [dpdk-dev] [PATCH v2 1/3] net/mlx5: fix shared counter allocation logic Mordechay Haimovsky
2018-12-29 20:12 ` Slava Ovsiienko [this message]
2018-12-31 7:23 ` Shahaf Shuler
2019-01-02 6:58 ` Mordechay Haimovsky
2018-12-27 22:20 ` [dpdk-dev] [PATCH v2 2/3] net/mlx5: add devx functions to glue Mordechay Haimovsky
2018-12-27 22:20 ` [dpdk-dev] [PATCH v2 3/3] net/mlx5: support flow counters using devx Mordechay Haimovsky
2019-01-02 9:43 ` [dpdk-dev] [PATCH v3 0/3] " Mordechay Haimovsky
2019-01-02 9:43 ` [dpdk-dev] [PATCH v3 1/3] net/mlx5: fix shared counter allocation logic Mordechay Haimovsky
2019-01-02 9:43 ` [dpdk-dev] [PATCH v3 2/3] net/mlx5: add devx functions to glue Mordechay Haimovsky
2019-01-02 9:43 ` [dpdk-dev] [PATCH v3 3/3] net/mlx5: support flow counters using devx Mordechay Haimovsky
2019-01-03 8:29 ` Shahaf Shuler
2019-01-03 15:06 ` [dpdk-dev] [PATCH v4 0/3] " Mordechay Haimovsky
2019-01-06 7:43 ` Shahaf Shuler
2019-01-03 15:06 ` [dpdk-dev] [PATCH v4 1/3] net/mlx5: fix shared counter allocation logic Mordechay Haimovsky
2019-01-03 15:06 ` [dpdk-dev] [PATCH v4 2/3] net/mlx5: add devx functions to glue Mordechay Haimovsky
2019-01-03 15:06 ` [dpdk-dev] [PATCH v4 3/3] net/mlx5: support flow counters using devx Mordechay Haimovsky
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=AM4PR05MB3265CC1646D0DA09E6346B77D2B00@AM4PR05MB3265.eurprd05.prod.outlook.com \
--to=viacheslavo@mellanox.com \
--cc=dev@dpdk.org \
--cc=motih@mellanox.com \
--cc=stable@dpdk.org \
/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).