DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Danylo Vodopianov <dvo-plv@napatech.com>,
	"NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>,
	"aman.deep.singh@intel.com" <aman.deep.singh@intel.com>,
	"yuying.zhang@intel.com" <yuying.zhang@intel.com>,
	Ori Kam <orika@nvidia.com>,
	"mko-plv@napatech.com" <mko-plv@napatech.com>,
	"ckm@napatech.com" <ckm@napatech.com>,
	"sil-plv@napatech.com" <sil-plv@napatech.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"ferruh.yigit@amd.com" <ferruh.yigit@amd.com>
Subject: RE: [PATCH v1 2/2] app/testpmd: fix flow destroy
Date: Fri, 15 Nov 2024 17:40:23 +0000	[thread overview]
Message-ID: <CH3PR12MB8460BEFA43B20F7A91A0E92CA4242@CH3PR12MB8460.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20241031150010.2991953-3-dvo-plv@napatech.com>

Hi,

> -----Original Message-----
> From: Danylo Vodopianov <dvo-plv@napatech.com>
> Sent: Thursday, October 31, 2024 16:00
> To: NBU-Contact-Thomas Monjalon (EXTERNAL) <thomas@monjalon.net>;
> aman.deep.singh@intel.com; yuying.zhang@intel.com; Ori Kam
> <orika@nvidia.com>; mko-plv@napatech.com; ckm@napatech.com; sil-
> plv@napatech.com
> Cc: dev@dpdk.org; ferruh.yigit@amd.com
> Subject: [PATCH v1 2/2] app/testpmd: fix flow destroy

I think it would be better to rename the commit to: "app/testpmd: fix aged flow destroy"

> 
> Avoid removal of additional flows after requested number of flows has been
> already removed.
> 
> Issue with removal of multiple flows is internal testpmd bug at
> port_flow_destroy(). This function goes through all flows and compares given
> flow ‘id’ with them. However in some cases it can advance pointer with “given ID”
> and thus remove additional flow.

I'm not sure that the issue with port_flow_destroy() is really a bug.
port_flow_destroy() function never assumed that rule array can be freed when it's executing,
and port_flow_aged() just violated that assumption.

Could you please rephrase the commit message to include that info?

> 
> Fixes: de956d5ecf08 ("app/testpmd: support age shared action context")

This fix will have to be taken into LTS releases. Please add "Cc: stable@dpdk.org"

> 
> Signed-off-by: Danylo Vodopianov <dvo-plv@napatech.com>
> ---
>  app/test-pmd/config.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index
> bf50f6adef..50c4b018c1 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -4170,8 +4170,12 @@ port_flow_aged(portid_t port_id, uint8_t destroy)
>                                ctx.pf->rule.attr->ingress ? 'i' : '-',
>                                ctx.pf->rule.attr->egress ? 'e' : '-',
>                                ctx.pf->rule.attr->transfer ? 't' : '-');
> +                       /* use local copy of id as ctx.pf is freed by
> +                        * port_flow_destroy() during processing
> +                        */

After the commit message is rephrased, I don't think this comment will be needed.

> +                       uint64_t flow_id = ctx.pf->id;

Please move the flow_id variable declaration to the beginning of the case.
Also, please enclose the case's body in braces, so that flow_id declaration does not leak to the following cases.

>                         if (destroy && !port_flow_destroy(port_id, 1,
> -                                                         &ctx.pf->id, false))
> +                                                         &flow_id,
> + false))
>                                 total++;
>                         break;
>                 case ACTION_AGE_CONTEXT_TYPE_INDIRECT_ACTION:
> --
> 2.43.5

Best regards,
Dariusz Sosnowski



  reply	other threads:[~2024-11-15 17:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-31 15:00 [PATCH v1 0/2] Testpmd flow update/destroy fixes Danylo Vodopianov
2024-10-31 15:00 ` [PATCH v1 1/2] app/testpmd: fix flow update Danylo Vodopianov
2024-11-15 17:39   ` Dariusz Sosnowski
2024-10-31 15:00 ` [PATCH v1 2/2] app/testpmd: fix flow destroy Danylo Vodopianov
2024-11-15 17:40   ` Dariusz Sosnowski [this message]
2024-11-11 13:35 ` [PATCH v1 0/2] Testpmd flow update/destroy fixes Ferruh Yigit
2024-11-14 14:12   ` Serhii Iliushyk
2024-11-14 20:18     ` Thomas Monjalon

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=CH3PR12MB8460BEFA43B20F7A91A0E92CA4242@CH3PR12MB8460.namprd12.prod.outlook.com \
    --to=dsosnowski@nvidia.com \
    --cc=aman.deep.singh@intel.com \
    --cc=ckm@napatech.com \
    --cc=dev@dpdk.org \
    --cc=dvo-plv@napatech.com \
    --cc=ferruh.yigit@amd.com \
    --cc=mko-plv@napatech.com \
    --cc=orika@nvidia.com \
    --cc=sil-plv@napatech.com \
    --cc=thomas@monjalon.net \
    --cc=yuying.zhang@intel.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).