From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl0-f46.google.com (mail-pl0-f46.google.com [209.85.160.46]) by dpdk.org (Postfix) with ESMTP id E20CF1B03D for ; Tue, 19 Dec 2017 18:20:20 +0100 (CET) Received: by mail-pl0-f46.google.com with SMTP id i6so7363167plt.13 for ; Tue, 19 Dec 2017 09:20:20 -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=ZMFQxK8/RxG5E9zpUT3Yf9H4bWBcA4+89OHlgGwrzGY=; b=J4JcCOj4a3J7edbs3WfKGpSth4stBBXwSK9bkdK1iCK3w61T7jq6GpairCHPNLPiJ6 IsRu+Wlqycf7pF8j+3V64Iy2s/0KzygU6CSL/JwQ7ZZ9LKxP4KHW5MCZd5B7uKlm8qcX ZFWUIW0hHbuE9456RxCkgXkKCYQbOqpGHQyUgWPIFn8ie3kN+0mL7XoTPmD5e0VO2gJg 38XkbsgemBeJKD42U6v6bUYTxujUzINyCEsbouNuKp5VdGcr72bT4oRKNHXyiqFrJ5vW IQmtQe/j9fr8T7C3sz1/IUCZKT2tzs6TpnsRSRtAaQj8OPiUIUT2mKKy125k4RIY/Zln WR8Q== 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=ZMFQxK8/RxG5E9zpUT3Yf9H4bWBcA4+89OHlgGwrzGY=; b=E78x3Xxavc8IwoqYqnDwqUAfG5TSX1xXHAgOvgXhJ6R91c3iGA88CEraK5PdSPdGl5 EC93JWP+SYYtHuYrYoEXpRhxIg2nujzU4Q0tQaSJncr+KaoZB6k00ZXA0AR5+q/vTzoR d0V/QavTMqv53W/z2N4d8tcCfesv2BvpLQzBlnUbnDQpkL0B0SI8KRp5E8uN5Ap6WLcu Z2UjXiDp7OSmZMybWQH25vmSauHvhQYGo0TPcEyRPFwwWRquxZybb9GtibQ+n5IhkqC/ V9UtNQXZeTOy0N+9XJi90Xacq71aklnZDxQOiXRTGFFh43jh3jHjWtcP5waS4aRc+ZhP x9nQ== X-Gm-Message-State: AKGB3mLmU1TE12H3+aNDaI7qEYswZ+Q9acXDJqQHV49iMIUgbOYOetGQ YcIthHZwJA7TciwGbVWXNBn2zw== X-Google-Smtp-Source: ACJfBovQlPw6YkLn5lXxvuo/aq0EDrPhmxgZreq317jOLoGGYIi0IS1kITRhe20KyjC/ddYDGFhGkw== X-Received: by 10.159.233.135 with SMTP id bh7mr3956754plb.52.1513704020113; Tue, 19 Dec 2017 09:20:20 -0800 (PST) Received: from xeon-e3 (204-195-18-133.wavecable.com. [204.195.18.133]) by smtp.gmail.com with ESMTPSA id s189sm4133435pgc.78.2017.12.19.09.20.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Dec 2017 09:20:20 -0800 (PST) Date: Tue, 19 Dec 2017 09:20:17 -0800 From: Stephen Hemminger To: Matan Azrad Cc: Adrien Mazarguil , Thomas Monjalon , Gaetan Rivet , dev@dpdk.org Message-ID: <20171219092017.532d596f@xeon-e3> In-Reply-To: <1513703415-29145-2-git-send-email-matan@mellanox.com> References: <1513175370-16583-1-git-send-email-matan@mellanox.com> <1513703415-29145-1-git-send-email-matan@mellanox.com> <1513703415-29145-2-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 1/6] ethdev: add devop to check removal status 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: Tue, 19 Dec 2017 17:20:21 -0000 On Tue, 19 Dec 2017 17:10:10 +0000 Matan Azrad wrote: > int > +rte_eth_dev_is_removed(uint16_t port_id) > +{ > + struct rte_eth_dev *dev; > + int ret; > + > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0); > + > + dev = &rte_eth_devices[port_id]; > + > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->is_removed, 0); > + > + if (dev->state == RTE_ETH_DEV_REMOVED) > + return 1; > + > + ret = dev->dev_ops->is_removed(dev); > + if (ret != 0) > + dev->state = RTE_ETH_DEV_REMOVED; > + > + return ret; > +} > + This looks good. May be a candidate to use bool instead of int for return value?