From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 9502F14E8 for ; Wed, 13 Dec 2017 16:16:54 +0100 (CET) Received: by mail-wm0-f67.google.com with SMTP id y82so22219146wmg.1 for ; Wed, 13 Dec 2017 07:16:54 -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=8t1UGlfyqUC8ZTWUTbWoscV5QfdGi/SSebWybCbZrCI=; b=uAF9VFr4Q3Of8dr7Kt8jkNI/NgB7WsaMY2RF6k/vFRbOf9u/fE5LpWjgI/l2zAq/Du +WiOLfZmLN1Bzyw/cH+q3knljJaZ28vBv0+Y/f0U1FLLXxF3wQg12iMYKGPPHtouW87E ZVi52zdzvS7SMlKBKt4+jn1lheJsv0IvjAbHJZtSSTJDlq3zUjp/fi8WdAx/ExCmLWHm WmsAEklCI/vxMDJ4ROOHaf/qitbcZqXpcjwcJshUcaRjjRLuZvsXOeR6RTGG/bg2NPm5 cY8kKR2h5JlxDRL2Nhbo0QNv9+g3i9hLjVXcbwNsCeRHaNaTDy5ohdTprCcAVTs7lTCJ Q4Dg== 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=8t1UGlfyqUC8ZTWUTbWoscV5QfdGi/SSebWybCbZrCI=; b=VcssBUmM1smKgiwAxVFHCuG8aNVGBZul8aRtsvT0psZ4K1Z/iysz6AYkjGk2l14kxx DgMXSNKZcDzke9c61AFqj1vrHoaVwhDVtXyVZCZ6x9uGI6x/TEihH0p2BplD+k5BSreX X1d+zcXUFq/cerdyZWgpeXUZWH7xRXHcm1YnzgIPqga3GEjuDJiJyIIeWfcG4J6Ar+rI /MSCP29kzA77I1NKR2x4Hm4rznfChY20t/lDm3EJvUxQixDOcrtS7yE+jmwv+04RsutQ RJL0whyixt/vgJ7UsqBBPlBKX5t4qAc8O7tdg/HHOIMhCtu4XkIdm45TLVTD1oG8dCKU wTUw== X-Gm-Message-State: AKGB3mIfXFfWvctewkt0Y1kECnTs/AlFTmw5r1sUgtfm0x9zpi1aWRo1 P1E5C/VAjZjGtUjZQVQsJcWI0g== X-Google-Smtp-Source: ACJfBouoXqXbp/wmoVKdqvz8QhUrkz3+ECXQHNNEZoMxcEQE+Qg+Z9rhUyXd3+AgAszQFA6RSi/ZQA== X-Received: by 10.80.225.204 with SMTP id m12mr8134075edl.216.1513178214199; Wed, 13 Dec 2017 07:16:54 -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 y28sm1564735edi.95.2017.12.13.07.16.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2017 07:16:53 -0800 (PST) Date: Wed, 13 Dec 2017 16:16:41 +0100 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Matan Azrad Cc: Adrien Mazarguil , Thomas Monjalon , dev@dpdk.org, stable@dpdk.org Message-ID: <20171213151641.g42zr7zupbsdgxsv@bidouze.vm.6wind.com> References: <1509637324-13525-1-git-send-email-matan@mellanox.com> <1513175370-16583-1-git-send-email-matan@mellanox.com> <1513175370-16583-5-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: <1513175370-16583-5-git-send-email-matan@mellanox.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v2 4/4] net/failsafe: fix removed device handling 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, 13 Dec 2017 15:16:54 -0000 Hi Matan, On Wed, Dec 13, 2017 at 02:29:30PM +0000, Matan Azrad wrote: > There is time between the physical removal of the device until > sub-device PMDs get a RMV interrupt. At this time DPDK PMDs and > applications still don't know about the removal and may call sub-device > control operation which should return an error. > > In previous code this error is reported to the application contrary to > fail-safe principle that the app should not be aware of device removal. > > Add an removal check in each relevant control command error flow and > prevent an error report to application when the sub-device is removed. > > Fixes: a46f8d5 ("net/failsafe: add fail-safe PMD") > Fixes: b737a1e ("net/failsafe: support flow API") > Cc: stable@dpdk.org > This patch is not a fix. It relies on an eth_dev API evolution. Without this evolution, this patch is meaningless and would break compilation if backported in stable branch. Please remove those tags. > Signed-off-by: Matan Azrad > --- > drivers/net/failsafe/failsafe_flow.c | 18 ++++++++++------- > drivers/net/failsafe/failsafe_ops.c | 34 ++++++++++++++++++++++----------- > drivers/net/failsafe/failsafe_private.h | 10 ++++++++++ > 3 files changed, 44 insertions(+), 18 deletions(-) < ... > > +/* > + * Check if sub device was removed. > + */ > +static inline int > +fs_is_removed(struct sub_device *sdev) > +{ > + if (sdev->remove == 1 || rte_eth_dev_is_removed(PORT_ID(sdev)) != 0) > + return 1; > + return 0; > +} Have you considered adding this check within the subdev iterator itself? I think it would prevent you from having to add it to each return value checks. It is still MT-unsafe anyway. -- Gaëtan Rivet 6WIND