From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 126A7A0524; Tue, 1 Jun 2021 07:39:28 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E66CD40041; Tue, 1 Jun 2021 07:39:27 +0200 (CEST) Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by mails.dpdk.org (Postfix) with ESMTP id 3851540040 for ; Tue, 1 Jun 2021 07:39:26 +0200 (CEST) Received: by mail-pf1-f179.google.com with SMTP id x73so3312839pfc.8 for ; Mon, 31 May 2021 22:39:26 -0700 (PDT) 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=3FVBmkfYFb6s7+41TjPLmH/imq3QSFxGk93uq4D8r4w=; b=C1YihI1G0hSak/bPfBlusUUZklWds2wOh54pke6UDMjgpyytPUz2FXZwJ9aL381Glr fKQ7Ncb9eaefe98yWYGCwuAFMkIfCqXNt1p1cIgKUkZyVcW//WslzDZf3pxkYPtjp02y nev2Jj8CNhYlh6dJ7Hrj8DPjU0VjolskNFAiDRs4VeJRiz537jz/QiEjwZn/juMJbq+B S+UysMyqyJZdxbKfQ5RUUmkl8TWBCsHD/Qn8gktFCTxPAorDNVvPZ1n9acjo1ubgvjZg 0fcRiBvNDh94n9tuV+6vAFIOO2vlt2GgGkSJVLsWbXA84xhXmc+LZ/8VNAQwPDQ3h0xv BfsA== 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=3FVBmkfYFb6s7+41TjPLmH/imq3QSFxGk93uq4D8r4w=; b=i+c3zix2FNzeE/9bng+zZlNcIoKfeSwbmVaF/GvJlhOp9wgJFn0PLSVgEcvSocpPXw 1DBRRs1ItORgLagom29ny8SQ/R665QyKggPBcG24P0GkGQCTWPY0FcnLx0b10GGuJuNp D4ZNE+Fpwfn22ljUpu/keunb/Ow9fioOvvIQFuMtW4eeUIE2DNM1axpTcGbjWEuGUrdx N1U9UzBKqLeRY8wcmxM5dktvP+iN63o3RXPAKaonMgH8Eb1R+F5+Izpscf/AxST/Lg4K rk06ASxzJwUPfaTt0PdTqljtCKSxQpD5mnlGvELB6a6lXwFxLKjsTKN870ThPnbFEFx1 PVwg== X-Gm-Message-State: AOAM533OmR1dP6+WVPAsdyz2WlNYJQ/Zx9f64Tv+X0T8xRbF5wNPv+Fp jt8HlOtvsZZxf9XO9QmS3CZ8tg== X-Google-Smtp-Source: ABdhPJxvIBjMombUl2Y7DMM5YGEfYv9T3/OcnqecgPGnwgig673JqoVmPamfwadMU93AVlizciWAgw== X-Received: by 2002:a63:3fc6:: with SMTP id m189mr2235174pga.370.1622525965495; Mon, 31 May 2021 22:39:25 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id z7sm13113528pgr.28.2021.05.31.22.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 22:39:25 -0700 (PDT) Date: Mon, 31 May 2021 22:39:22 -0700 From: Stephen Hemminger To: Chenbo Xia Cc: dev@dpdk.org, thomas@monjalon.net, cunming.liang@intel.com, jingjing.wu@intel.com, anatoly.burakov@intel.com, ferruh.yigit@intel.com, mdr@ashroe.eu, nhorman@tuxdriver.com, bruce.richardson@intel.com, david.marchand@redhat.com, konstantin.ananyev@intel.com, Tiwei Bie Message-ID: <20210531223922.4fb5397c@hermes.local> In-Reply-To: <20210601030644.3318-5-chenbo.xia@intel.com> References: <20190715075214.16616-6-tiwei.bie@intel.com> <20210601030644.3318-1-chenbo.xia@intel.com> <20210601030644.3318-5-chenbo.xia@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC v3 4/6] eal: add a helper for reading string from sysfs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 1 Jun 2021 11:06:42 +0800 Chenbo Xia wrote: > > +int > +rte_eal_parse_sysfs_str(const char *filename, char *buf, unsigned long sz) > +{ > + FILE *f; > + > + f = fopen(filename, "r"); > + if (f == NULL) { > + RTE_LOG(ERR, EAL, "%s(): cannot open sysfs file %s\n", > + __func__, filename); Helpful to decode errno. RTE_LOG(ERR, EAL, "%s(): cannot open sysfs file %s:%s\n", __func__, filename, strerror(errno));