From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 887C91B3DA for ; Mon, 12 Feb 2018 19:42:25 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id f71so11417658wmf.0 for ; Mon, 12 Feb 2018 10:42:25 -0800 (PST) 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=R4VGhglWfAS1Z3aX0Iblvr/kYcQmTZApbzlfuTU/qqU=; b=Vsn4XOohPD+ZbbUpAxb86DIY20hkaQ4GiCAsmhMBKlwtyj7ulPX2r1pRa5+gjy3Z8U ci+NKv9FiKF8f/qdj4+SyaqlWumP1UV3bOXUn6EDO2oRLUGQIt1K2YOQGozmGg7dtxuD ++KZbES382+hSbFAEl4GoGA3ZHkHIASuMi9QlFSI7rUyReZ4m01l4e1pSZ6Mf1/dFTkv birOg+PZ53uxGVrWOdSDkq4cZO56ctxwStJ+lt+33XR9F8X9iuq9hYSrQR4l8nwK6hgq VS+R+PPVKpBGCmxgUA9DaIpeayNOejmGl5jN63SRzIKUYl7H49ParH+DlNCRdS3CLwEu xoog== 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=R4VGhglWfAS1Z3aX0Iblvr/kYcQmTZApbzlfuTU/qqU=; b=H+QxR6paeec6S/kOj4Tb2iAVOl4fmMO1yck1S4FiRJjg8DaB0He6bZ1+Ccq/Zm+REa PypilP711fKQ+BVlXh5A8ApY4ie1zCtcYaiy8iXRz+EhpIjHINd34U7kzyZXr/39heGY jjubvmF2pSOAnc5dc6eFvJsUi7ZAFnm7uEkp9Kue9gc2TffWhaU68qOw8X6OUwuOXq8T rmk3aznbMXi+S5A7aaXMPX82wPVUU0nA+KBg1mB3/yZyfzxQxzxpKooBjLQDfPYm33Z8 sdRad9If+aN3lXHW8f4vBdE451xfrOe2FcwXieNenjuNOrON0ddggpckqbaJsvCD3PZ5 WSQg== X-Gm-Message-State: APf1xPCnV5H8dXh6mhTpziFdi5D0r29VKb0TVNYalQl3clE+mVLPdxox rJC2iTBAEGaotilTBnX4Na/HJg== X-Google-Smtp-Source: AH8x224BRQd94DA8ChuRo0qmcNOtDeAYTmdbKut0mn0w07sNVTP/qDvi/AuKRHXxj1AhA3EcBrnK8w== X-Received: by 10.28.192.24 with SMTP id q24mr4637326wmf.149.1518460944985; Mon, 12 Feb 2018 10:42:24 -0800 (PST) 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 o82sm5612263wmo.30.2018.02.12.10.42.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Feb 2018 10:42:24 -0800 (PST) Date: Mon, 12 Feb 2018 19:42:11 +0100 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Matan Azrad Cc: dev@dpdk.org, stable@dpdk.org Message-ID: <20180212184211.nmjzwqmbf3i6z7eq@bidouze.vm.6wind.com> References: <1518370054-12578-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1518370054-12578-1-git-send-email-matan@mellanox.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH] net/failsafe: fix reconfiguration 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: Mon, 12 Feb 2018 18:42:25 -0000 Hi Matan, On Sun, Feb 11, 2018 at 05:27:34PM +0000, Matan Azrad wrote: > Fail-safe PMD manages the states of its sub-devices gradually: > DEV_UNDEFINED, DEV_PARSED, DEV_PROBED, DEV_ACTIVE, DEV_STARTED. > > When the sub-device arguments successfully was parsed, the state is > raised from DEV_UNDEFINED to DEV_PARSED. > When the sub-device successfully was probed, the state is raised from > DEV_PARSED to DEV_PROBED. > When the sub-device successfully was configured by > rte_eth_dev_configure(), the state is raised from DEV_PROBED to > DEV_ACTIVE. > When the sub-device successfully was started by rte_eth_dev_start(), the > state is raised from DEV_ACTIVE to DEV_STARTED. > > When the sub-device successfully was stopped by rte_eth_dev_stop(), the > state is degraded from DEV_STARTED to DEV_ACTIVE. > When the sub-device successfully was closed by rte_eth_dev_close(), the > state is degraded from DEV_ACTIVE to DEV_PROBED. > When the sub-device successfully was removed by > rte_eal_hotplug_remove(), the state is degraded from DEV_PROBED to > DEV_UNDEFINED. > > Fail-safe dev_configure() operation calls to its sub-devices > dev_configure() operation, but only for sub-devices which are in > DEV_PROBED state, means that sub-devices which are in DEV_ACTIVE state > because the application triggered dev_stop() operation cannot be > reconfigured again by dev_configure() operation which is really > problematic when application wants to reconfigure its ports. > Actually, the application may get success report when some of the > sub-devices are not in the wanted configuration. > > The current behavior of fail-safe dev_configure() is correct only for > the first time dev_configure() is triggered by the application or for > sub-device synchronization in plug-in event, but it ignores the option > for reconfiguration from application side. > > Allow calling to sub-devices dev_configure() operations also in > DEV_ACTIVE state when the call was triggered by the application. > > Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD") > Cc: stable@dpdk.org > > Signed-off-by: Matan Azrad The commit log is too verbose, but otherwise the issue is real and the fix correct. Acked-by: Gaetan Rivet > --- > Based on previous series, "fix hotplug races". > > drivers/net/failsafe/failsafe_ops.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c > index fe64c68..057e435 100644 > --- a/drivers/net/failsafe/failsafe_ops.c > +++ b/drivers/net/failsafe/failsafe_ops.c > @@ -110,7 +110,8 @@ > int lsc_interrupt = 0; > int lsc_enabled; > > - if (sdev->state != DEV_PROBED) > + if (sdev->state != DEV_PROBED && > + !(PRIV(dev)->alarm_lock == 0 && sdev->state == DEV_ACTIVE)) > continue; > > rmv_interrupt = ETH(sdev)->data->dev_flags & > -- > 1.8.3.1 > -- Gaëtan Rivet 6WIND