From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0089.outbound.protection.outlook.com [104.47.40.89]) by dpdk.org (Postfix) with ESMTP id 7F7F71B6F1 for ; Tue, 30 Jan 2018 19:52:37 +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; bh=lxAIKzcMpco3bQJfWi5S5LKCmnp5uRt7p9QxkjDpFwc=; b=jNGjrZvQqBbolwy0RkWOB8hxY5o5I7g0MzDzDiveCuxKIhiqQcI/+GAtgIifk+gvvP2WwGCkQpMzcqiLw1N3H03ip7CvFPAKxuiEuSQNaNxqcyv5SFoTFzK7dZgdWLN3+4EqYiK6A2hrnCKRNFhZuJ2JrSmDAZOKPX7rla7QnQ8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Tue, 30 Jan 2018 18:52:32 +0000 From: Pavan Nikhilesh 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 Date: Wed, 31 Jan 2018 00:21:54 +0530 Message-Id: <20180130185154.20095-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MAXPR0101CA0047.INDPRD01.PROD.OUTLOOK.COM (10.174.62.161) To DM5PR07MB3466.namprd07.prod.outlook.com (10.164.153.21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b9f0b20b-db50-4998-6503-08d56812a0a3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:DM5PR07MB3466; X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 3:X+kDzGLjnhv3OrBIWsrjSSbvU8yWMOfdF9WPygImN3fOjCtAT3/MbI76K9vpQgvAT2KFPO8EEFKZveAPNgEl8rj8Zu7Kfl9FEB+7ookcHY+4M12FDkIaVTr0ZWJ9dsiqFiRYRJBSl+NdqiHs16gA2bo9uayERbxlcOTBXTeDe2RX7OP7ziTu6JoIbKev5oekLqsJ/3vVunv2RxWaHguvvYsQcB4dN5fdrNnJOXh84MYhGJdxO+AJ77ar0bUTC5Ry; 25:EW/cOPy43AYa2qvMpiWXPbQxXW7vGe7N+xij6kDhCNEa0vVDN4gN+bBQ/XmAn5F1fKaSvD2sLX7YvLj7f+eKYZRYP48wjHYGLWFYZd+QTCG1ysuJjYFwXgOlJdCYQqjNIMWjihk1sZrIkDRSRUkKcqcUdZ5bQCVWHhpTwE75GEg16EOCVdEcnkJDsab0db8WJ9nZCopDU0ES5/H+RMw6JnTMqRu2Kj7YCwLnPCqWPZSGe1rtUNEA12aZFa6M0gD6A9XkanhBSKFIcIvnpffrSZo6ZG52NPQ8FYhYb1qwmxfJjw+zT3adKU0iyWGj0BXQjPEDxVD/0YBtyBavdHgL3g==; 31:QeXMjtCZ+wwqpji1gX1ARI+t65TS+5inCXqGqXOwxX3NmFgDRMhB/1zJSr87irwEsvAw7o5nWMtaz+MvUepFld1JQrHongM3UpY74cl6yk9hcYEnWAUmI+SB56qHa5UWaj1g0nAX/AHVeoLImKrtwHYdJaJocFewi4w6l+dXEG2nWtEcf37tEyb7TvCARxCqxOjr5pCkoHwUaMVGgvnoGiG7jQorLVik34dTJPOlLPI= X-MS-TrafficTypeDiagnostic: DM5PR07MB3466: X-Microsoft-Exchange-Diagnostics: 1; DM5PR07MB3466; 20:JNd+eCDXP+JyZYyvCHuDRlSGWLs9fS9oL5Ccm5eZRdnPWmt5+F6mNS0hesA3yO4jDOlNcJg89nYfZk3a6ZwgJ1Oi6T8K3VyAAWG7xG/eRt/hPTBdmKCuFdqiLg0RDX9KZ1cIxRdKSveHxi4sSmz37Y0j77gQC4JuDZBdAY2ko565TFOJCS/+CfSzzFTtvVuPyAetZojkrkPeMU8XvHEm/D2yMW4Q+V5gXw9J7MYqrhfA6mKZNmfFzBUcn8ETF1nHhOLClnPDba8Jy62QXS5CtW+iq4RNu0V3uuV7BBLkU+/MNoTiQQft/TIe+R2wSO6I9RXC01mF6h00OPnl6lc5qvXNdUZiLuvIEcdzULaP1Eaj5Bx6ptmAsS7KEPIJ7vCohsii9L8P1Q+KXBRfYNBkBNIfM2NwWoofPuo1TxX0RxOvZS6GdMUotIs0chajMWOV9INsWA3fqHvdqrs74XNq0eWKn/kIlLw5StKP7Q5OIx9LzFx2lMxS4AdUsHlEB90XZ9CeZQwqmaY+5KSwDbkt6tDFO7lxz6sffEGkYFsZiP2iwky5V7obU4Bx341U0U5bFP2mvkPwuP2/FlCwCB72tyhX5qx177FWPDNHJY+LsmY=; 4:/aBQUYZIKu6fFFxbyWWh+r2V63rMm+i5EeULhvLW1XW5sMBMYx2U3Bw2VNUuHZR9w80F6lOvSxSZyy0fWAtcmgsGJ5rhIQV5RkVN6eZbJ7AjH3OCpNqmIoi8Hkeo3HudJw+uj2xuSjgtlUbhOPpw4zktoktc3wB0tnX6bFWqY2b9ngJwXTJe9vAfwezx7pimxemd5AIJhIhF5gOLqg8pg/qc+BHsF/xvFURCzrccIymQtG4CRfQmHMDlRWByoFgZb1O/JQKY2XLK6im1nk2ixA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(8121501046)(5005006)(93006095)(10201501046)(3002001)(3231101)(944501161)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:DM5PR07MB3466; BCL:0; PCL:0; RULEID:; SRVR:DM5PR07MB3466; X-Forefront-PRVS: 0568F32D91 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(376002)(39860400002)(39380400002)(366004)(346002)(199004)(189003)(6666003)(107886003)(47776003)(66066001)(4326008)(105586002)(42882006)(25786009)(2906002)(316002)(51416003)(52116002)(16526019)(6506007)(186003)(386003)(6116002)(478600001)(3846002)(97736004)(26005)(7736002)(68736007)(53936002)(81156014)(5009440100003)(8676002)(48376002)(305945005)(72206003)(36756003)(1076002)(5660300001)(16586007)(50226002)(81166006)(50466002)(6512007)(106356001)(6486002)(8936002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR07MB3466; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR07MB3466; 23:llxzJfNdPI2Q8Fyyt8D5c+2lmoWEIaEHX8Xb/oBXl?= =?us-ascii?Q?QSyUl7zRqR+CYb7WwPqNYmQfgnL+IrdSYu6ZuiBu3a7ThlNzQ6qJ8BT6yz4S?= =?us-ascii?Q?gof7y9x2dNQHkcBZzsvssdbneBN7rt5id+yhQHes3XBu1OEmRVl63OY5pPpp?= =?us-ascii?Q?ejqnG5UpcMTPbTQfKJtaNfvQOVHjeiu50+ld8Blhk4Ah/72NE3Gly8v9WwXA?= =?us-ascii?Q?ZmKIu1jsGpjWb11KjOuxdiPsw8JIO+uTt3ihQ7UtTX/nmsYnYfyYt2bs26f4?= =?us-ascii?Q?T1WrrGTFzfyjz6TBtf35Pl5z6Bg85vUFBYOsbykICaZk+R2h9+txBifUglie?= =?us-ascii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CJO8xhOWMPn0NcaWy3iNB/RA3o665qubB3qaQ5yGFs84DsdmUb0AvuG8FnQm/z6ecm5ppxsP1hmqMlb127p31ubybhC0TfThDm70WQgKFfrkH+e9ujjvJHWN/uFSmtvPssoEnUZ3A2AL3mnNPDFyeRQ+Q5BBE0/AyuJO7CmbhonE7w5cFGi1LMW2gx9mp8ZiXa1tSTeS0+aOx+J2TZ6g9LjLmQy6isu+U3M5/uBztsLFuQYVhCB5WdlOvi8OaefVJR9wIxeu7XvSY8mAYb+UbMwnxnJd/HiVeMAA7qRfP2DMX2DnA2hH9FSsg2UeyKh9522FytA6EXddORP452YmJQGodI6P7o=; 5:DgqjqPWr1a65hpX0C8WJf2My/4asSq7vm2IxzpB8r2EvGRjZsTBXZLxOciaDXIFwsE0NPeFmTL4Kr1N/V73fDs5JNEyjWAMa/a9M3SfK8uWsOmvX2k48ohMV+wdTjgfeejGeRBf6nE86jWuvfuNq4ibhl7gO7CLmVy4xUPjVWlw=; 24:gF+MTOatBVAxNMnQyGvFyjcOZz/ic5ZScn8PVJbPhTHp23Mp1XBzRgc8099fi+ifBifqCMuvp7lD6vbEcXCCZg03PasI59TpW0PO35YxAFM=; 7:r1NAuV+dGxo5r5XgsnOPVUqFsQeKDgRntHOjUzzGnpzLqHcK4tnJnPuzVshbIk9kRJuVXHkwJ8tg3VB+OcD3zqLuCvuuajhWCkSIohSNGuaVWtChm7TJRjn8McODoiwRQr3S01TyagQ9PO1V8WkDdhk22685jbC7wXyXcOw1WPjby+B9jgbLpKR6ztaGrQTQ0ZjR28efiIa8Gh6rqLkvRCY6Sm/u7z+cCTDIf/6egrm13pqqmZFYpSpZ5dubmK+m SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2018 18:52:32.0149 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b9f0b20b-db50-4998-6503-08d56812a0a3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3466 Subject: [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: Tue, 30 Jan 2018 18:52:38 -0000 Fix rte_lpm_create_*() functions to return NULL and set rte_errno to EEXIST when lpm object name already exists. This is the behavior described in the API documentation in the header file. Fixes: 134975073af3 ("lib: remove unnecessary pointer cast") Signed-off-by: Pavan Nikhilesh --- 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'. lib/librte_lpm/rte_lpm.c | 2 ++ 1 file changed, 2 insertions(+) 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, } if (te != NULL) { + lpm = NULL; rte_errno = EEXIST; goto exit; } @@ -256,6 +257,7 @@ rte_lpm_create_v1604(const char *name, int socket_id, } if (te != NULL) { + lpm = NULL; rte_errno = EEXIST; goto exit; } -- 2.16.0