From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720067.outbound.protection.outlook.com [40.107.72.67]) by dpdk.org (Postfix) with ESMTP id AFD9B1B11C; Fri, 2 Nov 2018 10:51:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U+D9Ofj7DEB61+uBGIi2d801sbvk7iAzFx3vyUAdXjs=; b=Z6qJ+aWjPUk3zXNhfeKw90FG+smFqDYkaS+cbVlqVKxQk5Mu+RPTYcg8BV6mu3gpe2k0czlrYfcW9ruwV78iURxTePCLEfxhvfEOhepe23+Ft0S7UalYukARfgcDkl11mRB15IcW3rknB1avBNyZ7dyW2Tz2ht9Y+myz6oA3Pag= Received: from BYAPR07MB4997.namprd07.prod.outlook.com (52.135.238.214) by BYAPR07MB5224.namprd07.prod.outlook.com (52.135.240.223) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.27; Fri, 2 Nov 2018 09:51:01 +0000 Received: from BYAPR07MB4997.namprd07.prod.outlook.com ([fe80::2d56:eab:242f:fdfc]) by BYAPR07MB4997.namprd07.prod.outlook.com ([fe80::2d56:eab:242f:fdfc%2]) with mapi id 15.20.1273.030; Fri, 2 Nov 2018 09:51:01 +0000 From: Jerin Jacob To: Ferruh Yigit CC: Bruce Richardson , "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] eal: fix API to get error string Thread-Index: AQHUcTWNU4juxDsXM0KZSomqKKn5TqU8QKaA Date: Fri, 2 Nov 2018 09:51:01 +0000 Message-ID: <20181102095046.GA32112@jerin> References: <20181031171928.61110-1-ferruh.yigit@intel.com> In-Reply-To: <20181031171928.61110-1-ferruh.yigit@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [115.113.156.3] x-clientproxiedby: BM1PR01CA0096.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00::12) To BYAPR07MB4997.namprd07.prod.outlook.com (2603:10b6:a03:5b::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR07MB5224; 6:TgjN/1ReX7vp3naf3WB4Pdl/QEb06fVj/WfA0wyuKu1/dpCAE8OfdiyzFDtxYT1r6owi0ne9PDTB2b1Y5z70P4QhKwk+WoS+GfC0RczKVoj8HnexKnxb++vNNEYu9awGgO9rfg6bsq7A632nf5ygvJMbfmmAKXsmetD+scVqdF6R0vdbalSBD2VUmwGOcvKOMSecLMHSEmubwd7BD8KXzqFAAyPZsypERnfxedeoR9HdXYqHhTlNMZRRUiROyS+zhNaWncJrLMTnOuyioQZ6E6Xf/QjzC5IXATVo8r2zL2F/ORPX++g2qYjOpjxcpySKbzD2/+v9ZFYV1gFLaBx3yWIdoMYlNy4GU4Iz/w5iJmMx57OSvJqwRpPfoZOW4dBCVr8UuIo1aZda/5xsn7P2sZNBF9mQ/1h01sFNcYwVXHKkSOqFJZNhDnKtZjjf5byJjPf+9wlQnEvjH01wQAr8uw==; 5:B8KITPp8EJMH3vnnEmaQHQ+beHP6Sga6m+vg2PzmMjJKfpz7lkigQTOH8/Y7FLtL0ZfzwSxxyOjyrNdc4Gm+QuYrWC94l0zQtLlO6yNheWfjMfU9Vtar5SbJ/LMIeQdgz/Gso1CTkCZe+jJdc5JeAgkVeJ6afEoQ5SkIKbuIUqI=; 7:Hij1MZbe43+Wmm7xcFq06k0Lp1cSAEqtaLFQ7QP4KJylNPSn0T6WEJyXakpaA3uIv+3AUoVjDxwv/xT8d+XPsBKMtjff/fKZ/PLhW+rCI7KZFwlJxx714kruKP+Xt6PldptWQ3hmfjD548J/6MCohQ== x-ms-office365-filtering-correlation-id: 56346577-f8d1-48b2-8ce1-08d640a8b222 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB5224; x-ms-traffictypediagnostic: BYAPR07MB5224: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(163750095850)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(4982022)(52105095)(93006095)(10201501046)(3002001)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:BYAPR07MB5224; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB5224; x-forefront-prvs: 08444C7C87 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(7916004)(376002)(346002)(136003)(366004)(39860400002)(396003)(189003)(199004)(13464003)(6306002)(575784001)(6512007)(14444005)(316002)(53936002)(256004)(6116002)(3846002)(66066001)(4326008)(476003)(6246003)(71200400001)(71190400001)(229853002)(486006)(1076002)(6486002)(9686003)(11346002)(54906003)(446003)(25786009)(42882007)(6436002)(8936002)(26005)(186003)(99286004)(33716001)(966005)(7736002)(81156014)(8676002)(6916009)(72206003)(305945005)(14454004)(5660300001)(81166006)(97736004)(2906002)(2900100001)(68736007)(106356001)(33656002)(33896004)(478600001)(76176011)(386003)(52116002)(105586002)(6506007)(102836004)(55236004)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB5224; H:BYAPR07MB4997.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: kOvwJmdeoizQks/kLDYJMIKzd+rtRMyiF9WziccrcVEuUaTXnsEpt603tN+kp0GcTR7S7XOINkgdC2FSml2W90FEEoVCKXrZskskoIqchHR9/cvXb03epbfzCyzHUWUGByMKM1g2z6W0lr7r/NzzEu1EQMKikmGv5Yk9LJ3mOeoQNU3+t1+1mKP3KDuAPRwzk0ceL/okM0m21KMurQp/2TyuuCa1EEPYtslHXb16hAd0SHM5Ha3SE3Hszhcf+WcVSmQbrfGuXPejDNssG5ytExSiNmpYGA5Ok8m/4AuvBj1PPTaF0nI3m40Iqkor6O5E31AAd7fqH8LUtQFXVqV+DbH03KKlZKW6znNOmIeVgT0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <93B80E7D299DEC48936185EDBA06E950@namprd07.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56346577-f8d1-48b2-8ce1-08d640a8b222 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Nov 2018 09:51:01.0702 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB5224 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] eal: fix API to get error string X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 09:51:07 -0000 -----Original Message----- > Date: Wed, 31 Oct 2018 17:19:28 +0000 > From: Ferruh Yigit > To: Bruce Richardson > CC: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org > Subject: [dpdk-dev] [PATCH] eal: fix API to get error string > X-Mailer: git-send-email 2.17.2 >=20 > External Email >=20 > rte_strerror uses strerror_r(), and strerror_r() has two version of it. > - XSI-compliant version, (_POSIX_C_SOURCE >=3D 200112L) && ! _GNU_SOURCE > - GNU-specific version >=20 > Those two has different return types, so the exiting return type check > is not correct for GNU-specific version. >=20 > And this is causing failure in errno_autotest unit test. >=20 > Adding different implementation for FreeBSD and Linux. >=20 > Fixes: 016c32bd3e3d ("eal: cleanup strerror function") > Cc: stable@dpdk.org >=20 > Signed-off-by: Ferruh Yigit > --- > lib/librte_eal/common/eal_common_errno.c | 8 ++++++++ > 1 file changed, 8 insertions(+) >=20 > diff --git a/lib/librte_eal/common/eal_common_errno.c b/lib/librte_eal/co= mmon/eal_common_errno.c > index 56b492f5f..fbbc71b0b 100644 > --- a/lib/librte_eal/common/eal_common_errno.c > +++ b/lib/librte_eal/common/eal_common_errno.c > @@ -38,9 +38,17 @@ rte_strerror(int errnum) > case E_RTE_NO_CONFIG: > return "Missing rte_config structure"; > default: > +#ifdef RTE_EXEC_ENV_BSDAPP > if (strerror_r(errnum, ret, RETVAL_SZ) !=3D 0) > snprintf(ret, RETVAL_SZ, "Unknown error%s= %d", > sep, errnum); > +#else > + /* > + * _GNU_SOURCE version, error string is not alway= s > + * strored in "ret" buffer, need to use return va= lue > + */ > + ret =3D strerror_r(errnum, ret, RETVAL_SZ); Probably this will fail in musl c version. https://git.musl-libc.org/cgit/musl/tree/src/string/strerror_r.c Another alternative of this patch. http://patches.dpdk.org/patch/47706/ > +#endif > } >=20 > return ret; > -- > 2.17.2 >=20