From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from canpmsgout08.his.huawei.com (canpmsgout08.his.huawei.com [113.46.200.223]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94B9D3491DB for ; Fri, 3 Apr 2026 02:44:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=113.46.200.223 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775184290; cv=none; b=JlbCQx3lgqdBhwdzQGlKrHalMGVtiXOX37emoBYlqW6njmEG5cNcpqSI76nvQMNJoBRxWGAPOhAl3QlYo3FtajzZ3mLuoCZ5wZ7mVXMYGJ0doO/T2RSMnw7GTAyZbvednSfz35hq3eT7ZKAdPffq+lHMd5jQlIPAFQD2S2GJS6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775184290; c=relaxed/simple; bh=9CCRbmk6iLiOV6TDtF2e6elABY236tqjUVyFwDDe5Xo=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=GpijavXe/BAx58Flvr3e1T5B+S+YdatlmuEHKwquzCCj6Taqy2ty+4dqFiKMl02Iae5oZ+kL3XP1ei+lHiR9NUYv1T5bK64DjGol0pLkCc5KLcFLTrXkRCqF3D7m0ROnsXIXWjK/3LdWWMF/ECwUyM6BzAsayGTUeRRAcxQlQP8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b=5L1kSBS/; arc=none smtp.client-ip=113.46.200.223 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=huawei.com header.i=@huawei.com header.b="5L1kSBS/" dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=NIEPfSgO6NE4F/rCBAFm3maYZa1A5siWWeSJ+P/b3SE=; b=5L1kSBS/OB63VGYsrX3X30MQeYhY3uuBqNlNG87QIk1v/nEoE0OWxLRjzNnrG1xe5Sef7PpoJ vCFsbTsBUll7ensJpdr7UAtvrF9aGrpQ9tslYqHS8DlJMsTCKWyhVnGM5bnR/mgSwxIxNv/ROfA kwF+fq5j/kBX4mpCtuseefI= Received: from mail.maildlp.com (unknown [172.19.163.214]) by canpmsgout08.his.huawei.com (SkyGuard) with ESMTPS id 4fn2w139YzzmV6n; Fri, 3 Apr 2026 10:38:25 +0800 (CST) Received: from kwepemj200003.china.huawei.com (unknown [7.202.194.15]) by mail.maildlp.com (Postfix) with ESMTPS id B969D4056C; Fri, 3 Apr 2026 10:44:37 +0800 (CST) Received: from [10.67.120.170] (10.67.120.170) by kwepemj200003.china.huawei.com (7.202.194.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Fri, 3 Apr 2026 10:44:36 +0800 Message-ID: <7b2681c3-9ef7-4882-ba57-2503934e2759@huawei.com> Date: Fri, 3 Apr 2026 10:44:35 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [Question mpam mpam/snapshot+extras/v6.18-rc1] Question with Configuring iommu_group in 'task' To: Ben Horgan CC: , , , , , , , , , , , , , , , , , , , , , , , , Linuxarm References: <08aacacc-e3e5-4e97-858b-cbcbdb9a1fcf@arm.com> From: Qinxin Xia In-Reply-To: <08aacacc-e3e5-4e97-858b-cbcbdb9a1fcf@arm.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: kwepems200001.china.huawei.com (7.221.188.67) To kwepemj200003.china.huawei.com (7.202.194.15) On 2026/3/27 18:47:49, Ben Horgan wrote: > Hi Qinxin, > > On 3/27/26 10:21, Qinxin Xia wrote: >> >> Hello everyone! >> >> In earlier versions, mpam supports the configuration of iommu_groups. >> >>  823 static ssize_t rdtgroup_tasks_write(struct kernfs_open_file *of, >>  824                                     char *buf, size_t nbytes, >> loff_t off) >>  825 { >>  826         struct rdtgroup *rdtgrp; >>  827         int iommu_group_id; >>  828         bool is_iommu; >>  829         char *pid_str; >>  830         int ret = 0; >>  831         pid_t pid; >>  832 >>  833         rdtgrp = rdtgroup_kn_lock_live(of->kn); >>  834         if (!rdtgrp) { >>  835                 rdtgroup_kn_unlock(of->kn); >>  836                 return -ENOENT; >>  837         } >>  838         rdt_last_cmd_clear(); >>  839 >>  840         if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKED || >>  841             rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP) { >>  842                 ret = -EINVAL; >>  843                 rdt_last_cmd_puts("Pseudo-locking in progress\n"); >>  844                 goto unlock; >>  845         } >>  846 >>  847         while (buf && buf[0] != '\0' && buf[0] != '\n') { >>  848                 pid_str = strim(strsep(&buf, ",")); >>  849 >>  850                 is_iommu = string_is_iommu_group(pid_str, &iommu_group_id); >> >> What puzzles me is why we would put it under 'task'—this seems a little >>  strange to users.It seems they are not related.Why don't we add a new >> interface like 'iommu'? > > I think it is likely that this interface would change if upstream support is added. > I have done some work in this direction before, and I will release an RFC later for further discussion.:-) >> >>  851                 if (is_iommu) >>  852                         ret = rdtgroup_move_iommu(iommu_group_id, rdtgrp, of); >>  853                 else if (kstrtoint(pid_str, 0, &pid)) { >>  854                         rdt_last_cmd_printf("Task list parsing error pid %s\n", pid_str); >>  855                         ret = -EINVAL; >>  856                         break; >>  857                 } >>  858 >>  859                 if (pid < 0) { >>  860                         rdt_last_cmd_printf("Invalid pid %d\n", pid); >>  861                         ret = -EINVAL; >>  862                         break; >>  863                 } >>  864 >> >> In future glue versions, will you re-enable support for iommu_group, and >> if so, will the configuration scheme be changed? > > Please can you let us know about your usecase so that we can get more information to decide > what the best interface would be? > > Thanks, > > Ben > > > We want to use the iommu mpam to implement stream control for different PCIe devices. By limiting the access bandwidth of some PCIe devices, the high-priority service devices can obtain more resources. -- Thanks, Qinxin