From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 16A7F2B94 for ; Wed, 7 Nov 2018 20:32:33 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id p6-v6so8307069pll.4 for ; Wed, 07 Nov 2018 11:32:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VAairX6sUC2A7hgU3Htu52oAHy8jwHgd1ZuentT3/A8=; b=BFiUIlVnBgDvwT6kdo+jK4MxTjM8dwWW5OjXgE/AwlMplAxeyk9liJqnel+qjqSfK5 tI60tB9Vw4rBRdaUtOVRgHhi2RSh9jpikJ35iQBcixtrTm6QaFAYi9+k/8RUe0tLgNgo 58FIQpbIyyoyvw6f+7CEja5mL5OHCFQskvpfvJbxLPMMIIyHH4Y7WJjDa64bYXXF3DuG 5Gs95UnK1cR3VOjDBnAtRRpVWJj1hI015tq2e5efBy8KCfR3qUJc71IlD+n6ieeMitYw 9xi2faunC6d+73irrSECory4R+HG1LrjwyDt4lD36BS9Qhxi8jzr2eRky8RwO40u/EPr ms4Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=VAairX6sUC2A7hgU3Htu52oAHy8jwHgd1ZuentT3/A8=; b=O6LK9lfH9wturUyRg6o7B5om+JCPmqC8YZJFTDwLpJLi7IJwP9WBnj7mf1hMWT10Si Lu9p4rPmBqWxUUPtT2qv2/ZIagfWgE77DL02aVhPeHUEuthV0e6ksDXm2HZYsvYWs3nz 6eM+x0AfzWCPqRb01HjSdoZE9ahRkJFjHEQd05TsGmAb+r/fGhWVhIpXd+Xj1ehD5BLY +e/aPJkJHthuRlxPHrU7EF4sEDrz0W60IA3kRKfKoa/uz+IfPL1+jlHfFPRvzUYegq8A Owd5K1ytd4ccyp4IsS/dB3E5nGa50tRPa9xZV1W5zElWLPj3QVt2Gca1HqGqjlAMHTBL pv0g== X-Gm-Message-State: AGRZ1gICLy0RsQVLGORRMNR0oc7KKnTjaS39tq7htBWU1T/8YKj6Q/+W Sj4ijayHnKDoacPK1DDrXzklkvc3eao= X-Google-Smtp-Source: AJdET5dbhXxgzmls0p2lFSuqMC7TaUHkH3dLuwoAKwgX29psEa4aKtubo0Vu4CPJaU7nCjJn8TJV6A== X-Received: by 2002:a17:902:104:: with SMTP id 4-v6mr1587344plb.184.1541619153037; Wed, 07 Nov 2018 11:32:33 -0800 (PST) Received: from shemminger-XPS-13-9360 ([2001:4898:80e8:f:d673:b177:5a01:34c3]) by smtp.gmail.com with ESMTPSA id d68-v6sm1512477pfa.80.2018.11.07.11.32.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Nov 2018 11:32:32 -0800 (PST) Date: Wed, 7 Nov 2018 11:32:29 -0800 From: Stephen Hemminger To: Jeff Guo Cc: ferruh.yigit@intel.com, konstantin.ananyev@intel.com, anatoly.burakov@intel.com, thomas@monjalon.net, bernard.iremonger@intel.com, dev@dpdk.org, helin.zhang@intel.com, gaetan.rivet@6wind.com, qi.z.zhang@intel.com, arybchenko@solarflare.com, bruce.richardson@intel.com, matan@mellanox.com, shaopeng.he@intel.com Message-ID: <20181107113229.664d0696@shemminger-XPS-13-9360> In-Reply-To: <1541583691-145432-2-git-send-email-jia.guo@intel.com> References: <1541583691-145432-1-git-send-email-jia.guo@intel.com> <1541583691-145432-2-git-send-email-jia.guo@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH 1/2] eal: expose device states in rte device 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, 07 Nov 2018 19:32:34 -0000 On Wed, 7 Nov 2018 17:41:30 +0800 Jeff Guo wrote: > Since the hotplug API and device event API have make public, so in order > to let applications or driver deal with device directly, it would be > helpful if the states of device could be exposed, especially for hotplug > process. >=20 > This patch will add some devices states in rte device structure > to recode the device's current status, such as =E2=80=9CRTE_DEV_UNUSED=E2= =80=9D, > =E2=80=9CRTE_DEV_ATTACHED=E2=80=9D and =E2=80=9CRTE_DEV_REMOVED=E2=80=9D. >=20 > Signed-off-by: Jeff Guo Looks good. I did spot a couple of minor nits you might want to address if resending this. > --- > lib/librte_eal/common/include/rte_dev.h | 13 +++++++++++++ > 1 file changed, 13 insertions(+) >=20 > diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/com= mon/include/rte_dev.h > index cd6c187..1bab0dd 100644 > --- a/lib/librte_eal/common/include/rte_dev.h > +++ b/lib/librte_eal/common/include/rte_dev.h > @@ -151,6 +151,18 @@ struct rte_driver { > #define RTE_DEV_NAME_MAX_LEN 64 > =20 > /** > + * Possible states of an rte devcie. > + */ s/devcie/device/ > +enum rte_dev_state { > + /** Device is unused before being hotplug add. */ > + RTE_DEV_UNUSED =3D 0, > + /** Device is attached when allocated in probing. */ > + RTE_DEV_ATTACHED, > + /** Device is in removed state when plug-out is detected. */ > + RTE_DEV_REMOVED, > +}; > + > +/** > * A structure describing a generic device. > */ > struct rte_device { > @@ -160,6 +172,7 @@ struct rte_device { > const struct rte_bus *bus; /**< Bus handle assigned on scan */ > int numa_node; /**< NUMA node connection */ > struct rte_devargs *devargs; /**< Arguments for latest probing */ > + enum rte_dev_state state; /**< Flag indicating the device state */ Why not align comment with other fields here? > }; > =20 > /**