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 7979DA04EF; Mon, 25 May 2020 10:51:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7AC921D5AB; Mon, 25 May 2020 10:51:32 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 48FD61C02E; Mon, 25 May 2020 10:51:30 +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 04P8pTfW032282; Mon, 25 May 2020 01:51:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : content-type : mime-version; s=pfpt0818; bh=5m8WPhTiV6Yxbh1YzugbGoYiZA9jhdnJcJM1jLWcCZ4=; b=DGapMUXx4KncPr29O+dTqCd1mSLDirB81b1rk5CfYHekeFrp13D0iMsMhdUn67OdNyQb reAwhdICnMkJQqzMvSx4Ls1AJRtR3Mz8RXjCnQO7xpsa9+N/eb/QzfpsQ0c6I39UNc8N Q+phiYcg46SgG1fRI4S/nGm/wLkB3vA1Estc4pPuS4V2iIn761bPeJIZv2ooRFvX/oql yFo0ntIVXwbW+5TFnogD1OPBrhkz+eRxkL+cGAscSdZMtbS49WDr59iTcBy4hYZiUREG 5OfvOaWy7sgd7vlve/yZd5O2+icT2b7NajzyQCiYzQBz+L9ZNbSs4SvoLsEQBSp8P+Fa vQ== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 31716qn0x9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 25 May 2020 01:51:29 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 25 May 2020 01:51:28 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 25 May 2020 01:51:27 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (104.47.45.52) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 25 May 2020 01:51:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TAJT0EecTaGkmzLR72mKKJ4gy9YTo682IsP47xzNiclfEFCWX56SURtVKUpC2q1sdD/CJ9JGlK3BMuo7wpN1nJZJ+8Kj6O21koqXlN77PeJgGBZzlqgX6prSe0MLv6GT8GZU4j2JLrzwarLx19tU9MiDMsd1ZJ9WPPN0JmuEoPAQcOT+RulHCdFU3X8CPPyLvs1sBcpZsOFo13mDPZbrJNQBMRP+TzN2/dRBshwaKeR8yK+XMHg5767AAV4MhY+Su3AOQWLFcOHThgrRbO8Kl6bqBSMNk4vcqrQfkvkpx9vro8YYqBQcsZLsqAHpUT/NqlE/gR/X1O0mWdGysvxgsQ== 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=5m8WPhTiV6Yxbh1YzugbGoYiZA9jhdnJcJM1jLWcCZ4=; b=HG6TdoajKNnMiunlKsZCnQM6WXYxzSOlakso4J25s3Llsg1bpCCsHm++JqkJl6FO7N3oGhQr5wXi7OI3cbqjiqkykoUUmLRyuGZ4v6xpj9lJkcrIokNBbeDYIFYGc7VAalSmqsABE3yn+1zxvsA5G20K1Lv0QdSIXenhfAeq+7g8KNh4pfbnZyEZanq45+RNUoQUpP+sZKKNb3X6Xd5h0FQ7+iSCni9sI2++U3vU1SBzu80OzJxX79n7uAx/btP/r1BMkwdBZ84GhQfgU5FST6smAsE3B23WbCGeD6vMcE1InpE8NviVCAR6HTU+Y9DlQpMxDjusAp288IeGtR4Kiw== 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=5m8WPhTiV6Yxbh1YzugbGoYiZA9jhdnJcJM1jLWcCZ4=; b=SVCtuKNgcs2XiQvu074vQ4B1Ky6QvtvZ6KxltMMztEQIqgiv1bkg+4cbMnowQ17O0XJ9Ahy/s8OD8BaJfMpEIwqbVLJ4HZWOAgEkdgx+W+avK3XS6lxw5AMM0SKMDwiqTh6sp08B1R1THii25u6X2eP1NLmVlZiulvOE+FVtumE= Received: from MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:38::19) by MN2PR18MB2973.namprd18.prod.outlook.com (2603:10b6:208:a5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23; Mon, 25 May 2020 08:51:26 +0000 Received: from MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::a8b1:45c4:b84:9c02]) by MN2PR18MB2848.namprd18.prod.outlook.com ([fe80::a8b1:45c4:b84:9c02%7]) with mapi id 15.20.3021.029; Mon, 25 May 2020 08:51:26 +0000 From: Harman Kalra To: Jerin Jacob , Nithin Dabilpuram CC: , Harman Kalra , Date: Mon, 25 May 2020 14:21:06 +0530 Message-ID: <1590396667-25632-1-git-send-email-hkalra@marvell.com> X-Mailer: git-send-email 2.7.4 Content-Type: text/plain X-ClientProxiedBy: BMXPR01CA0095.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::35) To MN2PR18MB2848.namprd18.prod.outlook.com (2603:10b6:208:38::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from hkarlara-OptiPlex-3046.marvell.com (115.113.156.2) by BMXPR01CA0095.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3021.23 via Frontend Transport; Mon, 25 May 2020 08:51:24 +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: 915a1fbe-b15c-4bf3-21d7-08d80088cee1 X-MS-TrafficTypeDiagnostic: MN2PR18MB2973: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-Forefront-PRVS: 0414DF926F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 50bW2ckJASuHHdIlv3RnCgFbQOz3eFTQQ8Z5iSCYt4Xtd7OWgDUh5T3CdfMyQxmGg80wPLLRtf4qY7XtXZY8dTKUF9AkXgdHZLxYFDGLrULDrDl2QNwiPXdZUWJiMSiMHrvY9vQPzk8ruV1vqFRuX5AF0S/XnA69Q904m1BUijuKhPeiRjhHzW4G8n77jq/FEPwbKyxZh84kCSv7oGMctflNsld8+MWfOHskZ+LQYV6L+0aEZV1TRRFPXQn4A6I3Tk3DplOYeCkNAN0eLuzSrZRBsFXvIrNk6PiPCNZElvCiEuWSHdc7ECOPZ5qTCgdoXponBbOeOsUVgXb30fO3uw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR18MB2848.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(366004)(376002)(39850400004)(346002)(136003)(36756003)(26005)(55236004)(86362001)(2906002)(450100002)(66556008)(66476007)(66946007)(52116002)(4326008)(7696005)(6636002)(8676002)(186003)(478600001)(2616005)(110136005)(956004)(16526019)(316002)(6666004)(6486002)(5660300002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: x0YOmeMonKjMtGvEfbYA/Uup9xwGjw/fdymplwSuerT3IS9octYdkcjVItipVOUipnyU1zcCv9m0gjcydX3LcrVo82p8KJtXxtljXQs+MgPci8fizWKIGcqOvldLjkU9TFNwPnwZi5oaQcALrklrLvIHl87Hx+7QL/11zqN357tfFNiIXuwLshFffRHN3rQOcH0VTI+dQiVam8ACYLVWjZyMCJ2e9bdcnSev0/NWC3OTKy6e7Bu+QGQbJMOaXw3u8+Af0uQ4p7Vr63z8YJe/PE0MBy3m4tRBqTTkxIwNZWTQ2L/n4nnP4fwJrTciEzbMn6aYpxxpybzzoCrAMLrrlctAEMhZUsf2kCyJfKg7N8k9qGedBO3P/fM5XyXSXeNTCitP4NB1IPQ5dqpcXyWxitWJb++ZusfVBZ/+Ya9vedcFcULm7hDm4qCZLwKez2vky8AqJRWcYWn3bdgtyFh7GpyctgE7fWIgAl0on2BAA0U= X-MS-Exchange-CrossTenant-Network-Message-Id: 915a1fbe-b15c-4bf3-21d7-08d80088cee1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2020 08:51:26.1307 (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: IxEoenFX/5pZ2LqPOCrx2qGUDTbZbfmOMOIp0pPb/2VGG6XUck7lpHThCTTvsY+g1pucwYlY38M8fVek+oAc/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR18MB2973 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-25_04:2020-05-22, 2020-05-25 signatures=0 Subject: [dpdk-dev] [PATCH] net/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 mememory. Fixes: 5ca59711f771 ("common/octeontx2: add mailbox base support infra") Cc: stable@dpdk.org Signed-off-by: Harman Kalra --- 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