Message ID | 20180509094337.26112-3-thomas@monjalon.net (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 31980C254; Wed, 9 May 2018 11:43:53 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 3737AAAAE; Wed, 9 May 2018 11:43:47 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D18532104B; Wed, 9 May 2018 05:43:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 09 May 2018 05:43:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=jymKD/Z7Gg4dxj 5elUAwtIlQrQGlc41uNiIyGbbsupU=; b=kL8cyKUaQHgwPAW03Mn3lmY1Y64MDF 3n2M/06e6JNjKeFaOdrOtWFA8cvgxcnjlTnnBLr6YfmhUpwlXVTRAZ8SKZ51zmD1 XqNpTu8W+NbHWD6HqTImfw6ysrZ2Vcj+Po7aAmTpNbH+WYu54bntaW91gE+sLuwj wyYH639npqs0A= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=jymKD/Z7Gg4dxj5elUAwtIlQrQGlc41uNiIyGbbsupU=; b=ku2u9uON XNCdEdN3dVqWMiSn9LqQRI0R/jLG1191lm0Li4Z+Zeu1S7XUaj+Up11vXbO9I+px pj+kZEKcnTha7Kyp/2ShXYAfDvsdcgQIRnH6sJqM/GiBtzcSij+LoF6/7bhki87n XR+nkCW1ZI60tmGmBGSj9Ifp8e6oNKwg2xmYiJnOGuJjJhqe4oyyBMaRBnQfLsQh kKeRsAUfSQ6kM2Gd9em0YINZ5GHAT63srguLqO1bzNJgWCzmcwGAQdBhtJ3s7AkN ZSUsJBaT6C+b83Gpt6Up/+w4VRgFRL2evAqIogah64+HJs9HR5EqK2rHzgXkxYSh 74wOav4tYVRVyA== X-ME-Sender: <xms:0sLyWseqrh35ZLd7WXPGad0LPNGFnCa9yz_2T8a92QFqwOU3zV8xTg> Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 3AA12E444A; Wed, 9 May 2018 05:43:46 -0400 (EDT) From: Thomas Monjalon <thomas@monjalon.net> To: dev@dpdk.org Cc: stable@dpdk.org Date: Wed, 9 May 2018 11:43:28 +0200 Message-Id: <20180509094337.26112-3-thomas@monjalon.net> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180509094337.26112-1-thomas@monjalon.net> References: <20180509094337.26112-1-thomas@monjalon.net> Subject: [dpdk-dev] [PATCH 02/11] net/failsafe: fix sub-device visibility X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Checks
Context | Check | Description |
---|---|---|
ci/checkpatch | success | coding style OK |
Commit Message
Thomas Monjalon
May 9, 2018, 9:43 a.m. UTC
The iterator function rte_eth_find_next_owned_by(), used by the iterator macro RTE_ETH_FOREACH_DEV_OWNED_BY, are ignoring the devices which are neither ATTACHED nor REMOVED. Thus sub-devices, having the state DEFERRED, cannot be seen with the ethdev iterator. The state RTE_ETH_DEV_DEFERRED can be replaced by RTE_ETH_DEV_ATTACHED + owner. Fixes: dcd0c9c32b8d ("net/failsafe: use ownership mechanism for slaves") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Matan Azrad <matan@mellanox.com> --- drivers/net/failsafe/failsafe_eal.c | 1 - 1 file changed, 1 deletion(-)
Comments
I think this patch should be swapped with the next commit "ethdev: add doxygen comments for each state", While the comment about "DEFERRED" would be edited in this one to become: /** The deferred state is deprecated and replaced by ownership. */ ^^^^^^^^^^ Otherwise I agree that the device state is not to be used anymore. On Wed, May 09, 2018 at 11:43:28AM +0200, Thomas Monjalon wrote: > The iterator function rte_eth_find_next_owned_by(), used by the > iterator macro RTE_ETH_FOREACH_DEV_OWNED_BY, are ignoring the devices > which are neither ATTACHED nor REMOVED. Thus sub-devices, having > the state DEFERRED, cannot be seen with the ethdev iterator. > The state RTE_ETH_DEV_DEFERRED can be replaced by > RTE_ETH_DEV_ATTACHED + owner. > > Fixes: dcd0c9c32b8d ("net/failsafe: use ownership mechanism for slaves") > Cc: stable@dpdk.org > > Signed-off-by: Thomas Monjalon <thomas@monjalon.net> > Acked-by: Matan Azrad <matan@mellanox.com> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com> > --- > drivers/net/failsafe/failsafe_eal.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c > index ee89236f1..ce767703f 100644 > --- a/drivers/net/failsafe/failsafe_eal.c > +++ b/drivers/net/failsafe/failsafe_eal.c > @@ -98,7 +98,6 @@ fs_bus_init(struct rte_eth_dev *dev) > SUB_ID(sdev) = i; > sdev->fs_dev = dev; > sdev->dev = ETH(sdev)->device; > - ETH(sdev)->state = RTE_ETH_DEV_DEFERRED; > sdev->state = DEV_PROBED; > } > return 0; > -- > 2.16.2 >
09/05/2018 14:13, Gaëtan Rivet: > I think this patch should be swapped with the next commit > "ethdev: add doxygen comments for each state", > While the comment about "DEFERRED" would be edited in this one to become: > /** The deferred state is deprecated and replaced by ownership. */ > ^^^^^^^^^^ I prefer considering the DEFERRED state as useless in this series. We can discuss about deprecation and removal, separately with a deprecation notice. > Otherwise I agree that the device state is not to be used anymore.
diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c index ee89236f1..ce767703f 100644 --- a/drivers/net/failsafe/failsafe_eal.c +++ b/drivers/net/failsafe/failsafe_eal.c @@ -98,7 +98,6 @@ fs_bus_init(struct rte_eth_dev *dev) SUB_ID(sdev) = i; sdev->fs_dev = dev; sdev->dev = ETH(sdev)->device; - ETH(sdev)->state = RTE_ETH_DEV_DEFERRED; sdev->state = DEV_PROBED; } return 0;