From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 27611A0540; Mon, 13 Jul 2020 15:08:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 36F751D603; Mon, 13 Jul 2020 15:08:29 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 8CE221D5F4 for ; Mon, 13 Jul 2020 15:08:27 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id z2so16476846wrp.2 for ; Mon, 13 Jul 2020 06:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=6jkXnWmCVDbsbsrdJ4HPJqMVRGLQIAR/dVqj21ndktg=; b=G3rIRL+wzpHgfRq+vzYhbWzO06KzjR1SMs7p48ctbRv65oXiP1iIVyfE9KUsl3YU/f yN+7RgELqFwtT0jOLA/yhb+0g3YZl6r/l/+/hrcx9XyVd7nQQQtxuBWIk7qOzMGrysIq X1VZ6feZ8Yq5OzD6JKr9bX0ijKpCga+YPhzV/rRWGcB9rPWB07+VuZuuuoxzbFfxIZu0 VRR6ubabhnW2YxQbsV6Nojeo4duLceU4RXPauAGr5ZvbiyksBY2ke4meiW32h2E+yx+h 4MYT/BmbbjbYDwkd33hxxgaVfipMkDQw64rBc+3VaDJvQPkFRjZzi62gcm0yQIHXjIU8 lcPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6jkXnWmCVDbsbsrdJ4HPJqMVRGLQIAR/dVqj21ndktg=; b=UXhaUnqrGc/r4QHiXBQK1C7OP/awtibdZ5MARF6bVUJY8Mb0TJbgRd5l7fa9YsN6Kg DQ0qExhAAmhmtxBW/x/NYZP9I5d57zz1k5zNiY27TJn5WYmCltTjlzatpr5XkdfsCZXi 8yDz9+z+8hRT+ag3eQcAFe2vJ5WhZe28POTwq8C7B0GDtGRlwNrwA1haPyI2hleObTWK E0IDQP8XckZCZvCNyt18sTAjS3CL62zAoapgJ4IOmVNoJ2msXtekmhWEhzpwWqxD7qGh PS3O5mDJgCI3hB51DguETsNCZgUTo2Fykx11rNWgTTKni/Uq07NdUqFnTARu2YaG4wjL lSoA== X-Gm-Message-State: AOAM533e/Ugi5Z2s8IHmLw7FPVTQ8JR/OqyeKaeMk1bua38PcZTD1JFr vpYEHo7JAc4w5EbVL56h97pR0pyEDsgalg== X-Google-Smtp-Source: ABdhPJwqIlvFdwxhxb8eGLDt+n2vIN0z7n41xH44FbgQCgihIb5/M4v1lCb8xJBKjpQ4cBHRulmsGw== X-Received: by 2002:a5d:4984:: with SMTP id r4mr77972574wrq.215.1594645707160; Mon, 13 Jul 2020 06:08:27 -0700 (PDT) Received: from localhost.localdomain ([39.40.22.210]) by smtp.gmail.com with ESMTPSA id i67sm22640114wma.12.2020.07.13.06.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 06:08:26 -0700 (PDT) From: Sarosh Arif To: jerinj@marvell.com, ndabilpuram@marvell.com Cc: dev@dpdk.org, Sarosh Arif Date: Mon, 13 Jul 2020 18:00:53 +0500 Message-Id: <20200713130053.31851-1-sarosh.arif@emumba.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] drivers/common/octeontx2: use generic memory management 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use generic memory management calls instead of Unix memory management calls for mempool. Signed-off-by: Sarosh Arif --- drivers/common/octeontx2/otx2_dev.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/common/octeontx2/otx2_dev.c b/drivers/common/octeontx2/otx2_dev.c index d61c712fa..06ff41b59 100644 --- a/drivers/common/octeontx2/otx2_dev.c +++ b/drivers/common/octeontx2/otx2_dev.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "otx2_dev.h" #include "otx2_mbox.h" @@ -34,10 +35,11 @@ mbox_mem_map(off_t off, size_t size) if (mem_fd < 0) goto error; - va = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, off); + va = rte_mem_map(NULL, size, RTE_PROT_READ | RTE_PROT_WRITE, + RTE_MAP_SHARED, mem_fd, off); close(mem_fd); - if (va == MAP_FAILED) + if (va == NULL) otx2_err("Failed to mmap sz=0x%zx, fd=%d, off=%jd", size, mem_fd, (intmax_t)off); error: @@ -48,7 +50,7 @@ static void mbox_mem_unmap(void *va, size_t size) { if (va) - munmap(va, size); + rte_mem_unmap(va, size); } static int -- 2.17.1