From: "Gaëtan Rivet" <gaetan.rivet@6wind.com>
To: Matan Azrad <matan@mellanox.com>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH] net/failsafe: fix tx sub device deactivating
Date: Wed, 16 Aug 2017 10:46:30 +0200 [thread overview]
Message-ID: <20170816084629.GK8124@bidouze.vm.6wind.com> (raw)
In-Reply-To: <1502780359-60553-1-git-send-email-matan@mellanox.com>
Hi Matan,
Thanks for spotting this, a few nits below.
On Tue, Aug 15, 2017 at 09:59:19AM +0300, Matan Azrad wrote:
> The corrupted code couldn't recognize that all sub devices
> were not ready for tx traffic when failsafe PMD was trying
> to switch device because of an unreachable condition using.
>
> Hence, the current tx sub device variable was not updated
> correctly.
>
> The fix removed the unreachable condition and adds condition
> in the right place to handle non tx device ready scenario.
>
It should be reworded as
Make the condition reachable by moving it in the right place to
handle the scenario when no TX device is ready.
If the condition is removed and then added, I find it clearer to say
that it was moved.
> Fixes: ebea83f899d8 ("net/failsafe: add plug-in support")
> Fixes: 598fb8aec6f6 ("net/failsafe: support device removal")
>
The root commit introducing the issue is the first one, but
this fix only applies to the second.
So I don't know which commit is actually fixed by this, but I find
peculiar to have two commits targeted by a fix.
In doubt, probably leave both, but maybe someone has a better idea about
it?
> Signed-off-by: Matan Azrad <matan@mellanox.com>
> Cc: stable@dpdk.org
The Cc: stable line should immediately follow the Fixes: line.
> ---
> drivers/net/failsafe/failsafe_private.h | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> Hi Gaetan
> I didn't find any real scenario which cause to problematic
> behavior because of the previous code.
> But it may be.
>
> diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
> index 0361cf4..dc97aec 100644
> --- a/drivers/net/failsafe/failsafe_private.h
> +++ b/drivers/net/failsafe/failsafe_private.h
> @@ -346,9 +346,10 @@ fs_switch_dev(struct rte_eth_dev *dev,
> PRIV(dev)->subs_tx = i;
> break;
> }
> - } else if (txd && txd->state < req_state) {
> - DEBUG("No device ready, deactivating tx_dev");
> - PRIV(dev)->subs_tx = PRIV(dev)->subs_tail;
> + if (i >= PRIV(dev)->subs_tail || !sdev) {
`!sdev` should be `sdev == NULL`, see [1].
> + DEBUG("No device ready, deactivating tx_dev");
> + PRIV(dev)->subs_tx = PRIV(dev)->subs_tail;
> + }
> } else {
> return;
> }
> --
> 2.7.4
>
With these changes,
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
[1]:
http://dpdk.org/doc/guides/contributing/coding_style.html#c-statement-style-and-conventions
--
Gaëtan Rivet
6WIND
next prev parent reply other threads:[~2017-08-16 8:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-15 6:59 Matan Azrad
2017-08-16 8:46 ` Gaëtan Rivet [this message]
2017-08-16 9:02 ` Matan Azrad
2017-08-16 12:51 ` Gaëtan Rivet
2017-08-16 14:19 ` [dpdk-stable] [PATCH v2] " Matan Azrad
2017-08-16 14:39 ` Gaëtan Rivet
2017-08-16 14:53 ` Matan Azrad
2017-08-21 12:56 ` 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=20170816084629.GK8124@bidouze.vm.6wind.com \
--to=gaetan.rivet@6wind.com \
--cc=dev@dpdk.org \
--cc=matan@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).