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 E6D7DA0350; Tue, 30 Jun 2020 12:44:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3F17E1BEE3; Tue, 30 Jun 2020 12:44:30 +0200 (CEST) Received: from mail-il1-f193.google.com (mail-il1-f193.google.com [209.85.166.193]) by dpdk.org (Postfix) with ESMTP id AAC011BEDC; Tue, 30 Jun 2020 12:44:28 +0200 (CEST) Received: by mail-il1-f193.google.com with SMTP id w73so5400504ila.11; Tue, 30 Jun 2020 03:44:28 -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=PCaQkonaoQwyy29uAhrbpN814ySH/Li+p1sbAK8df7I=; b=Iopjjxg07F3zOsX6Y/Yd/iUaFBRuZ/1nz5J4ANtc0ZV39MXT7EVjZl2ZuLr8xVc2dQ rkk6flbvpPLoPOtFuPFd9Y7tPgaVNH2GGv2MqGyNM5sJqEItrOXzGMDnOhxwbSfTUdVT nKVmoVBaKQOguHQAhx7ogtPHAqGGC2yUkiqnUyjr6v5oe+h9F7c41HFF5v/m4yDCcCN+ jDo9qbI3MR3LFtxEoHhiSBBRj++onzVWnaVJIA5RF/Dn0YUbz7eku8fq6iEk2i+HfAca nTjxVzRD/o3H2k603frTpJpZ4WpT+oXkc05nxUnVs5c07bTa6i0ZS6e72nFCUeYS2dCv CPFA== 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=PCaQkonaoQwyy29uAhrbpN814ySH/Li+p1sbAK8df7I=; b=CSofohLH2A3BNbbTsN60tLLJlYJDaRokoAxP6BEEugjjHVXcEbU2IcjqWewxnaJYeK +aZLZ5yA/iinseLuz7lONa4ADQVPg6ZX7S8OXOAMW3dTIAb49VBtaItyaZ37Cq+D9pgg d9slDMUQnriYEZmuqWbKAlC5OYWTJcIOxQ5joG8LArqy8jcQrYKFydVRIGR+Af+x9br8 YkdU+c+8Gc80WbImJiL1jR/ZVCKy0pMG/xKQcASIO3uL8G9Z3nXAjAfRUZD3tJZuVK5U BKbdhFJcaC9sAc4NY7kiE+yCRRp3j8njQ/0EwvVmBnrOzOhV6294CZ06gWkp50fTJy8Q SkRA== X-Gm-Message-State: AOAM5338zKfbIjx4wpt3cybINY4efMZSpnyVP0Mif2kBfRjIPK7a+kCP TGHbbBOeSq/3IxFHEYcTCr7jW1kAjL48STM8qeA= X-Google-Smtp-Source: ABdhPJyipz+0ah7du0C+wcH8ekxdLkd0YsApsk0mRIZVgTOUpigroxxwi0Qx6tQhbiGGUALURZDoJ6PaOqL9CQx2Mu8= X-Received: by 2002:a92:d0a:: with SMTP id 10mr1973996iln.162.1593513863649; Tue, 30 Jun 2020 03:44:23 -0700 (PDT) MIME-Version: 1.0 References: <1593437165-18065-1-git-send-email-hkalra@marvell.com> In-Reply-To: <1593437165-18065-1-git-send-email-hkalra@marvell.com> From: Jerin Jacob Date: Tue, 30 Jun 2020 16:14:07 +0530 Message-ID: To: Harman Kalra , Thomas Monjalon Cc: Jerin Jacob , Nithin Dabilpuram , dpdk-dev , dpdk stable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] common/octeontx2: fix seg fault on running procinfo 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, Jun 29, 2020 at 6:56 PM Harman Kalra wrote: > > Segmentation fault has been observed while running procinfo > with reset options i.e. --stats-reset and --xstats-reset. > Reason is procinfo runs as a secondary process and tries to > hold a lock which is part of struct mdev, which was not > allocated as part of shared memory. > > Fixes: 5ca59711f771 ("common/octeontx2: add mailbox base support infra") > Cc: stable@dpdk.org > > Signed-off-by: Harman Kalra Acked-by: Jerin Jacob Delegated this patch to Thomas as it belongs to common/ > --- > *V2: Minor corrections in commit message. > > drivers/common/octeontx2/otx2_mbox.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/common/octeontx2/otx2_mbox.c b/drivers/common/octeontx2/otx2_mbox.c > index 2b7810929..6df1e8ea6 100644 > --- a/drivers/common/octeontx2/otx2_mbox.c > +++ b/drivers/common/octeontx2/otx2_mbox.c > @@ -9,6 +9,7 @@ > > #include > #include > +#include > > #include "otx2_mbox.h" > #include "otx2_dev.h" > @@ -36,7 +37,7 @@ otx2_mbox_fini(struct otx2_mbox *mbox) > { > mbox->reg_base = 0; > mbox->hwbase = 0; > - free(mbox->dev); > + rte_free(mbox->dev); > mbox->dev = NULL; > } > > @@ -128,7 +129,9 @@ otx2_mbox_init(struct otx2_mbox *mbox, uintptr_t hwbase, uintptr_t reg_base, > return -ENODEV; > } > > - mbox->dev = malloc(ndevs * sizeof(struct otx2_mbox_dev)); > + mbox->dev = rte_zmalloc("mbox dev", > + ndevs * sizeof(struct otx2_mbox_dev), > + OTX2_ALIGN); > if (!mbox->dev) { > otx2_mbox_fini(mbox); > return -ENOMEM; > -- > 2.18.0 >