From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5E16C43925; Mon, 22 Jan 2024 08:44:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26706402B8; Mon, 22 Jan 2024 08:44:50 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2086.outbound.protection.outlook.com [40.107.93.86]) by mails.dpdk.org (Postfix) with ESMTP id 217694028B; Mon, 22 Jan 2024 08:44:49 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DZyBG1eGvdNmM3fPKCabTdsEIzzdB6VjK1y8kjXtYRqnac8HWItfkbczH1vaGqc2X6h9WXZhRgCK+BuENqJT+USsoT0gh1zWtmYhwo9/sUwQGG4e8m+9gjKYKTRd7brQm3C+KVUxSePwIYbR1t+/fVsYfPc9XPRhDjauuz7FJJUv5FV2yLPtXbiR4HUaMykHsy+0ajW/u1ulNO+7XqOwiW2P7SSn4vqS+1bIM7MMKoA+P1GIA4wvW8bPF6aYJ9zH0IdPv0Q7jc4RiEg5mwqYEn5+EUtFx8bY/GxVmPUxxa+kXv85U7HkvMcfOJBXUkWnhMXWjQlDcbt27yxWvUIPhA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=S2aWGrfdvIjPHJXIFhy710E8OGaNuFCqkeG2kNqRRLc=; b=jlr7SxG7vKeBiVS6d3uL1D8It6y3b++scS81KStEwKmxaQe2jXKQELaKtdMHb9SUCJWI6N13IZOHDdFseGeCG/Au2f2u/BvrXGl0u1eU0QmIuZelHIXxi7roxVXNrIInNmGzg9rorjE1kTxNFJGx90c+cX+aahoweiBQiOhPotIHGfBL/5qFvNs8IpwdMEdIQxhz2w2XhlUH4U8YAP3UDkU9wVj0ASF6a7N92kgGyjpOzPC9fWj7KPso+WCcKhpnhRM3XOz1mafL0f/ulrtiqcfgnrrTw2wI1Iow72T+skcNn545wplzbk0+R4CTrSZ+r/eIGgLnMA8qZm05Ov0EHg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S2aWGrfdvIjPHJXIFhy710E8OGaNuFCqkeG2kNqRRLc=; b=RZ2SKcwd/hBqua3Ci4rknFul7mWz4Xpf0Wzsq3fsURxUrhBgqxABli7DEVcdMQCZPzNNEzuTJn2zrppvShc8ARKVaqocM+Hb/eoDRqZvbIsXwmI5x7F2ZwUllUIWhw0O4soW5WJIIZd9Vo+72Knt7iFTaTyBmT/kUZbMi/+XNuqBkEfs83BnyNQIDr3cLUcNTHmIDCMAw8cOYerxfTsD042udkI/clZOxglyrlizOG3UDrUdg8GynZaIDMYSl4+6uwDiWg4DLRDmdEBkI8E1j9DX0nQzIPsR5xOSUQOEyBNRohk0gcAZjEblU5+jwVgLN+5gUTfr6YFHOzjEeIRjZw== Received: from SJ0PR05CA0063.namprd05.prod.outlook.com (2603:10b6:a03:332::8) by CY5PR12MB6155.namprd12.prod.outlook.com (2603:10b6:930:25::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.32; Mon, 22 Jan 2024 07:44:47 +0000 Received: from MWH0EPF000971E4.namprd02.prod.outlook.com (2603:10b6:a03:332:cafe::41) by SJ0PR05CA0063.outlook.office365.com (2603:10b6:a03:332::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.14 via Frontend Transport; Mon, 22 Jan 2024 07:44:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by MWH0EPF000971E4.mail.protection.outlook.com (10.167.243.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.16 via Frontend Transport; Mon, 22 Jan 2024 07:44:46 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sun, 21 Jan 2024 23:44:24 -0800 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sun, 21 Jan 2024 23:44:21 -0800 From: Rongwei Liu To: , , , , , CC: , Anatoly Burakov Subject: [PATCH v1] net/mlx5: fix secondary process query stats segfault Date: Mon, 22 Jan 2024 09:44:05 +0200 Message-ID: <20240122074405.1391570-1-rongweil@nvidia.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWH0EPF000971E4:EE_|CY5PR12MB6155:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f7dbfcc-e22e-40f8-cdaa-08dc1b1e016a X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JensOkuBQm+e+VTRcy1Vhx97c1sEv++M/vFHzIfLPZTom58zvPsh1uzWHpmx3K6zkMacBHse/rmDVUKnFga6brxXLpSC4qPlR/8+BP/LpYqcM/Y/UpQyaNWvz1KB9xcnBhRVUgKLcvZts6dVvuhPYMtlevaKpeZ4TGF39BKjIsTZ6cWxhj+sHJVvZOEY6HcaWZRsS+vfwXjWHNVFvJJ5fM9D/C+9m2cwlpMjhzuWN3Q3D7KasDQE5x1AfM8fMIekAuoUB40Xes/Z8ikT1GfwQSlKtwxhcuoV966+WLPOQDoHgdLtspMGjIknYW5mIcutSssKW/bM3Av0JBbi8kalcr7Kdqun4QkvY7KnL/Ehb0/HIrwfeMb5Ox/H1kwD6XmciVtr0iYMNvxCOV0eLmDG7b60Q2nqQqNdlYnZNHdx/8EuKaJgVGiWVy3vHcPyLx8g4X+K4l038RT1+sUMT85X36WoilmMjJnnyYPvz9pF3TWaIQwirphy0pMAVyqcksxS74xxk86ghmo6NRJ2mLW/DfHcGxzpfEQXiaXrknGzzEUDBHO2Ur2JwpMrYIHC9hRWEHD87uBGvzVC+r3ohukB2uOTPtp+dw6F+1UZRSdtJP2k22K8eufnDEHFFwzielqw3L7jAVtZFfoHJADtW1ObL1e8MN16KmP8siYH2XVGI/rCZIxSTlzogwQ/libO044WXUh1/SiYlbibbnLnYgaggKUgdtKjaOr8MSsNhBOxhnyzGuTAePghwx72EjQZmYadZSyPtk9A8tJl8ilgcUKrTMNg3bDjvAfasaEpwqA7v70= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(396003)(376002)(346002)(136003)(230922051799003)(230173577357003)(230273577357003)(186009)(1800799012)(64100799003)(451199024)(82310400011)(40470700004)(36840700001)(46966006)(55016003)(40460700003)(40480700001)(7696005)(336012)(5660300002)(2906002)(16526019)(110136005)(70586007)(54906003)(70206006)(26005)(6286002)(6666004)(316002)(478600001)(4326008)(8676002)(8936002)(426003)(2616005)(1076003)(36860700001)(7636003)(82740400003)(356005)(83380400001)(47076005)(36756003)(86362001)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2024 07:44:46.5107 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f7dbfcc-e22e-40f8-cdaa-08dc1b1e016a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: MWH0EPF000971E4.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6155 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The "outer_of_buffer" counter is owned by the primary process devx object and it is pointer by pointer in mlx5_priv structure. Actually, there are 4 levels' pointers in this piece of code. The secondary process can't access this part directly since it belongs to another process' heap. Return ENOTSUP as workaround. Signed-off-by: Rongwei Liu Acked-by: Matan Azrad Fixes: 750e48c7d ("common/mlx5: add DevX commands for queue counters") Cc: matan@nvidia.com Cc: stable@dpdk.org --- drivers/net/mlx5/linux/mlx5_os.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 8682899735..dc854ebb64 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -3192,9 +3192,15 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name, if (priv->sh) { if (priv->q_counters != NULL && - strcmp(ctr_name, "out_of_buffer") == 0) + strcmp(ctr_name, "out_of_buffer") == 0) { + if (rte_eal_process_type() == RTE_PROC_SECONDARY) { + DRV_LOG(WARNING, "Devx out_of_buffer counter is not supported in the secondary process"); + rte_errno = ENOTSUP; + return 1; + } return mlx5_devx_cmd_queue_counter_query (priv->q_counters, 0, (uint32_t *)stat); + } MKSTR(path, "%s/ports/%d/hw_counters/%s", priv->sh->ibdev_path, priv->dev_port, -- 2.27.0