From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A8083C3DA4A for ; Mon, 5 Aug 2024 05:29:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A26110E023; Mon, 5 Aug 2024 05:29:48 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="QVi/Jb5G"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7C04210E023 for ; Mon, 5 Aug 2024 05:29:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1722835786; x=1754371786; h=message-id:date:subject:to:cc:references:from: in-reply-to:mime-version; bh=phImCi+n8+GKFluHGxA4Mq/ExtvmZZx/Mz0IvxHnJaY=; b=QVi/Jb5GEAf9H5eKUf2UIU1kUbteiphKZ3L36f0ihVyfP4oImLFdXA4N XyIARaevEU+ACJQZ76bjLihW+Tq1OQhPXJeamJUlv+XQY8T+VkuK5twiE GlXZZTfLuCOVExQrxiM48wH7bn7F+VQWApHdJa1AUyvdoLgzVly4EqvL/ RJPZlSp/CIWfv45HySO/k4joDStrKP1CFoTGHzOVVgWBpk2ZqwRRhOh8v 2nUIGuRqav3Is71J+NMZI4GcQhlNt0DzSCi4riMy0faydetQCpj23UnFM m75iIQlrKbJSlJlIc0dJzl1/1FriKSl9cKOUxke301Rvb3dV6XUHxUpeJ Q==; X-CSE-ConnectionGUID: fo10l0sgQ1+7+u5A/W3G8A== X-CSE-MsgGUID: o9zgvCoLThOv/q0lqfXQCA== X-IronPort-AV: E=McAfee;i="6700,10204,11154"; a="20917697" X-IronPort-AV: E=Sophos;i="6.09,263,1716274800"; d="scan'208,217";a="20917697" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Aug 2024 22:29:45 -0700 X-CSE-ConnectionGUID: VuaG3aTGSniG68yyhfwxPQ== X-CSE-MsgGUID: stR5t4SKS3ik6/eJ0MbE7w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,263,1716274800"; d="scan'208,217";a="55986376" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Aug 2024 22:29:45 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 4 Aug 2024 22:29:45 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Sun, 4 Aug 2024 22:29:45 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.44) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Sun, 4 Aug 2024 22:29:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mjJP/SnGRGEnSnx+ueofRc8zTtRdF8M8mMR4lT2c3qpoAAdmN7ZuziU3JhlEp5vo0fDl0FNLF7J2TQnVGumUyAlXF8kngVbQM+QNjp3arHop0BPTzKhytG68WEsxQBNHDtDvIGkbzvstqjj8D6Y1aGE7kez9D6sU1XdBGfVrOn0TQew1TMnxJjA5OcL0mx5da7pYjXStdXU/NxA/Pxc6NHEJr0TLkIUmUb4Ij+HtbB1QWS/92lGGOUQ0iXFtA+PC5dOLSBHFsc0uL1mm6VXXltJUhpfHpx7udtF0/QM2TP99KVCjXD67RIZkf6+v0F9lKSuketht3FXLT9U99KGrBQ== 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=SmsF0ajInunb5u2gGd6HekIVy11ghYl6uhHQpgIX1aU=; b=W+Wk2rFhuVLEmiZAQaJ5ZMpRkwcmSsLvGW6JNbvRI8s72445crNO6MJFHcnllgg/WuYClSuJUjBtiSuK3AXnTa7WQxf74ENci677Z4gbUht0ZkrX+6cHnKerwY2w96fCHc2DeN+Lo38HEi6q2U5ocFOxn6TDXlrRuPRfL+4UR3O0XDVQumBUXhueWqiGJ1WCkLfh2AcmkHf1CHqB57rmHT5eIcfL8dx8A/47iaIvMIHbw+Nmbuhsey0lk7OCJwIUNxz5yFe59bTzjksV7Ue1qZF7b0VoUHopCVBts1lBuM2Y0HaR4bbff42mJB7yxL6dX1NhT9gR+jqrjJ4f0OP0CQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5293.namprd11.prod.outlook.com (2603:10b6:5:390::20) by SJ0PR11MB4912.namprd11.prod.outlook.com (2603:10b6:a03:2ae::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 05:29:41 +0000 Received: from DM4PR11MB5293.namprd11.prod.outlook.com ([fe80::e1f5:3b23:9560:2dc2]) by DM4PR11MB5293.namprd11.prod.outlook.com ([fe80::e1f5:3b23:9560:2dc2%4]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024 05:29:40 +0000 Content-Type: multipart/alternative; boundary="------------5IXU0OLK600Hej2DPQdm60p0" Message-ID: <5b52d3a3-2c3d-4668-b9f0-f11b4bdceee2@intel.com> Date: Mon, 5 Aug 2024 10:59:32 +0530 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH i-g-t v3] tests/core_setmaster: Adjust loop control in tweak_perm To: Emil Velikov CC: , Himal Prasad Ghimiray References: <20240731082037.1069-1-krishnaiah.bommu@intel.com> Content-Language: en-US From: "Bommu, Krishnaiah" In-Reply-To: X-ClientProxiedBy: MA1P287CA0002.INDP287.PROD.OUTLOOK.COM (2603:1096:a00:35::22) To DM4PR11MB5293.namprd11.prod.outlook.com (2603:10b6:5:390::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB5293:EE_|SJ0PR11MB4912:EE_ X-MS-Office365-Filtering-Correlation-Id: da56e6f2-dd3e-4e29-d706-08dcb50f9aa1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?ZWplN3c4cDFsNnQ1OXNhUTVyZDlUK2t1bHRkdTd6aWJYcDJIaDlXZU9qdm9T?= =?utf-8?B?YXdpa28xUlhIb2NZREZTSS84a3N3SStzV2FkSkRzNzlXSlp5NVArZUFWVkZK?= =?utf-8?B?a3ZmeGR3d1FpcUJTMXNCNmhZeC9XNGJUTWNRRFJ3TVZ5N0wx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kw0ejM1a0dacXVneHRXZWpT?= =?utf-8?B?SHlnQzl3UURRSkRDSjNhalhXR3A1eG51ZlMyNHBESXhYUk9aSDVWT0dkL2N0?= =?utf-8?B?a09yQjJIaVpHUGZOSHlmbGRYaGZMVSsydDRkSzQ5QXpSZTdTbG0zeCtWeHVS?= =?utf-8?B?a3gwL1M2aVRwQXd3M2RqUldkRzRjRVZhU3JTcVJTYVhFUFhMa0VzYVhyYXZM?= =?utf-8?B?Q2VGTmwrY1dFbTFjU3FiYng5cE1NdUlqTmxnd2pOMHlqZFgzZ2dIVnZzMEJy?= =?utf-8?B?UEJHaFBuNTVsZDdvL2swUWt4T2htaW5zTWtTdTBBVVpvN1VueW5sdjJQS3lE?= =?utf-8?B?WnQ4NFFSY0NKQVA2UFczaFdPbktOTDdOUTN3ZGF0ZmphSGtHSGdDbWdQRStt?= =?utf-8?B?aFJ6dGV6YlE5dko2bXFyTytlbFgvS0VvNkZUZ3lHYkVVaEVHWnBVb1Z4NXY5?= =?utf-8?B?dmZtUk54a2RCbTVCMUQyOGVGZ3hoYTYxaU5FTTdWenlVd1AwSDk3QTFRTWRn?= =?utf-8?B?UFZQc1BRVlJhQnFENDV3YjdXMWJFQ3htSUtGRlBzSWtWdVVUcUNqeHhJcW9I?= =?utf-8?B?dU84ZVA3c0x6bWo1RENvNTZzY1JoMkN3amNCRllGRkV4UkZSc2FncThCZFJ0?= =?utf-8?B?VVRKWit5SndJLzMwbytoek12ZE5sTU82Ymo3M3JDSjNFWWhtM05acVdiN3dZ?= =?utf-8?B?Z1E0dU11Nk8vZFpaMm1PNWpwTHg3UmkrV3VJc2V1d29zVktUS1Zneit6VW9P?= =?utf-8?B?QURpNTUrbWo2UmVHaVJKdz09?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5293.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OU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XJDVXZtcUtheW45MUFMYitS?= =?utf-8?B?T2hMaGxzVkpaTEkwVE9EM2wwdnBkcmFFVllCcmptOE9ySUhjRTFkSGxhd3FD?= =?utf-8?B?UkQva0MrYzRTczRGTVU3eTM5TzFrZStHWk5xcEpRT09kOTlDQndaZmdWd1I2?= =?utf-8?B?WTRXMjlKSFdPQ2w1ZEpUTENPaktCcWlaNnR6djVNTUFBNnRrdWxXVmhQRVRC?= =?utf-8?B?b2xzNFBkRTdURERaLzJnNCtoeG5ERWFiWkowNkNRbmtJNDdJbC9PdUVpeWtr?= =?utf-8?B?ZDBsZktoZFp5TmJpU1BaNXZ6YWQ2RHRMRHA2dmQ4a2RaeVd0R3BLNUFnS1VJ?= =?utf-8?B?bjBkQndXdHpVRDJkRThLMjVtL2NIcUZ0Nzk1RnB0WDlPa1lYTlo0Vm1KcmZL?= =?utf-8?B?WXlYenE1VHpmNzBMT3hKNko2bTJ3bEFodDVCZ0xpVG9FVWVWNCtEOFpQRW1S?= =?utf-8?B?UUE9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: da56e6f2-dd3e-4e29-d706-08dcb50f9aa1 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5293.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 05:29:40.7490 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6wifh1MdYA6FHyYli5TwrpDliIQ1shJvKPksNZIEoiFEp2NiExxBeySW0dQRhUGj0B8FK7SNM103Wld2f3sAl/P0XWtTZAg8RCSWLILgoq8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4912 X-OriginatorOrg: intel.com X-BeenThere: igt-dev@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development mailing list for IGT GPU Tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" --------------5IXU0OLK600Hej2DPQdm60p0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit On 31-07-2024 23:26, Emil Velikov wrote: > Hey everyone, > > On Wed, 31 Jul 2024 at 09:31, Bommu Krishnaiah > wrote: >> The `tweak_perm` function now uses `continue` instead of `break` when >> encountering non-existent card paths. This change addresses the assumption >> in existing userspace that card paths are contiguous, which may not be true >> if cards are dynamically removed. >> >> Problem Description: >> The test fails after running the `core_hotunplug@hot*` subtest, where card0 is missing. >> This leads to a failure in the subsequent `master-drop-set-user` test. >> >> Command sequence for reproducing the issue: >> - Check available cards: `ls /dev/dri/` >> - Output: by-path card0 renderD128 >> - Run the test: `# ./core_hotunplug --r hotrebind-lateclose` >> - Check again: ‘ls /dev/dri/’ >> - Output after failure: by-path card1 renderD129 >> - Run the test: `# ./core_setmaster --r master-drop-set-user` >> >> This failures on both XE and i915 for above sequence. >> > The commit message is still a bit strange, but I'll refer that to your > colleague who already gave you good tips. tests/core_setmaster: Handle the test even if cards are non-continuous Although most of userspace assumes drm cards to be populated continously, this assumption may not be always true. After hot unpluging and repluging of card the card may be non-continous.  To address such scenarios where the cards can be non-continous modify the tweak_perm function to loop all possible cardnumbers(card0-card255) to confirm are they populated or not. Problem Description: The test fails after running the `core_hotunplug@hot*` subtest, where card0 is missing. This leads to a failure in the subsequent `master-drop-set-user` test. Command sequence for reproducing the issue: - Check available cards: `ls /dev/dri/` - Output: by-path  card0  renderD128 - Run the test: `# ./core_hotunplug --r hotrebind-lateclose` - Check again: ‘ls /dev/dri/’ - Output after failure: by-path  card1  renderD129 - Run the test: `# ./core_setmaster --r master-drop-set-user` This failures on both XE and i915 for above sequence. > Fwiw the "existing usespace" refers to mesa, Xorg (both server and > drivers) as well as gstreamer, if I recall correctly. There may be > others assume there's no gaps. here I am referring to IGT, may be as you said few may be continues, but this change works for continues also. >> Signed-off-by: Bommu Krishnaiah >> Cc: Emil Velikov >> Cc: Himal Prasad Ghimiray >> --- >> tests/core_setmaster.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c >> index 9c2083f66..a2758e2f2 100644 >> --- a/tests/core_setmaster.c >> +++ b/tests/core_setmaster.c >> @@ -116,9 +116,10 @@ static unsigned tweak_perm(uint8_t *saved_perm, unsigned max_perm, bool save) >> for (i = 0; i < max_perm; i++) { >> snprintf(path, sizeof(path), "/dev/dri/card%u", i); >> >> - /* Existing userspace assumes there's no gaps, do the same. */ >> + /* Userspace cannot always have continuous card0...N due to >> + * dynamic unloading or removal of cards */ > Is this "dynamic unloading or removal of cards" a relatively new > thing? Back when I wrote there test, unloading DRM modules wasn't > supported (I believe) hence, it wasn't possible to have gaps. I don't think dynamic unloading or removal of cards is new core_hotunplug test verifies unloading of i915/xe driver module > > Or does this feature/work that only affects IGT and normal day-to-day > userspace will never hit this case? as I mentioned in commit message running sequence is not done before Regards, Krishna > > Should probably mention a word or two about this in the commit > message/inline comment. > > HTH, > Emil --------------5IXU0OLK600Hej2DPQdm60p0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 8bit


On 31-07-2024 23:26, Emil Velikov wrote:
Hey everyone,

On Wed, 31 Jul 2024 at 09:31, Bommu Krishnaiah
<krishnaiah.bommu@intel.com> wrote:
The `tweak_perm` function now uses `continue` instead of `break` when
encountering non-existent card paths. This change addresses the assumption
in existing userspace that card paths are contiguous, which may not be true
if cards are dynamically removed.

Problem Description:
The test fails after running the `core_hotunplug@hot*` subtest, where card0 is missing.
This leads to a failure in the subsequent `master-drop-set-user` test.

Command sequence for reproducing the issue:
- Check available cards: `ls /dev/dri/`
  - Output: by-path  card0  renderD128
- Run the test: `# ./core_hotunplug --r hotrebind-lateclose`
- Check again: ‘ls /dev/dri/’
  - Output after failure: by-path  card1  renderD129
- Run the test: `# ./core_setmaster --r master-drop-set-user`

This failures on both XE and i915 for above sequence.

The commit message is still a bit strange, but I'll refer that to your
colleague who already gave you good tips.

tests/core_setmaster: Handle the test even if cards are non-continuous

 

Although most of userspace assumes drm cards to be populated continously,

this assumption may not be always true. After hot unpluging and repluging of card

the card may be non-continous.  To address such scenarios where the cards can be non-continous

modify the tweak_perm function to loop all possible cardnumbers(card0-card255) to confirm are they populated or not.

 

Problem Description:

The test fails after running the `core_hotunplug@hot*` subtest, where card0 is missing.

This leads to a failure in the subsequent `master-drop-set-user` test.

 

Command sequence for reproducing the issue:

- Check available cards: `ls /dev/dri/`

- Output: by-path  card0  renderD128

- Run the test: `# ./core_hotunplug --r hotrebind-lateclose`

- Check again: ‘ls /dev/dri/’

- Output after failure: by-path  card1  renderD129

- Run the test: `# ./core_setmaster --r master-drop-set-user`

 

This failures on both XE and i915 for above sequence.

Fwiw the "existing usespace" refers to mesa, Xorg (both server and
drivers) as well as gstreamer, if I recall correctly. There may be
others assume there's no gaps.
here I am referring to IGT, may be as you said few may be continues, but this change works for continues also.

      
Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
---
 tests/core_setmaster.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/core_setmaster.c b/tests/core_setmaster.c
index 9c2083f66..a2758e2f2 100644
--- a/tests/core_setmaster.c
+++ b/tests/core_setmaster.c
@@ -116,9 +116,10 @@ static unsigned tweak_perm(uint8_t *saved_perm, unsigned max_perm, bool save)
        for (i = 0; i < max_perm; i++) {
                snprintf(path, sizeof(path), "/dev/dri/card%u", i);

-               /* Existing userspace assumes there's no gaps, do the same. */
+               /* Userspace cannot always have continuous card0...N due to
+                * dynamic unloading or removal of cards */
Is this "dynamic unloading or removal of cards" a relatively new
thing? Back when I wrote there test, unloading DRM modules wasn't
supported (I believe) hence, it wasn't possible to have gaps.

I don't think dynamic unloading or removal of cards is new

core_hotunplug test verifies unloading of i915/xe driver module


Or does this feature/work that only affects IGT and normal day-to-day
userspace will never hit this case?

as I mentioned in commit message running sequence is not done before

Regards,

Krishna


Should probably mention a word or two about this in the commit
message/inline comment.

HTH,
Emil
--------------5IXU0OLK600Hej2DPQdm60p0--