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 DA47FA2EFC for ; Tue, 15 Oct 2019 20:39:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9D6BC1ED29; Tue, 15 Oct 2019 20:39:44 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 65D711ED26 for ; Tue, 15 Oct 2019 20:39:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571164782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ivsE98jGbmM3ST8/669VOlG0f2sNq1a8HpYszsW83Do=; b=SCORhUUzvF1rABAka4m/Ze/PMYWCV7d5rr57woEr2skUoqstsc0P4/3CftpPYuMREIAf63 iOFf6Fb3Q7Hx4XkCv3B8LXTMlLFN4ZzMgKMXGPHBjh7GmBCLEPn1YdKcCnaD/XyChLR08f 0p+kh3dj8FCBNo8NK6SLJFh8oGklwjo= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-18-yYCln-CmPtepObburnYG1A-1; Tue, 15 Oct 2019 14:39:40 -0400 Received: by mail-vk1-f200.google.com with SMTP id q84so8593868vkb.12 for ; Tue, 15 Oct 2019 11:39:40 -0700 (PDT) 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=NNLAoHFMj0i4uIJWJARRVRb/dNOv07QUulhQJrNPJg4=; b=ew3dnOtDmToEfpOb/bu9Zo82i/sytkgSH1k6Is2xpIARxz5ntcr6l91b5dJSfokEKq 3SpkHOpa7fNCXukoYqt9/un3nokI0nBvOcDoOuwavhbG3kC5ZLnr5pYWLCwN5o6HgK0i F+JUbQFYVQUxGU+YpKU8GvaW9o1DlIWeOLIMkfk0Dq+FSiC4iZgbydrKjyTVENPSmZur z0Of1X0pElx3Y6s3iMW4Vrip3MOYBse8APD37ftBdQ9VaISz6LtSS0utPoHHDdLI1+GF rq5UgYnrei9M/O7V4tYmEPq86AXq7bTluYWRfkWR96b8DMl1+DfKiukDx0fShG9FUrH3 XxuA== X-Gm-Message-State: APjAAAUjs9P1q2jrQofYzfBsVjweN7RPeFFskhHHRSghvPqZx2XrCHmF FeqvUCYQzxMnLVnpEDtBKLGC4Mg/nhwGGd87KGZhNWXVAey8kUEVWn9CljV2ZPZ9PCQfqsoLRZw NqcTptS3w8v4jJbsiEb4= X-Received: by 2002:ab0:5968:: with SMTP id o37mr16765520uad.53.1571164780241; Tue, 15 Oct 2019 11:39:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1WOjK/z1NzhcwH+zM7oBpYzyoMuTORd5JTBTLgWVRBPnTHMwwid2xJDO3yJaB318yln6BLkMeg//+3hOvcCg= X-Received: by 2002:ab0:5968:: with SMTP id o37mr16765513uad.53.1571164779906; Tue, 15 Oct 2019 11:39:39 -0700 (PDT) MIME-Version: 1.0 References: <1566110854-2669-1-git-send-email-arnon@qwilt.com> <1566223064-19932-1-git-send-email-arnon@qwilt.com> In-Reply-To: From: David Marchand Date: Tue, 15 Oct 2019 20:39:28 +0200 Message-ID: To: Arnon Warshavsky Cc: dev , "Mcnamara, John" X-MC-Unique: yYCln-CmPtepObburnYG1A-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH v2] eal: unmap undesired address upon config reattach failure 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 Mon, Aug 19, 2019 at 5:29 PM David Marchand wrote: > > On Mon, Aug 19, 2019 at 3:58 PM Arnon Warshavsky wrote: > > > > Have rte_eal_config_reattach clean up the mapped address > > which is a valid address but not the one intended. > > > > Coverity issue: 343439 > > Fixes: 4e8854ae89fa ("eal: do not panic on shared memory init") > > Fixes: b149a7064261 ("eal/freebsd: add config reattach in secondary") Fixed this title. > > Signed-off-by: Arnon Warshavsky > > --- > > > > -v2 added fixes messages and applied also to freebsd > > > > lib/librte_eal/freebsd/eal/eal.c | 1 + > > lib/librte_eal/linux/eal/eal.c | 1 + > > 2 files changed, 2 insertions(+) > > > > diff --git a/lib/librte_eal/freebsd/eal/eal.c b/lib/librte_eal/freebsd/= eal/eal.c > > index d53f0fe..963db76 100644 > > --- a/lib/librte_eal/freebsd/eal/eal.c > > +++ b/lib/librte_eal/freebsd/eal/eal.c > > @@ -341,6 +341,7 @@ enum rte_iova_mode > > /* errno is stale, don't use */ > > RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config at= [%p], got [%p]\n", > > rte_mem_cfg_addr, mem_config); > > + munmap(mem_config, sizeof(struct rte_mem_config)); > > return -1; > > } > > > > diff --git a/lib/librte_eal/linux/eal/eal.c b/lib/librte_eal/linux/eal/= eal.c > > index 946222c..fac69b9 100644 > > --- a/lib/librte_eal/linux/eal/eal.c > > +++ b/lib/librte_eal/linux/eal/eal.c > > @@ -438,6 +438,7 @@ enum rte_iova_mode > > RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_c= onfig at [%p], got [%p]" > > " - please use '--base-virtaddr' option= \n", > > rte_mem_cfg_addr, mem_config); > > + munmap(mem_config, sizeof(struct rte_mem_config= )); > > return -1; > > } > > RTE_LOG(ERR, EAL, "Cannot mmap memory for rte_config! e= rror %i (%s)\n", > > -- > > 1.8.3.1 > > > > Thanks Arnon. > Reviewed-by: David Marchand Applied, thanks. -- David Marchand