From: Thomas Monjalon <thomas@monjalon.net>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Rasesh Mody <rmody@marvell.com>,
dev@dpdk.org, stable@dpdk.org, Xi Zhang <xix.zhang@intel.com>
Subject: Re: [dpdk-dev] [PATCH] examples/kni: fix crash during MTU set
Date: Thu, 21 May 2020 22:29:04 +0200 [thread overview]
Message-ID: <5373077.J0j3NrKs1C@thomas> (raw)
In-Reply-To: <e3959189-a7f6-425f-3466-b9f95d92c150@intel.com>
21/05/2020 17:46, Ferruh Yigit:
> On 5/21/2020 4:37 PM, Thomas Monjalon wrote:
> > 21/05/2020 17:10, Ferruh Yigit:
> >> During MTU set (kni_change_mtu) sample application setup queues, which
> >> can free and re-allocate queues.
> >> Meanwhile sample application keeps continues in Rx/Tx burst calls in
> >> different threads, which may cause crash during queue setup.
> >>
> >> Pausing application Rx/Tx calls before MTU set and starts it back
> >> afterwards.
> >>
> >> Bugzilla ID: 482
> >> Fixes: a26b116749a3 ("examples/kni: fix MTU change to setup Tx queue")
> >> Cc: stable@dpdk.org
> >>
> >> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >> ---
> >> -/* Callback for request of changing MTU */
> >> static int
> >> -kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
> >> +kni_change_mtu_(uint16_t port_id, unsigned int new_mtu)
> > [...]
> >> +/* Callback for request of changing MTU */
> >> +static int
> >> +kni_change_mtu(uint16_t port_id, unsigned int new_mtu)
> >> +{
> >> + int ret;
> >> +
> >> + rte_atomic32_inc(&kni_pause);
> >> + ret = kni_change_mtu_(port_id, new_mtu);
> >> + rte_atomic32_dec(&kni_pause);
> >> +
> >> + return ret;
> >> +}
> >
> > Why creating a new function which is called only once?
> >
>
> Just wrapping the existing one with stop/start the forwarding.
>
> These can be added into the existing function but there are many exit points in
> the function, so it will create more clutter and it is more error prone. I think
> this way more simple and clear.
OK to go on the safe side at this stage of the release :-)
next prev parent reply other threads:[~2020-05-21 20:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-21 15:10 [dpdk-dev] [PATCH] examples/kni: fix crash during MTU set Ferruh Yigit
2020-05-21 15:37 ` Thomas Monjalon
2020-05-21 15:46 ` Ferruh Yigit
2020-05-21 20:29 ` Thomas Monjalon [this message]
2020-05-21 17:32 ` [dpdk-dev] [EXT] " Rasesh Mody
2020-05-24 15:50 ` Thomas Monjalon
2020-05-22 2:17 ` [dpdk-dev] " Zhang, XiX
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=5373077.J0j3NrKs1C@thomas \
--to=thomas@monjalon.net \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=rmody@marvell.com \
--cc=stable@dpdk.org \
--cc=xix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.