From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0057.outbound.protection.outlook.com [104.47.32.57]) by dpdk.org (Postfix) with ESMTP id 390431B689; Sun, 24 Dec 2017 13:49:19 +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=1yaASvkErjkxJqbsY8bwAtjl7IecltE/kUzvycdjB2o=; b=daacBd9HnjI1G6TE55zLEalPXtKynr9sW/eO0gR4VcM/+dNc8L/JvJ1lDB8/CJ9xON2cZ3Upx8QZNM3m2uAKJzaFEAhHkMf+bj1qOeDXB19OqfPymfIkCo06PABYt/m5gWt15oq7H3u+V2XNyUosTynstHC9c/CtN6rqRpjtI9Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (103.16.71.47) by MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Sun, 24 Dec 2017 12:49:15 +0000 From: Pavan Nikhilesh To: santosh.shukla@caviumnetworks.com, olivier.matz@6wind.com Cc: dev@dpdk.org, Pavan Nikhilesh , stable@dpdk.org Date: Sun, 24 Dec 2017 18:17:55 +0530 Message-Id: <20171224124756.12160-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171215160031.11354-1-pbhagavatula@caviumnetworks.com> References: <20171215160031.11354-1-pbhagavatula@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [103.16.71.47] X-ClientProxiedBy: SG2PR04CA0127.apcprd04.prod.outlook.com (10.170.139.11) To MWHPR07MB3469.namprd07.prod.outlook.com (10.164.192.20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82b45905-8985-43d4-6b9a-08d54accbe9f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:MWHPR07MB3469; X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 3:z9ZoNZLzfuIitiuoQKaQfBvipTkNAqOTElpjYifrS897wS89lh2cibgkPOGO9oK1sSnUUoxnEjGjE/YwIOs12swjyPpF0FxNopkSwDPcn9M5hMCd5Torqued2Tanh30lsPMgz8FpumJOUwfa1cGOQO6i4kTgDsgOZvTfwlWwrtBV0lJqMUNnmbt3RKOXpr2dpxgXgdDk8K3qsXUTs80xCE+/1lZ8TyZOw9CRiY2UUW0dxtQh7VqDO6i2CgilVo/d; 25:pjJdRci4dzh23wvI3ycHLOGnOCvIp2dcO31JnC5qzTR6dOVYobsTglrb+Gp4/u5lSrF44QXeCqDjJdY5Otm5/bxI1/MHMBk64RwrT5QBCeBasivfJ7MxE9Zz7mId2OjG+F4tJuX9y7DMmFfDN1vRUmIhkakhom6Hs1+mexrVtFCa8ADTos+upb3HWp9YgC7+TAtECF+TVFUlRWTSJxAIcZg8tLJSD7FljzKcFj4COrewzJ8TqNyDR6IJX/mz6RIOfhO83Djzf5NSH41xZGMYy+kXExnAHTU/DfFYX8eipaZ+3W8RL4ZonYKLoK8isaFzGcIsKohILxjK3QqsxoZosA==; 31:XQozbrSRKAzEaCQi6ooWveXXmGlgdRpfaR2JgouDUNAhnnM3eASKNz9GUFdiDTH+03kqK83deIeflgKtQPJcdt2OxzwDLp6Dl/ydDVHiFizQRchqaevZ4O2UJzTd7/Ud6GZgTKnDvGFFP2K7WCEOmJ+HMpIFjYXLyvVGbmyy7ucEmbHh/NLkJsA+FYNEaWAeKEqEUoMScub+rdsduf8qcmV8tn2W/LAjROF6zmo45cI= X-MS-TrafficTypeDiagnostic: MWHPR07MB3469: X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 20:pOa9hfVDWCWTaXO4BYsLJFECXX2ikmDKBkv3nrspfuWusq/Vc508OOYlcsD6FaIt1QBdQ9S/NjzEs/DerqnMzTkIBXUaQCdTGENNS8Jx/kTfiSlMTEvY1hCfXlp5RihURJURUOZc+vQxDRZmTp/AfvfdYyC0rfBIDuKphV5EG5xZNNKf0lTQvApzmo1eoO5LW2Iqk0JcxyRfv2v1I7vspn7QLuIjb/zlj4YWe6zkibF/kv59L12VncbAPxuOSYcNoIEn3Ycg6QMDj2V9IavaqJsiFRlao94+e7x5wuDbiOgPm6B1H/VrN2Jvq90dXWRVM3qEB3aRFE++HrzRW6RzIsIH59ntSXQBtKgXEsARFSFsDB+RdjcKe4aRkkg0498sLk/78MTtcrunPo3uZN1p5dR/CoelmkxVQjx5AYKvmg+BZTQSFp8/lfEF6mblQ4zBf59ugInv7FYgnpwTHZlqvWuNQMNd5hcP84D4scuDMf9qh0hlBzMWuwE7rXJFETjVgzvTKkTGCSmmxyznd/MeTk7I8CjTRn7WS6EqewRL6noR35Lm/2Y2kGA3rj/wtgNyvRdJl9bkb0uM6urwjBXrbUEg7WNoEqX1rJhdaW6XvRA=; 4:GrmzJ9gP8cf+ownplkYUu6aUMHvVVwjhVzqoEJcb5b3MnC8DTgJHLqbMhQGclSZt/tM4XZ/k4wNfKELsOemzx09e/BcdZ0kWMnmytyYEeplHkO/lO7ODurFXJZSZ1Z1Hzz5GjYj/Uv3t3yjpWHTU+/hwaGfrbCpW4gpf3WGVn3jdAcQFyTzkL31FRKVeUPcQ99IqqRe6yJUl5fIHRmPjx9dXxHFJdnKpm1PCAF2tM91GW/7/UE+JolbZJAV8ES6AClc8pJPYtmroxLnT4yB6SA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(3231023)(944501074)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:MWHPR07MB3469; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:MWHPR07MB3469; X-Forefront-PRVS: 05315CBE52 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(376002)(346002)(396003)(39850400004)(366004)(39380400002)(189003)(199004)(36756003)(48376002)(50466002)(4326008)(25786009)(6486002)(5660300001)(106356001)(105586002)(6512007)(50226002)(66066001)(16586007)(8936002)(316002)(386003)(6506007)(47776003)(16526018)(68736007)(97736004)(1076002)(305945005)(7736002)(81156014)(81166006)(76176011)(8676002)(52116002)(51416003)(2906002)(6666003)(3846002)(6116002)(478600001)(2950100002)(42882006)(72206003)(53936002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR07MB3469; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; MWHPR07MB3469; 23:/vbEDKFVIPANZLSmkeLKYBxesOoSwG/9ynT8v/UnO?= =?us-ascii?Q?5F6gO63mTOuq4/432Th2zy3jksd2LWq3kZJQAdgZDz16Qfnl4nsYHoxijFcl?= =?us-ascii?Q?iP+s9AV7wQaqoa41fS59+t4DyqFNDQh77S7NDrtqI5UNgUd9Oi+huAxSpdcv?= =?us-ascii?Q?ZptQqhq46DVkQAE0UKqyzDTtOwvDPzbZHIw7Hb7H5jdP+bg4eHYQaHDk8n7g?= =?us-ascii?Q?oyK7W0/Jlg5npWrcV/UNBEdb4MwTpReN1mXy/TnjfSCDMHiW7to9+5CZG9vD?= =?us-ascii?Q?iwMA56PtRGcgMq/Mynj4fyWtUpiRUBnZheNAVduyDKZKVWmMc3xtQjFJab0F?= =?us-ascii?Q?ilMj/eUVhvhAsu4rgmJxT/gQKp3dUye93tjToGnKNRicJFxRa+xmKEFhV8hA?= =?us-ascii?Q?HtGQtYcFnBK4zDPfXVjoe7Wdh3JDYOcc5hze9EuhPz5HbcHXvmVYVbcDXZTi?= =?us-ascii?Q?u88dFOOpbMpvVl2lusfclfisoDxXPo54GNdOEQmacNX/g5ztC+7L/i3gJMC0?= =?us-ascii?Q?vClb0Ng5QjvJh4EbbFvt4fuzsj/z466a4osW29cH/ubPnsSZWLY2rbRwXHso?= =?us-ascii?Q?2cgIfzj8FdN3Dki1JrFCMDroo7iM0c7jYB3osBdiehIh80aJVh2sJ2NI3ro1?= =?us-ascii?Q?X5Gxcx9J5ZvQ8yspwj6iz3dEDNed1MglZbuU0SPhCmrNSrolAVNiRoi8n2F9?= =?us-ascii?Q?bJ1nb6ZVa0WF4SJqFJea6GcRa4buRsPLTh87HlTetSrr42dS/voHtS3tRpc3?= =?us-ascii?Q?9MzqxXsTucSNFEsV2gP4KWmRl4T28pb8xbuMbPvFLbhZNplaoaQFThB4s0LD?= =?us-ascii?Q?ZVrvMeHSpxWgfPk+iJjJygFpACW1VZtvf2XdpeoRwENrbS9rV2cuKXDC4HQb?= =?us-ascii?Q?tVPqTFJmRtyiaXLMSgpYXRszthWRvfDCXa0DC5gygPubF/e49QVFr228GQkN?= =?us-ascii?Q?UdNUsElFvE9/Gv4SjRE/5BR5tdx7EB/pLXFUUPbPN8zYFL+sfdNz7FtAgV1o?= =?us-ascii?Q?5JloSHci/WBUqwxLPDOyf9LTxRDYh2aGiNNxJYRP1RZVMFTtzXvRdHLFG6nZ?= =?us-ascii?Q?MncPjlTyQqzthTaAx8FpQ6GxRV6dQ5mwXbjonMe732p2zl7xMegxZlIaZ0uM?= =?us-ascii?Q?KBIAEucObumd3xkU0WMiSJg3EYrEC0H?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR07MB3469; 6:5jC1osbXifTe5+fOxY6TzrVe7SGeTLeNEvPKhAY234htPbxMkvxg9o/gE2tNI6ws7XndDfSYcm26NYg2bsfVKQHmfbpzCTTGH4x70zEvJpgRXugeM0S2GstglMAyA5Wv/uDLzGprvfnoYjvGwIGT8F0FlCBTvKLH7YmkvRGVmMtBE4dJGuYMhTo2GL331uEdBakBCXkdS/eCl5Xo/ZNqXiPMoIDbtzhnZyH5H2kdT5qnvJ6TkOIzxf5QWyO87VCs5lODLj+Q9/1XrBInB2PqU77Gj89YZ0Ev1D/zFHC+4+s9l7MV1F5EAkk1SxiupY24k3xL2RzvXiaRtUMTtQcwQLdjYd/7ewYIawHYbq44D7U=; 5:Ti5foCt+NWyvpiZdsS1oMAQG/QrKAL6vMw4jl2ov8zQKERSCN0D6VMaOqCZphnsWkDkxuB2NWG36w1p+0hoPNXuXAahZ8mC2WdbZt82t/1YhvKrRAB8+PmvRTFkRvjoKmo3vYpijjuURBrZ2lxEqnZrH5395nM9nBXhCyQoZfZg=; 24:dAIrDMTRxsCKy5ifE0BDJPQ8y+mDQZyC3x29vyaLiOSMZ1IBwQun+QYV6p72liia7ftGcqELPRpX5MAm+HJlV0S0Zg8LdATyjw0UVrujFyE=; 7:Xye4OXQrdAem9NoR/OPldYh4JoRObfqsghOR4JoR6p6jZEn+/aVcr4MsGkApI6t0D6FP3g6cUiSKTDEgTal4buEn0NaJze2kzxUtWlhXnCHCDGoeIOv9SVAM+WIT+8Pa9lWhwRfqnM8yZy1jNThWgUQlVT6qp7vMlvtaPFRnKumOHumtHN5j7F5VVKR22DuCogZyKVmcyqvtQtHb21EjYFn65C5bLujKfQe4ZB/6wLXaDf+LFOhYo/8dq3P8M2fX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Dec 2017 12:49:15.8601 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 82b45905-8985-43d4-6b9a-08d54accbe9f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR07MB3469 Subject: [dpdk-dev] [PATCH v3 1/2] mempool: fix first memory area notification 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: Sun, 24 Dec 2017 12:49:20 -0000 Mempool creation needs to be completed first before notifying mempool to register the mempool area. Fixes: 12b8cc1a7e86 ("mempool: notify memory area to pool") Cc: stable@dpdk.org Signed-off-by: Pavan Nikhilesh Acked-by: Santosh Shukla --- v3 Changes: - Redo commit title as fix. v2 Changes: - Redo commit log. lib/librte_mempool/rte_mempool.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c index d50dba493..6d1702252 100644 --- a/lib/librte_mempool/rte_mempool.c +++ b/lib/librte_mempool/rte_mempool.c @@ -367,11 +367,6 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr, struct rte_mempool_memhdr *memhdr; int ret; - /* Notify memory area to mempool */ - ret = rte_mempool_ops_register_memory_area(mp, vaddr, iova, len); - if (ret != -ENOTSUP && ret < 0) - return ret; - /* create the internal ring if not already done */ if ((mp->flags & MEMPOOL_F_POOL_CREATED) == 0) { ret = rte_mempool_ops_alloc(mp); @@ -380,6 +375,11 @@ rte_mempool_populate_iova(struct rte_mempool *mp, char *vaddr, mp->flags |= MEMPOOL_F_POOL_CREATED; } + /* Notify memory area to mempool */ + ret = rte_mempool_ops_register_memory_area(mp, vaddr, iova, len); + if (ret != -ENOTSUP && ret < 0) + return ret; + /* mempool is already populated */ if (mp->populated_size >= mp->size) return -ENOSPC; -- 2.14.1