DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gregory Etelson <getelson@nvidia.com>
To: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Matan Azrad <matan@nvidia.com>,
	Raslan Darawsheh <rasland@nvidia.com>,
	NBU-Contact-Thomas Monjalon <thomas@monjalon.net>,
	"ajit.khaparde@broadcom.com" <ajit.khaparde@broadcom.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	Wenzhuo Lu <wenzhuo.lu@intel.com>,
	Beilei Xing <beilei.xing@intel.com>,
	Bernard Iremonger <bernard.iremonger@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: fix testpmd flows left before port stop.
Date: Sun, 29 Nov 2020 06:59:16 +0000	[thread overview]
Message-ID: <BY5PR12MB48340E04B0339D5FDF4B7A8CA5F60@BY5PR12MB4834.namprd12.prod.outlook.com> (raw)
In-Reply-To: <3948b2ca-f9b9-c34a-d6ae-e9c66fbc16ea@oktetlabs.ru>

Hello Andrew,

> On 11/26/20 7:43 PM, Gregory Etelson wrote:
> > According to RTE flow user guide, PMD will not keep flow rules after
> > port stop. Application resources that refer to flow rules become
> > obsolete after port stop and must not be used.
> > Testpmd maintains linked list of active flows for each port. Entries
> > in that list are allocated dynamically and must be explicitly released
> > to prevent memory leak.
> > The patch releases testpmd port flow_list that holds remaining flows
> > before port is stopped.
> >
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Gregory Etelson <getelson@nvidia.com>
> > ---
> >  app/test-pmd/testpmd.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> > 33fc0fddf5..0bb192b2f5 100644
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -2806,6 +2806,9 @@ stop_port(portid_t pid)
> >                       }
> >               }
> >
> > +             if (port->flow_list)
> > +                     port_flow_flush(pi);
> > +
> >               if (rte_eth_dev_stop(pi) != 0)
> >                       RTE_LOG(ERR, EAL, "rte_eth_dev_stop failed for
> port %u\n",
> >                               pi);
> >
> 
> port_flow_flush() does rte_flow_flush() which is not strictly required.
> Description sounds like we should cleanup testpmd lists only.

You are right, call to rte_flow_flush() is not required, if testpmd calls port_flow_flush()
as part of port stop sequence, because PMD will remove flows in that scenario.
port_flow_flush() has a general implementation. It destroys all flows without
port state consideration - current or future. In this form, port_flow_flush() can be
called from any testpmd scenario that needs flows destruction.

Regards,
Gregory

  reply	other threads:[~2020-11-29  6:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11  6:14 [dpdk-dev] [PATCH] app/testpmd: fix flow rules list after " Gregory Etelson
2020-11-24 14:42 ` Ajit Khaparde
2020-11-26 15:41   ` Thomas Monjalon
2020-11-26 16:43 ` [dpdk-dev] [PATCH v2] app/testpmd: fix testpmd flows left before " Gregory Etelson
2020-11-27 16:01   ` Andrew Rybchenko
2020-11-29  6:59     ` Gregory Etelson [this message]
2021-01-06 18:07   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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=BY5PR12MB48340E04B0339D5FDF4B7A8CA5F60@BY5PR12MB4834.namprd12.prod.outlook.com \
    --to=getelson@nvidia.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=beilei.xing@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=wenzhuo.lu@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).