From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f174.google.com (mail-wr0-f174.google.com [209.85.128.174]) by dpdk.org (Postfix) with ESMTP id CCED5998D for ; Wed, 16 Aug 2017 14:52:01 +0200 (CEST) Received: by mail-wr0-f174.google.com with SMTP id m57so14941022wrm.5 for ; Wed, 16 Aug 2017 05:52:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=5PJlCP8DI33VeE1YuooRRm/z7XqCtO8S6VlPoArSlg4=; b=PvT4dv0ZiJryyWjmugh+eYlF/U0mMUwsZUUCInK3xSJDv3ID0w5AzZMrijMgPvA30s D/Y3Rln0389hwSHXlawLLflwXNRTYhaokMQhNvieYOyxFqb/dvj8+xIEL6HtU1JaxUJd 01B/F2l6I0/LSr5moipQsmvIKmCTk9dU6OSDJP4/2kkjCDSC27HfPgKY//AWFyHFZt++ c5ML3JHD1Bh5nEeQxRhk9YbDkNHoqWjZUp0YQ6cpHUt0+e031V41FfxBfIUWEnzx//Lo JTGtuu4YoBLQyGUzlJEpp0tbgS+tYaPgRlrWWfsbxG4BBG0K0R5aa15vXNJBr8tdHGiT vc/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=5PJlCP8DI33VeE1YuooRRm/z7XqCtO8S6VlPoArSlg4=; b=k3/aBJu2l3IZMC88OosHfQV0jKli8D/vtJb9f66/mUZFUccOfGM3m3NfdZ7wI+hE0P mG8H9izQUX0HCF+GwizCnnurXi/dyHLiefzUSAtqkkn392dk4DUsLoitFjdLQTjUBKQM aGLH60uVKYyRRjT68XpARoH0cSFEcKqDLd6wdV6ho3tY+5D0IIB8q683b9MoKJApMseF GaMSxL1IQGHWR/7a2XGAbPE1Vqe+UESn9Sbo0NXJ9gf3HOfe2oJWjiUodVhvV0q5Di0A npOCuTHTu4pl2LPQiaiWAJ+cS2b0GVmnPo+hskz6zFa1qFWRWAo5zOBWvFv5sU6NzICl J59g== X-Gm-Message-State: AHYfb5hV+A1N8suDBMVyB+n1QBGYvKLSUN4cpjIyBNcwn0fG7xS4MHOP QjDOf0+LKviDycnzOlM= X-Received: by 10.28.7.202 with SMTP id 193mr1151936wmh.143.1502887921385; Wed, 16 Aug 2017 05:52:01 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id i7sm930183wrb.19.2017.08.16.05.52.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 05:52:00 -0700 (PDT) Date: Wed, 16 Aug 2017 14:51:51 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Matan Azrad Cc: "dev@dpdk.org" , "stable@dpdk.org" Message-ID: <20170816125151.GM8124@bidouze.vm.6wind.com> References: <1502780359-60553-1-git-send-email-matan@mellanox.com> <20170816084629.GK8124@bidouze.vm.6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] net/failsafe: fix tx sub device deactivating X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2017 12:52:02 -0000 On Wed, Aug 16, 2017 at 09:02:31AM +0000, Matan Azrad wrote: > Hi Gaetan > > > -----Original Message----- > > From: Gaëtan Rivet [mailto:gaetan.rivet@6wind.com] > > Sent: Wednesday, August 16, 2017 11:47 AM > > To: Matan Azrad > > Cc: dev@dpdk.org; stable@dpdk.org > > Subject: Re: [PATCH] net/failsafe: fix tx sub device deactivating > > > > 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. > > But the two conditions are different, > The old condition can't handle the scenario we want. > Yes you're right, but the commit log should still be written in the present tense: Remove the unreachable branch and add one in the right place respecting the original intent. Or something like it :) > > > > > 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? > > I also thought about it, and found the two are necessary for future review. > > > > > > Signed-off-by: Matan Azrad > > > Cc: stable@dpdk.org > > > > The Cc: stable line should immediately follow the Fixes: line. > > > > Will be fixed. > > > > --- > > > 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]. > OK, will be fixed. > > > > > > + 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 > > > > [1]: > > https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdpd > > k.org%2Fdoc%2Fguides%2Fcontributing%2Fcoding_style.html%23c- > > statement-style-and- > > conventions&data=02%7C01%7Cmatan%40mellanox.com%7C6283c71dcc2b4 > > ebe5f6608d4e48350cd%7Ca652971c7d2e4d9ba6a4d149256f461b%7C0%7C0% > > 7C636384700025293702&sdata=nNMTElzhe3RlEMc3vB67QlwAYYYQ%2ByNNp > > 9ebXgSsMM8%3D&reserved=0 > > -- > > Gaëtan Rivet > > 6WIND > > Thanks > Matan Azrad -- Gaëtan Rivet 6WIND