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 A909E45B7C; Fri, 13 Dec 2024 10:25:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 44E5F402BB; Fri, 13 Dec 2024 10:25:11 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2069.outbound.protection.outlook.com [40.107.21.69]) by mails.dpdk.org (Postfix) with ESMTP id 405F340263 for ; Fri, 13 Dec 2024 10:25:09 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VckDRX9ebMa1ghTM1eyK3tRnXslPgUqf3JLj3HftFWq//SCvLvEeXjxzGJ9AtD5Qo7ilxoMh7e1BYFTelEv6SOEoN/zWQMwwd1+zpNyrNu6CTeIulw+sc8+wfGJaEqeLcS68KnXXdVjXsXb829WUf4oZfYh8QFFkTB43NG+p5ivV9fBLb0TRqwoFhjozs3UqUoQuwBAjPfsCaT2FyBgF/hSPsd79fheCqHO36pExSfb+4jL0cPXmsjiPl9YCOyShTzCOMUuSobD+gvHbUUwFdQty7V/R0/P/fZumga8BEGvYUATusszn0gtaztT4pMIrWTJ/zrIxyGDAjAXHfI6iUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=lahW9QSwG4rk7ZvgXUc3Ml4jJQXAfcXfNyRGhml5cj4=; b=P/t6BGZldh1NNKfgBDkxG4CJdwFA5ThOx7EKIYKVz/Jeh3JKEHjyJnyGc9/IresyABqYNvoYoz8I7Qj37yTZw/2YAhAAcCYFwqLOdGGiDRetp0h+RlZM28rQg7swX0rYSO5iTwzzMjXyvjdSIA3rUcs2aI3Lo1iYAe0AzmEOUZzaoYZexCNGCbeyCYnbUoysHIposWZUTTEO/YzEuFgjn7eGwA5NOqw/AShunZbxNBMFRAmmNx49/CwydBAVXTIspEiMfewYLlfCn3Bw53h8gILx4AWkpTWqUNQF4yw0VgR+PTcjBBOSC8GckzG4FxTnTkjYV7xw++nWngxSs/ZREg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia-sbell.com; dmarc=pass action=none header.from=nokia-sbell.com; dkim=pass header.d=nokia-sbell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia-sbell.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lahW9QSwG4rk7ZvgXUc3Ml4jJQXAfcXfNyRGhml5cj4=; b=pMt5gCganHYjZAHhA7+LlVJniBooy/two2V9md19gtd+4PElAkjQjZqc/W7JxQI2es+q4ceIXwDtxYJ0W2qNsmm8mG9RjAPh82tTGxY2CCHwIEF68xl4BjNIPfcS9kes67TcGlbmUHnH8cmzu8VRtihxg5dnVQf78WyJ9NJYA4i8gJPI5D2phF//TcLhySNon4l77lODBfplUx5EyRqkF4NfcryaKC3gpqzZo4v3JJbR3REPy9OllVqtpyElmtZaST1G6MOrFenrb242HVfSQI92gNCsY5CQWJ0weT+Uv3AnaANuoGrmQLeYAroBfFc5gaGQoLMQCGT0iqKS2OnhoA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia-sbell.com; Received: from VI1PR07MB9898.eurprd07.prod.outlook.com (2603:10a6:800:119::6) by DB9PR07MB9624.eurprd07.prod.outlook.com (2603:10a6:10:306::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15; Fri, 13 Dec 2024 09:25:06 +0000 Received: from VI1PR07MB9898.eurprd07.prod.outlook.com ([fe80::1928:4afb:4eee:1f21]) by VI1PR07MB9898.eurprd07.prod.outlook.com ([fe80::1928:4afb:4eee:1f21%7]) with mapi id 15.20.8251.008; Fri, 13 Dec 2024 09:25:06 +0000 From: Yang Ming To: Dariusz Sosnowski , Viacheslav Ovsiienko , Bing Zhao , Ori Kam , Suanming Mou , Matan Azrad Cc: dev@dpdk.org, Yang Ming Subject: [PATCH 1/2] net/mlx5: improve socket file path Date: Fri, 13 Dec 2024 17:24:42 +0800 Message-Id: <20241213092444.2987-1-ming.1.yang@nokia-sbell.com> X-Mailer: git-send-email 2.34.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0001.apcprd01.prod.exchangelabs.com (2603:1096:4:191::13) To VI1PR07MB9898.eurprd07.prod.outlook.com (2603:10a6:800:119::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR07MB9898:EE_|DB9PR07MB9624:EE_ X-MS-Office365-Filtering-Correlation-Id: 91a389fb-264a-4f00-c158-08dd1b58082e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?P2SXMoj5ujAz/fq4d+zjJhKJpAtPVtFnBOOPdcK8qPfYI5fV8Quq9z21hytv?= =?us-ascii?Q?eGi6u0as6g0l+B8xrqlj9NCHi6yZ7Y2GlH1P54S+fpANRwYGGQt7PQDHDM6H?= =?us-ascii?Q?egdpGKlT/bsEPhFk/fIJBcO0/VN/fu3YblJKxMRzA8fSIWNCG2bzQoMkNhxa?= =?us-ascii?Q?wPFJ19/34TqiMldl93ucN/MNzJ7JPdbVWgQ8Qs6TeF5zNCe5UV0yDFCHiDnH?= =?us-ascii?Q?OEs3ueTFJP9wIufeyKkbFyurdIYsGhM3chTC75GPIklQubE04AVAfCfH9U+I?= =?us-ascii?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1N+3Mmoic93GCAHg?= =?us-ascii?Q?ZOcO0I4sET9NI+samoCHsr4QWexCeDTf3PltnQhy3PS7vdDY7SN4aqufp7Pe?= =?us-ascii?Q?ABa67DnnQcYIoVhFJcWLbuftvj8iQqr1ThUwYbAlo4/a+QYz1f3uVYDGCcLX?= =?us-ascii?Q?34oWK4OOWAhA5PVCHhrUjBbJH5B9JwFcIrHkZWKjDowdx+Z/JtInjsyxLm4X?= =?us-ascii?Q?5PCBU4ufvh8V8n5GWHEob6S9HtvH?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR07MB9898.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GNYLUv0OdMJQ5Xa1weTeiad7M3uHa5MAXX+Nz3BnHspdha7KgS2Dcbio2NhT?= =?us-ascii?Q?irYIN+CBCOgipxr05CNiEsc4N6e6ps0htyKD2N0mky+5X1WCo7sVraugXJXZ?= =?us-ascii?Q?KxoHStq5gmjiWV7Jcgq0aCMiEsVPboZZ8Ib3C+c7v+XDRKU/K2f2Jp4TSqAh?= =?us-ascii?Q?8rzSYx0R8F13X7V5dMhd3i4sgXkAQKfb1dJoNZc8FTFbTjrFxviUGuv5rwmG?= =?us-ascii?Q?z3sR9vZacWei881D+/lrlLWXgSNJcKTMi0BnXvrt1GEmm18WFsWsjnUEgNpx?= =?us-ascii?Q?/Vz6QI72iWLp8cueTLoLz8QMgU8lE/RQaN4SIa7nL0vNODpUbzVXgH7lpoHF?= =?us-ascii?Q?Gh9lLesw752YsYLJnsm1yVq4GT7y+tWqW5yXAekt+THyk3gFqjJP9tllyuIg?= =?us-ascii?Q?dzWCadTWiJSQR3mgTym1Pq17JhWoxtKJofvRZrwU47DBt3W+a79knH2Va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4ZCGA1Butfsn+LDqn9OAoQaOl?= =?us-ascii?Q?ebtxz2AMK7FFDYOJ5pOsPqPvCY7Gfb0ax+6/e8zUjqH47hSoicTUZERWC/Gh?= =?us-ascii?Q?lolwacTfBLNMb300oI4zQIhtvOKiPVD/ZVRo163XsThcGu7rOsoazH1oHtUD?= =?us-ascii?Q?2SND50caNETcraGJnmcGHeO8mgCfNwWdT5tSKbLFRLM13Y++HSoz/1Ng1cpp?= =?us-ascii?Q?y3vRv+kKl2uuqX7AyM7Hx7XOG+GBBrqWL0/wS+/VqAqioWmZ2mCocyoMRqlq?= =?us-ascii?Q?Bg=3D=3D?= X-OriginatorOrg: nokia-sbell.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91a389fb-264a-4f00-c158-08dd1b58082e X-MS-Exchange-CrossTenant-AuthSource: VI1PR07MB9898.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2024 09:25:06.6188 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QWYHeURe2yaAmPYFkU+sY9AWG+YivkGDKwXKOOL4o1dHtKzBJVlob/W9xxLnzzuCz3N0duAZa1pryhyvwXnAGEJfBa4MQq2E+4q4ocP8X1A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB9624 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 1. /var/tmp is hard code which is not a good style 2. /var/tmp may be not allowed to be written via container's read only mode. Signed-off-by: Yang Ming --- drivers/net/mlx5/linux/mlx5_socket.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_socket.c b/drivers/net/mlx5/linux/mlx5_socket.c index 6ce0e59643..7fa6e5345c 100644 --- a/drivers/net/mlx5/linux/mlx5_socket.c +++ b/drivers/net/mlx5/linux/mlx5_socket.c @@ -20,7 +20,7 @@ /* PMD socket service for tools. */ -#define MLX5_SOCKET_PATH "/var/tmp/dpdk_net_mlx5_%d" +#define MLX5_SOCKET_FNAME "dpdk_net_mlx5" #define MLX5_ALL_PORT_IDS 0xffff int server_socket = -1; /* Unix socket for primary process. */ @@ -177,8 +177,8 @@ mlx5_pmd_socket_init(void) ret = fcntl(server_socket, F_SETFL, flags | O_NONBLOCK); if (ret < 0) goto close; - snprintf(sun.sun_path, sizeof(sun.sun_path), MLX5_SOCKET_PATH, - getpid()); + snprintf(sun.sun_path, sizeof(sun.sun_path), "%s/%s_%d", + rte_eal_get_runtime_dir(), MLX5_SOCKET_FNAME, getpid()); remove(sun.sun_path); ret = bind(server_socket, (const struct sockaddr *)&sun, sizeof(sun)); if (ret < 0) { @@ -223,6 +223,7 @@ mlx5_pmd_socket_uninit(void) mlx5_pmd_socket_handle, NULL); claim_zero(close(server_socket)); server_socket = -1; - MKSTR(path, MLX5_SOCKET_PATH, getpid()); + MKSTR(path, "%s/%s_%d", rte_eal_get_runtime_dir(), MLX5_SOCKET_FNAME, + getpid()); claim_zero(remove(path)); } -- 2.34.1