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 10013A04C0; Mon, 28 Sep 2020 08:09:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4F2CD1D5CF; Mon, 28 Sep 2020 08:09:06 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id 7867D1D5B9 for ; Mon, 28 Sep 2020 08:09:05 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id m17so9835740ioo.1 for ; Sun, 27 Sep 2020 23:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oQnHSiazKM/G88xcwdQpVnbevcZ5yFXF4LPgIf582gU=; b=YEuTlj0VYVp1WenQ59uA2KJJFpA25+twhuHNWMLVjxRXVaWdAXlhhbJA40+CToDt3p +c2uCfO2e/OO9xtMUnLLDCO7g6tdEPFUulJkeIAI1hGBat0hCOnwEw01sLZIYCEMDhuE 1hFLsXl4Q+V+ADEx1a5xP+MaeL+kfyNZZoOQfLxe5XcJMgJFUy0Mtmg0Iv74nYSiuZHN fiwQjYytiyegGPomItScXeGqmuEb8L40sHY5PBhRKK/RlLc3kdUSosbvgHC6qCJrIK1l PzTTVbKhSaU+SAN0R9vgYj1Fm9omoaihljeCE5NwaRoHdsDhfiHeajqoYLlmNSqWoGrP cHrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oQnHSiazKM/G88xcwdQpVnbevcZ5yFXF4LPgIf582gU=; b=m89Q2lsL10RjsceowzHkB4FaAdRgfi3sG23RlODqAt5IDBmGkjeNsbHGJpn0yWz7nu XssNsLNwOVGDXx0vwDNM92krtqqYn6cnEgVi/phpozUfYKyL9xqy2RqmF5S2BTw/Wb1S PbNR1inrDRdHPwoBiv9FCH9M0Z/mv+EGoRQ3otXwLb4tRfOqrwqdeE6r5nDJhYREpCrs F3a4FBg4SrxSVpWkR9MamHjIrcVL1pI8fHJQxnT2qgYoaChUY/PWBaYiIWNvHXw3RH0w xSUlmp8XqUI2vWlh5rAk6CaWtqXVdx+bd/FuXEGwJLmzx2tIDTeAP3NWTXf4uonr3N3K anPw== X-Gm-Message-State: AOAM533vPoMiE7EoZ0VvxnAO+2eYtGdmhTToiRrx9KbsUfOmAUITAeub PzVjTQj2bvv426AdRFwU7Gk+3I541vFWlKzQIr8= X-Google-Smtp-Source: ABdhPJwswNvBbuBMpJdxDe1douwm+vX/c6nP991WpmtS4yZmcWMvpn7MjOp53DzArOBmqVVSLqQg4U7E23B8YrcSvP4= X-Received: by 2002:a5d:8846:: with SMTP id t6mr6326066ios.123.1601273343839; Sun, 27 Sep 2020 23:09:03 -0700 (PDT) MIME-Version: 1.0 References: <20200713130053.31851-1-sarosh.arif@emumba.com> <20200924103932.3834392-1-sarosh.arif@emumba.com> In-Reply-To: <20200924103932.3834392-1-sarosh.arif@emumba.com> From: Jerin Jacob Date: Mon, 28 Sep 2020 11:38:47 +0530 Message-ID: To: Sarosh Arif Cc: Jerin Jacob , Nithin Dabilpuram , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] common/octeontx2: fix memory mapping API's usage 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" On Thu, Sep 24, 2020 at 4:10 PM Sarosh Arif wrote: > > replace mmap() with rte_mem_map() > and replace munmap() with rte_mem_unmap() > > Fixes: e1d9a02ad8f0 ("common/octeontx2: introduce common device class") > Signed-off-by: Sarosh Arif Updated the commit message to: < common/octeontx2: fix memory mapping API usage Replace mmap() and munmap() APIs with EAL abstraction for the same. Fixes: e1d9a02ad8f0 ("common/octeontx2: introduce common device class") Signed-off-by: Sarosh Arif > Acked-by: Jerin Jacob Applied to dpdk-next-net-mrvl/master. Thanks > --- > v2: > update description and commit message > --- > 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..6a84df234 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.25.1 >