From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0044.outbound.protection.outlook.com [104.47.0.44]) by dpdk.org (Postfix) with ESMTP id 5C0211B40E for ; Wed, 31 Jan 2018 05:47:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VrzPsU4tpkWsCvdbOxytv8iN9j329rTxXeQwY/daC2E=; b=hO7/nFbIvJa7FSEzLFJrqNC7vfGCrSoR5qExkI499c1Omb62dGHbwlHqGwtdaFG+Bta5BqdlYApT92bX+31wAY3s1i1V2YTSKJzBDXzP0ll0DFnMFie9QgozEVt9MbwZgw76EOV2WSWJ7kOmXq4LRp9j7k/tadDWTC6qZQRDQAc= Received: from AM4PR08MB0913.eurprd08.prod.outlook.com (10.166.133.135) by AM4PR08MB2915.eurprd08.prod.outlook.com (10.171.191.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Wed, 31 Jan 2018 04:47:34 +0000 Received: from AM4PR08MB0913.eurprd08.prod.outlook.com ([fe80::d14a:1bed:ccbb:52a2]) by AM4PR08MB0913.eurprd08.prod.outlook.com ([fe80::d14a:1bed:ccbb:52a2%13]) with mapi id 15.20.0444.016; Wed, 31 Jan 2018 04:47:34 +0000 From: Phil Yang To: Pavan Nikhilesh , "thomas@monjalon.net" , "zhiyong.yang@intel.com" , "ferruh.yigit@intel.com" , "olivier.matz@6wind.com" , "pablo.de.lara.guarch@intel.com" CC: "dev@dpdk.org" , nd Thread-Topic: [dpdk-dev] [PATCH] lpm: fix allocation of an existing object Thread-Index: AQHTmfuC+zE/0wQMn0SQimleusFf/qONYnZg Date: Wed, 31 Jan 2018 04:47:34 +0000 Message-ID: References: <20180130185154.20095-1-pbhagavatula@caviumnetworks.com> In-Reply-To: <20180130185154.20095-1-pbhagavatula@caviumnetworks.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Phil.Yang@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM4PR08MB2915; 7:R0rDd3vR957cvI1FviaF1qxarn/GCFLhi58wx04XKjgvHAqVLx4c4SngwzoWO+mTizRwP9BNG1P/rnvhE9ZZhKTSKeiIBgRMRCpb1x6QXBd8Eg80LCyGPhUQH9JvPgteIlWmC4F9zfgQanMet7h9jatVnX5tEM7HHFIHRiXdjoBSYSJJbKB+fP41R6Yfg4ubjfnlFdfKOU49Q7Q6EgGLo6/ZskPt7nYrTw4Mm7YNCHBEDFEHkDB4qWi17gi1L61m x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: f1d0f7e4-1eec-42cc-83fd-08d56865bef8 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020); SRVR:AM4PR08MB2915; x-ms-traffictypediagnostic: AM4PR08MB2915: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231101)(2400082)(944501161)(93006095)(93001095)(6055026)(6041288)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:AM4PR08MB2915; BCL:0; PCL:0; RULEID:; SRVR:AM4PR08MB2915; x-forefront-prvs: 056929CBB8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(396003)(39380400002)(376002)(366004)(13464003)(199004)(189003)(26005)(7736002)(9686003)(53936002)(5660300001)(68736007)(99286004)(186003)(6506007)(106356001)(6116002)(2906002)(53546011)(3846002)(97736004)(14454004)(305945005)(2201001)(86362001)(8676002)(76176011)(7696005)(81156014)(72206003)(105586002)(478600001)(2501003)(3280700002)(74316002)(6436002)(6246003)(3660700001)(81166006)(8936002)(316002)(110136005)(33656002)(66066001)(55236004)(55016002)(4326008)(25786009)(2900100001)(54906003)(102836004)(229853002)(5250100002)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR08MB2915; H:AM4PR08MB0913.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: gZN5ylSC4XTSkgnZ+A4GmJtyaaOZPPlv1/gOU1EGKzTtgYGeYPx7MOo7+EpJYrEFwAFlFeuuNgzSSkWRE25/+g== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1d0f7e4-1eec-42cc-83fd-08d56865bef8 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2018 04:47:34.6486 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB2915 Subject: Re: [dpdk-dev] [PATCH] lpm: fix allocation of an existing object 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, 31 Jan 2018 04:47:36 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pavan Nikhilesh > Sent: Wednesday, January 31, 2018 2:52 AM > To: thomas@monjalon.net; zhiyong.yang@intel.com; ferruh.yigit@intel.com; > olivier.matz@6wind.com; pablo.de.lara.guarch@intel.com > Cc: dev@dpdk.org; Pavan Nikhilesh > Subject: [dpdk-dev] [PATCH] lpm: fix allocation of an existing object >=20 > Fix rte_lpm_create_*() functions to return NULL and set rte_errno to EEXI= ST > when lpm object name already exists. > This is the behavior described in the API documentation in the header fil= e. >=20 > Fixes: 134975073af3 ("lib: remove unnecessary pointer cast") >=20 > Signed-off-by: Pavan Nikhilesh Acked-by: Phil Yang > --- >=20 > This was already fixed in a previous patch by Olivier commit id > f82f705b635d31a63446a16bc4526dbebf293c5a. > But for some reason was undone in 134975073af3. > lpm6 is untouched. > Fixes currently broken 'func_reentrancy_autotest'. >=20 > lib/librte_lpm/rte_lpm.c | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index > d464dbda9..d00b13d93 100644 > --- a/lib/librte_lpm/rte_lpm.c > +++ b/lib/librte_lpm/rte_lpm.c > @@ -180,6 +180,7 @@ rte_lpm_create_v20(const char *name, int socket_id, > int max_rules, > } >=20 > if (te !=3D NULL) { > + lpm =3D NULL; > rte_errno =3D EEXIST; > goto exit; > } > @@ -256,6 +257,7 @@ rte_lpm_create_v1604(const char *name, int socket_id, > } >=20 > if (te !=3D NULL) { > + lpm =3D NULL; > rte_errno =3D EEXIST; > goto exit; > } > -- > 2.16.0