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 86CE745FD9 for ; Fri, 3 Jan 2025 20:03:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 79DBF40653; Fri, 3 Jan 2025 20:03:18 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11olkn2017.outbound.protection.outlook.com [40.92.19.17]) by mails.dpdk.org (Postfix) with ESMTP id 9F0E34021E for ; Fri, 3 Jan 2025 20:03:16 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=J5BUqYJ5MFbEIbZ2Bsd7c5+X8du+48KWDgbz+nWL73ANc9ygBuoWrskzHc+YVI40P9fjijSd2/Vp5FdRaM0t20oNIojYOjkL2PlbGSvN3BmFevnWtwArL/03X6djWtfs6I5XOGVyOxYSRhKJ/xK9nXOkwpTkFfvUlboVdmMjN4m/inR/zpuErXXVUgkju7+3irLErfr/liqbnp2GdH0cpXLpIS225Qkyi6vdD7NSSJK0D/cj6pYksp7c+uiMjwb0X+jWrCvbqYe3NQ0w+5FuPcnDVaWHyoT8JsezehXgIeXekimDAzDRzI5j3LTLNxQicXLH3XqapqzT6l8XFEGhQA== 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=/JsGKLN9i1hfXlNDICf2oUqI58S1deV54XKoLsNcvf4=; b=wJuMiKccNGfhdO7wIFJRaN5Zis3qlPG6C/1jkm1xpwF5u9kRkKQuyQsCbvT5yzoreyJuXN7eRPmh20mULDSYCNPfmXhf0g8aUl1ScBQZ3TyUhZwvp9/GxhL3hQp+BB5Qe6ehjA9gqY7uDAPbq3VzVswqjPxXTcTGTSMYFnYvWm+coKTyIG3UfD8CYyMGxupjs35eLQ4bW11MZQRH2MHC58H09afgBtDtfTol7EA2PJAIbUz6XQ5zs3AD9o4hvgeEqgWR0Ax4iuvepwCH9cwFV3MmFPUDCD1QUX9rYNq5jIXZBUYkEQ9YC4Q0FwVycramFB0efd2zP5cqPlDX3ump8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/JsGKLN9i1hfXlNDICf2oUqI58S1deV54XKoLsNcvf4=; b=vDQORHpxJZ/ufWnKJqbuSxGqb1xPI1FYHDxL7xnhaFAx8uU23T8VVkmlNuQPHDYgY/CPSbwYATiiGTQKCF5IDAjWU0+fC8lIT+VRt83NOKBADLUcfsRxDlD+RftqqconywPzye+EZ1QVd+4U6wVbfAVgfQVnihftCd9HfJiaVrgvmQoqHTOTRm0FN5dyZCpzJBTwFfRXjiiKn99HVxoM8aY2vDXjpcAoUsrfLdv9F/CZZym3EcgwIshaIfs2wUuB1NQ+gV6Qo4fm17hE37ybAnD9NPlQA19xws9iI1pVV51NCQ+C/r/pvLv5Be7YsMxMyr7LNWmvPhHIAZ0tVYLcuA== Received: from CH3PR06MB9411.namprd06.prod.outlook.com (2603:10b6:610:1a2::17) by BY5PR06MB6465.namprd06.prod.outlook.com (2603:10b6:a03:237::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.14; Fri, 3 Jan 2025 19:03:15 +0000 Received: from CH3PR06MB9411.namprd06.prod.outlook.com ([fe80::5e2:de8:6518:d615]) by CH3PR06MB9411.namprd06.prod.outlook.com ([fe80::5e2:de8:6518:d615%5]) with mapi id 15.20.8314.013; Fri, 3 Jan 2025 19:03:14 +0000 From: Alex K To: Stephen Hemminger , Dmitry Kozlyuk CC: "users@dpdk.org" , "Burakov, Anatoly" Subject: Re: Multiple Users Running DPDK Apps Thread-Topic: Multiple Users Running DPDK Apps Thread-Index: AQHbXU6fao0pCGPzkU2kcUFesjCd37MD9KqAgAAKtwCAAWmQ3w== Date: Fri, 3 Jan 2025 19:03:14 +0000 Message-ID: References: <20250102234813.32d75421@sovereign> <20250102132634.346f8a59@pi5> In-Reply-To: <20250102132634.346f8a59@pi5> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH3PR06MB9411:EE_|BY5PR06MB6465:EE_ x-ms-office365-filtering-correlation-id: 1c76abab-bb65-4d91-2835-08dd2c2946b1 x-microsoft-antispam: BCL:0; ARA:14566002|9400799030|8062599003|15080799006|7092599003|8060799006|19110799003|461199028|12050799009|15030799003|4302099013|10035399004|102099032|440099028|3412199025|1602099012; x-microsoft-antispam-message-info: =?us-ascii?Q?sMplyrocrbBPJ8iAW4f/+1fW7LK0/TneeU7UOM6jsjQL/rHm+OMnjdFKv63P?= =?us-ascii?Q?Z1gck+int9GjAr+sfIu68wkR/pVeJM3m0nwgib+UdqZ0FlXFReBWxwzACLHP?= =?us-ascii?Q?s7XsHJw2HWHEpUSK/bFzFgDPtSiBDv1nUZeBhDIWB7YX3/M7pGz1nRkCWUNq?= =?us-ascii?Q?JvYSZwjl+n8+UgymB0jeN1NfA/HdR0DExQbfUu2RYSRZ8z9p+Yz1/ZI4eIHT?= =?us-ascii?Q?gGfXGCWztlyeHeMLA9CSFuaDvY5Pu4ju8ps6fPibI3327/vIObsm0Ug/eccF?= =?us-ascii?Q?PPPmMUJQZYy0B50SV016p55TYm0t/anYXS3D7PDQd4EZsyyigovq7Uw4iLMr?= =?us-ascii?Q?zDmS+TzufWOD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?us-ascii?Q?8s3sjO1YbDtgTmlMNP2ZDFdXOgLrgnRFrw7V35DK0TjCoB3XdzueVpOqSSFf?= =?us-ascii?Q?PB0=3D?= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WV2bne5k/LGtumNNsTOH0YofHmQAdD7mQh/YLpe40E3nmNpBbaf6RL5pFOaI?= =?us-ascii?Q?bddCHdKmz30NTGUEsGAvALNasZqC1JFsyzuqoUKPWym1/TUN/DlKQ/08nToU?= =?us-ascii?Q?HLtoi4+6+GS+BCaZHYmjEMWWIHOcZ3OtJb8DoFrNw1mREpgcqSccF8o4EBiY?= =?us-ascii?Q?Us6eGcoyus2hI1xEFokfrRAskFz5GMJJLpKUcjqCcYvtTirbyAA1xo0WsVnX?= =?us-ascii?Q?XBgD4cMRsaS4Md2+2ee7esaBT9GTHSDfVD2G+nKR+OLICG0GOCTRj7iLrOYZ?= =?us-ascii?Q?5vZBMqw+uCp15sYPucRMzeZOFwzPvFSPUeBCKmNJY/uQ9OuNMfadRMWbhkaJ?= =?us-ascii?Q?EtvzBrZ5U+dZUEq1iuwiLX1MVdWEH2dVLnv2DMmCQVmw/o7bOBxQ4bcvChGN?= =?us-ascii?Q?d4uWpYIR+Au6DHVxQpTXoHt12P/IiaQ+ry0gtIaS5zN0UeHlwE+ZjedaLZT9?= =?us-ascii?Q?DKlZTglnudVvmFJm5QvjKcbL/bQUvc3gcH5KueDsdIHg2I0+3QoHPRmHd6ZM?= =?us-ascii?Q?kZ7hFIvL7I+FKJoGj+pQke93uz0Wxep/1pNhqYADubCJMO0cALOF8plQGqTJ?= =?us-ascii?Q?e0lxAHxKQTYKLwCbgYk4b+8tAM32+mVsiNcouJ7jSzauPCA2TlxWHrZRWp63?= =?us-ascii?Q?LBlWNRp4+GyAuDnk0qnUkWRpyVaMHeQQ+45gc4yO6KoF21f0LnSaEP7gfExK?= =?us-ascii?Q?bhi+sDXAxpEpYRI4ySCjNGFNRGfeCy6MCXoauIfF8ujeQ4AqPkKeZ6zM5COV?= =?us-ascii?Q?M6Ix1VV1g8AfzCDBOoit7hq9smFPdvXdpj+lZeG2JhCIDFlXByVo8NA/IMOW?= =?us-ascii?Q?lW7SkuExTt5XeQ0bApTDIkDbaLHXuMuzTupgzmIdQ5LW9NP2LtU947f/Kim5?= =?us-ascii?Q?p0mqf2CsOMVPNgYINw/Dn6THMnHgt4UzHCU+1zjmompXCJ8YVO/V/cciUvTJ?= =?us-ascii?Q?Ux7YV/UeNjfudwR62KH1QazY8K3ZP0hfKiC4G+fnHMYlqHxBp9IyHDBuK8M2?= =?us-ascii?Q?YJrByNZfaa/qP+wc/k1x0V49EaR3pYzvIyGlDmpuVZSz7s/DkIlxKDxeB26J?= =?us-ascii?Q?Q8y8vAAyQUeHnT92ZEyxVajnw9iVJ4eYSmoBxiRJIhIn10Y9v1HRnyF8mgwU?= =?us-ascii?Q?7GR144Og2ZZhMMOQzUVi0OmZP2Gq6g1QdcsF7hSPUBFm/87wZm4Vc9fJw+0K?= =?us-ascii?Q?KkbCuZ/liT0votQ+oXMdB1hhF6K+06fZsD7v7AddJUdEtMsOASR90HPRu/g?= =?us-ascii?Q?=3D?= Content-Type: multipart/alternative; boundary="_000_CH3PR06MB9411DF19BF1408C661019317DD152CH3PR06MB9411namp_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-7719-19-msonline-outlook-46441.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH3PR06MB9411.namprd06.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 1c76abab-bb65-4d91-2835-08dd2c2946b1 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2025 19:03:14.7658 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR06MB6465 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --_000_CH3PR06MB9411DF19BF1408C661019317DD152CH3PR06MB9411namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Setting the --file-prefix argument to be unique to each user seems to be wo= rking well for my use-case. Thanks for the suggestion! ________________________________ From: Stephen Hemminger Sent: Thursday, January 2, 2025 4:26 PM To: Dmitry Kozlyuk Cc: Alex K ; users@dpdk.org ; Burakov= , Anatoly Subject: Re: Multiple Users Running DPDK Apps On Thu, 2 Jan 2025 23:48:13 +0300 Dmitry Kozlyuk wrote: > 2025-01-02 19:44 (UTC+0000), Alex K: > > Should multiple users be able to take turns running DPDK apps on the sa= me system without using sudo? > > > > Hugepages setup is required for multi-process support. The usertools/dp= dk-hugepages.py script accepts user id and group id arguments when mounting= hugepages directory. And I was hoping that files created in this directory= would be created such that they would be accessible by the users in this s= ame group. However, I'm seeing that those created hugepages files get the 0= 600 permissions (read/write by the user only) and group ownership is not se= t to the group specified in the dpdk-hugepages.py script. So another user a= ttempting to run DPDK apps gets a Permission denied error attempting to acc= ess hugepages files. > > Is this a bug or by design? > > Should each user have a separate hugepages directory setup somehow? > > > > I'm using vfio-pci kernel module with IOMMU, DPDK 23.11.1 LTS on RHEL 9= . Seeing same behavior with 24.11.1 LTS. Tried to follow the instructions a= t: https://doc.dpdk.org/guides-23.11/linux_gsg/enable_func.html#running-dpd= k-applications-without-root-privileges > > > > Would like to understand if what I'm attempting is supported and if the= re's anything I'm missing. > > Thank you. > > Hi Alex, > > If you want to run independent applications as different users, > you can use a common directory but specify different --file-prefix > for each application (group of processes sharing hugepages). > > If you want to run different processes of one multi-process DPDK app as > different users, they must use the common directory, > so the current behavior with 0600 permissions is a blocker. > They are set intentionally: > http://git.dpdk.org/dpdk/commit/?id=3Dda5d107207910fc318862579e7b588481c7= 2c668 > Ownership is not controlled, so default open(2) semantics apply, > but there's still no way past the disabled group-writable bit. > If this is the case, I wonder why this is needed? > There isn't real privilege separation if processes share hugepages, > which particularly means that both processes have access to HW and DMA. DPDK really wants to run on isolated CPU's with multiple users, you may als= o run out available CPU's. --_000_CH3PR06MB9411DF19BF1408C661019317DD152CH3PR06MB9411namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Setting the --file-prefix argument = to be unique to each user seems to be working well for my use-case.
Thanks for the suggestion!

From: Stephen Hemminger <= ;stephen@networkplumber.org>
Sent: Thursday, January 2, 2025 4:26 PM
To: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Cc: Alex K <aiklimov@hotmail.com>; users@dpdk.org <users@dp= dk.org>; Burakov, Anatoly <anatoly.burakov@intel.com>
Subject: Re: Multiple Users Running DPDK Apps
 
On Thu, 2 Jan 2025 23:48:13 +0300
Dmitry Kozlyuk <dmitry.kozliuk@gmail.com> wrote:

> 2025-01-02 19:44 (UTC+0000), Alex K:
> > Should multiple users be able to take turns running DPDK apps on = the same system without using sudo?
> >
> > Hugepages setup is required for multi-process support. The userto= ols/dpdk-hugepages.py script accepts user id and group id arguments when mo= unting hugepages directory. And I was hoping that files created in this dir= ectory would be created such that they would be accessible by the users in this same group. However, I'm seeing t= hat those created hugepages files get the 0600 permissions (read/write by t= he user only) and group ownership is not set to the group specified in the = dpdk-hugepages.py script. So another user attempting to run DPDK apps gets a Permission denied error attempting= to access hugepages files.
> > Is this a bug or by design?
> > Should each user have a separate hugepages directory setup someho= w?
> >
> > I'm using vfio-pci kernel module with IOMMU, DPDK 23.11.1 LTS on = RHEL 9. Seeing same behavior with 24.11.1 LTS. Tried to follow the instruct= ions at: https://doc.dpdk.org/guides-23.11/linux_gsg/enable_func.html#running-dpdk-a= pplications-without-root-privileges
> >
> > Would like to understand if what I'm attempting is supported and = if there's anything I'm missing.
> > Thank you. 
>
> Hi Alex,
>
> If you want to run independent applications as different users,
> you can use a common directory but specify different --file-prefix
> for each application (group of processes sharing hugepages).
>
> If you want to run different processes of one multi-process DPDK app a= s
> different users, they must use the common directory,
> so the current behavior with 0600 permissions is a blocker.
> They are set intentionally:
> http://git.dpdk.org/dpdk/commit/?id=3Dda5d107207910fc318862579e7b588481c72c= 668
> Ownership is not controlled, so default open(2) semantics apply,
> but there's still no way past the disabled group-writable bit.
> If this is the case, I wonder why this is needed?
> There isn't real privilege separation if processes share hugepages, > which particularly means that both processes have access to HW and DMA= .

DPDK really wants to run on isolated CPU's with multiple users, you may als= o
run out available CPU's.
--_000_CH3PR06MB9411DF19BF1408C661019317DD152CH3PR06MB9411namp_--