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 2CB3CA0350; Mon, 29 Jun 2020 15:26:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 19E531BEC0; Mon, 29 Jun 2020 15:26:37 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 6B7C61BEB7; Mon, 29 Jun 2020 15:26:35 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05TDMKrQ015286; Mon, 29 Jun 2020 06:26:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : mime-version; s=pfpt0818; bh=mgUC0NO6rA6xZmhX7tXOH8tr62okK0icwUYjWSWZmZc=; b=HVuekB9OmduvietF1142CJf2Wlu945g3ofnVXZyLJTuRFyDN+uJJOtyrByK+SysuLruf AwbaJFj6xHvRB2G8wfnSYTq0oqZQC/fjuAe2aAHKWpnhp8YUPdpbi/vephI9twL1gy7R w9eJrSQd9Tz70PwzzQlS9bDwWcefwNzp/NjiJkU6OiGuxKJ9W++KwWthGq/G4AJe+ORt ELBBHJiZRup2U9jBxkO+lXryL7PPz6gTYMb5a1rdKGlaJc6NmXh/P3g6COa1ecVxLcuy Tk1Mk75WroANwiT6KJKiIwwf43/Xgpb4PGuyRRp8XcskMayPzvgru4OcLrvwG1rcA0GX Rg== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 31y0wrtx4w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 29 Jun 2020 06:26:34 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 29 Jun 2020 06:26:33 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.106) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 29 Jun 2020 06:26:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BZhIwLN1mDViWAJ+0WvINX6PsafNjJ5kJ2GkVbK/gLH6SzZB3fEhQKFoJjVNtEPjiRzvJByqI1g2uJDw2OikFSSSGU8DfeNMb+rKAG9amNN0tccJLqW83mFSQ5Db+MsHd4sA7GGM5OXZc5YAbm/uWwdOGy++X02KBQNOup69B/o8CjN+/uhGgaqkGZptjbpfSbn0bcvwplpeLpwhgfN8EiG0V+xIHb7n6aPHyCX3aippmpQWrdSt2U6fX2hYCWP1qNyUlJgUgK1YYOjN9Nb2ZrzZiOg0KQYulpyxjuGkPv8WCp8VUIJFkg+gbMAf2t5V7LjCZLE4cwtLB3WFECDAHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mgUC0NO6rA6xZmhX7tXOH8tr62okK0icwUYjWSWZmZc=; b=Bkr6S4p3/ZXZgjHVyWuheMmGbozkG2D1TvEX6EWU4bcpp8ULqNi1wRLOkdoRqm4++YDGK3XsMWoxB05PuJZySlD+ri9Ya612Xxmj+WUL1zyIxejJU+SEewCC8icvrmqUqcSPoti+W4tyOBbJbNCJHcF1ncImjO9pQLB/qcP5uH7CBYR7VLHfF+IBqev2bFmN06ldx8Z780S9wD0NbYYwzwergy8PfY567TGYBj8bxuqrAKeA+aW3poU9fwxFOdBgDP6se2IJb/GZ1RqOWWghj7KQKmaSkW8Fjkic6qEh1h4S1DtVcVIsVpQPAZhOB2ptsWVr4BPm7QUQ/7tocmfAvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mgUC0NO6rA6xZmhX7tXOH8tr62okK0icwUYjWSWZmZc=; b=CL+9T8ex23wV5Szw3+hv40adSocrtpJVb51/b/h8C6aWfJwgjSqxsHHtdVPb3hx0ZdtqCbxkf0EWUMiEY5DtDIBIV/8sF6SWrxdomymtYnjrXORfA9s5lvdgwAYL4/J10YUIbaan5pUNTsnJOuCFvZt/Kbe97q2/Rr25pzcy5ZM= Received: from MWHPR18MB1070.namprd18.prod.outlook.com (2603:10b6:300:a5::11) by MWHPR1801MB2079.namprd18.prod.outlook.com (2603:10b6:301:6b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.24; Mon, 29 Jun 2020 13:26:31 +0000 Received: from MWHPR18MB1070.namprd18.prod.outlook.com ([fe80::e895:bdac:e157:2ed2]) by MWHPR18MB1070.namprd18.prod.outlook.com ([fe80::e895:bdac:e157:2ed2%11]) with mapi id 15.20.3131.027; Mon, 29 Jun 2020 13:26:31 +0000 From: Harman Kalra To: Jerin Jacob , Nithin Dabilpuram CC: , Harman Kalra , Date: Mon, 29 Jun 2020 18:56:05 +0530 Message-ID: <1593437165-18065-1-git-send-email-hkalra@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Content-Type: text/plain X-ClientProxiedBy: BMXPR01CA0070.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:2c::34) To MWHPR18MB1070.namprd18.prod.outlook.com (2603:10b6:300:a5::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from hkarlara-OptiPlex-3046.marvell.com (115.113.156.2) by BMXPR01CA0070.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:2c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3131.21 via Frontend Transport; Mon, 29 Jun 2020 13:26:29 +0000 X-Mailer: git-send-email 2.7.4 X-Originating-IP: [115.113.156.2] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fd9a96fd-788a-4176-9841-08d81c300935 X-MS-TrafficTypeDiagnostic: MWHPR1801MB2079: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:506; X-Forefront-PRVS: 044968D9E1 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kwCNZ5jc3UnMMxOR23CzBXOLF2CL5+tOQ08owWv9NVjFkTQVJ4Pu998mRUHe+kWa6JcMwrRoCBk8tUUUC/AVc3uOiX+67y2ULyMau2LHbb80Ze55UNIlxcv8yTMiuC7Wpmu0wizZf0Mh+mQnXQrEiMAwgi//3XcuvF0Nzi4u1sBbTne6Brkid5+kznXbgVIlPTgXxJc6zRqsEujTyCKNXATkVwb8MrvVgqNInRngjHM8SfBq1dC/b/4v/H/rm6BFzHMDUNvvk/clb4DrCCv8hdUTmsh/oAzvvxLLUyMTKpIm44pT6Up50YCypCgkDLqO9kdjCvtIWn5nP53RYdUs6w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR18MB1070.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(396003)(376002)(39850400004)(366004)(346002)(450100002)(36756003)(52116002)(186003)(16526019)(55236004)(26005)(8676002)(4326008)(956004)(7696005)(478600001)(5660300002)(83380400001)(6666004)(316002)(110136005)(86362001)(6636002)(66946007)(2616005)(6486002)(8936002)(2906002)(66476007)(66556008); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Og6ji48k+LY/4+DPzOgp2KgdYdiubPYVX8ik8q+1aCOl6q4GNiai2IoDVIIS+Y3LbXC7EX1/5NPwjWcWTCYnFhZh+BbMSp+AEfPsnPoHG6K1njettf4FvOe+eS609QptiCquE6ttfYfCwg2d7lVSRAUV7LjtBIvvRLYplJA8fYhf+UyuBp8yMVcVxwZ8xlKjocm2gI3/DHIrl9/mU4f3rRTEuYPFftdoOeHhgxPJRq1jWi4rqpB4GSaiNMiIfKLK2aSjna26Mno6jEO1wRfGSx2V7nkeW5cAvLduXMPZWlwJ6IqB7JWxWzpgPImhWktOC9jAnen5hJLBaEt7KiHjJPMXmICnSr5Kbkw3F8XNuH2zF6zzU/9pb0Rslvd/glpdNqnwH0Bzixa48XNW8f5oTXWfTec1bcaqseP+K0lRT1jCaFM1IKzVOy75av6UBF50eHCNgMX8EfeJ4X5ohcNj+f+Z4qJCwU35Zolxt5gzR8s= X-MS-Exchange-CrossTenant-Network-Message-Id: fd9a96fd-788a-4176-9841-08d81c300935 X-MS-Exchange-CrossTenant-AuthSource: MWHPR18MB1070.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2020 13:26:31.4679 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tnDRK7pK9y57dOQHUwJVpYYDcqgr1HW6OjWh0D/PpqFUd6HL1pjpEYQ76faWB9Vv2CYt0C64Y1o8B8tPUYf5OQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1801MB2079 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-29_11:2020-06-29, 2020-06-29 signatures=0 Subject: [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" 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 --- *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