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 60741E77197 for ; Tue, 7 Jan 2025 11:52:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE37A10EAC6; Tue, 7 Jan 2025 11:52:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="XwfEFPbf"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id 86DDC10E423 for ; Tue, 7 Jan 2025 11:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736250757; x=1767786757; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=cRuUJ97kStfEcacUAfegvaWCsiEg0bmrimBLKeS0TNc=; b=XwfEFPbfY8yj70E9jzAYm3W18aiKgPjjqkwRwC89Cxpk3MH7dlbwurzE gI+phaO5ch03DG+x0w3gq2BI3GtADk8NxE3roPgIL9PDg8ipGT/Hgna9+ L4LG3bMx+EchCPcQ/MV4JX4K3hMNL734m+QEA8mzCG/ihD5osisNWHypw 3JxPG7Y58Ng2/OP90C7gpnc7OGoFlIeGJPuADcXuSJ2rv0yVGIMQ/9S7h XDgwD4Lvh+A0ZQa8g/nHW6Cuh+9jpDDo1fu0hoRYsAfmUXVqtLwTCcPOS XcgiiFzDrYuVjlCILittoXnGtObMuhZA4wCq/BU/ZSJPSrb79f5ug/gIC Q==; X-CSE-ConnectionGUID: iyHaMs+tRi6kgenx9+8Mow== X-CSE-MsgGUID: 8pQQQTF3QnCpKhL86l+Q4Q== X-IronPort-AV: E=McAfee;i="6700,10204,11307"; a="47846614" X-IronPort-AV: E=Sophos;i="6.12,295,1728975600"; d="scan'208";a="47846614" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2025 03:52:36 -0800 X-CSE-ConnectionGUID: JMgcQ/KWSLWU670JVr4tMQ== X-CSE-MsgGUID: 89QU5hCtR8aw7ewlP27tsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,295,1728975600"; d="scan'208";a="103258775" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa009.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 07 Jan 2025 03:52:36 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Tue, 7 Jan 2025 03:52:35 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44 via Frontend Transport; Tue, 7 Jan 2025 03:52:35 -0800 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.171) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Tue, 7 Jan 2025 03:52:35 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cwji6KNSt4uih3sJHqENEbrGrsX/32YPqbDwEEm3R86unWcMnkSz7x6PqLwE9renSfLKhvqiM+xil1AnvLelo42dVdTlLPf/RrTH/Fdn3d36IIxgno9+x4WkAWcCAOsTEtjUBhSOdECdtLsyuoIf65hsvN5Vx28qCyaSJ8WFMb3Grvkac9SRiFggxQH1y4yQR4fY8eyW7FNdY5kDDbUwWZfW6ekgGL9E4uae/VkyqimZuuJwCghvnXvhKyF/jWcpXJUqGy722EYrUOJ+xdp2ZG83sanEbMXvaGro7qmovGd0Niu2YdMmigLECnDlKDiAIyrrIy7bL4+nkQDNqD2rQA== 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=hh1eE0tlDYUel++VegOk/c9BgJJ/LvfFHyb3zMxr19s=; b=IzuSSo5vi3ThHfv+GPm/lj8RHzxw18VVTXkienALeRQZjr/1Js3JNwdjSLOrRFHmBFJFl3Xkl8wRRpWj5kCj3iTjcK/g62yiH7rGxm52P/D/3KZDN3zpsKmOxFxyBbvVOuYtFztNy3bybPWLeGgqnKQjToLB52PFqFVi+zMqk5LCdAb8YGWOBVVHlN49M6+4JBr1dGIQx/6pG9Sm3H8BDQhxSJPUol9hYzvdJ7JExfUTSvOnvAleVbn9w4qqrO7vX+XxZoO/0BDCCtUTqVO8YuI3l5+m0ToJlKW5Uu2hI2Dha+0tRH2OCvFGXtg0ncXTEitQwsDXSEgpreBYZ008Rg== 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 BN9PR11MB5482.namprd11.prod.outlook.com (2603:10b6:408:103::16) by SA1PR11MB8448.namprd11.prod.outlook.com (2603:10b6:806:3a3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.17; Tue, 7 Jan 2025 11:52:11 +0000 Received: from BN9PR11MB5482.namprd11.prod.outlook.com ([fe80::158b:b258:5e7:c229]) by BN9PR11MB5482.namprd11.prod.outlook.com ([fe80::158b:b258:5e7:c229%4]) with mapi id 15.20.8314.018; Tue, 7 Jan 2025 11:52:11 +0000 Message-ID: <010ce8e5-9e1a-4403-b611-25cf92b9c72c@intel.com> Date: Tue, 7 Jan 2025 12:52:06 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH i-g-t 5/5] tests/xe_sriov_auto_provisioning: Add tests for SR-IOV auto-provisioning To: "Bernatowicz, Marcin" , CC: Adam Miszczak , Jakub Kolakowski , =?UTF-8?Q?Micha=C5=82_Wajdeczko?= , =?UTF-8?Q?Micha=C5=82_Winiarski?= , Narasimha C V , =?UTF-8?Q?Piotr_Pi=C3=B3rkowski?= , "Satyanarayana K V P" , Tomasz Lis References: <20241218120056.779962-1-marcin.bernatowicz@linux.intel.com> <20241218120056.779962-6-marcin.bernatowicz@linux.intel.com> <925fea09-6f3d-45e5-8b3c-8c6138c399cc@linux.intel.com> From: "Laguna, Lukasz" Content-Language: en-US In-Reply-To: <925fea09-6f3d-45e5-8b3c-8c6138c399cc@linux.intel.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: VI1PR02CA0070.eurprd02.prod.outlook.com (2603:10a6:802:14::41) To BN9PR11MB5482.namprd11.prod.outlook.com (2603:10b6:408:103::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN9PR11MB5482:EE_|SA1PR11MB8448:EE_ X-MS-Office365-Filtering-Correlation-Id: c0ad1322-fa04-4656-d46f-08dd2f11b839 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;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cU5DM21a?= =?utf-8?B?aXBUR1hWWDRwcitNVkMyb25ReEtBbGMzZWErR1FyN2RwdWQ4N3ZZczVwekRZ?= =?utf-8?B?eHJleHZlZEZOamI1djlkdmQwQkJ4MTBCUnlFVnlVOHh4ampuSHpRVncyL2VE?= =?utf-8?Q?HqqSIZVLGlvQO?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR11MB5482.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(7053199007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UWhIT1Y2cWREaFM0VVhDclY5SlJMYm93djFsR3QwWnNDajRSY3R3KzExS1BO?= =?utf-8?B?N0FoNDZIZkxMNXRlZVZJd3prWEhCdGNDbW1uSVN0Wlhmdm1kYXFWQWhZNWNp?= =?utf-8?B?NDl2MjZZYTFvaGwwRzdVa0FYRVhSNit4UWR5MGlJc0dYY1VUak1GQWpMRXJX?= =?utf-8?B?eEFLeHFrdTNDQWRsOEtxMFZJZENuTG51Wm15Y21Wdm5vWENqVUVMQlVtV2ox?= =?utf-8?B?NFR0WmUvSkp1N0RZYVdNeEJnVXV6N3F0U0k5ZzFCMkdaUG0vNXluVHFEZWJ4?= =?utf-8?B?bzUreHBtZmEvcmg2UThLL2pJU1ljOUc3RHRwanBxdUpvZmgvRGdLckt4dEc3?= =?utf-8?B?ZkJOY0NLc2Q2OGM4Q3M3Rks4ckJXWGZRZXZ4TnA5aGxnaSsvOFlwUURMMGk4?= =?utf-8?B?OFhrdkgydmZ2QkhwZHpua1V5ajFDcDN0MHlNdUlCVWdNVlora3Yrd3orbG05?= =?utf-8?B?UUE4L0RDREN1L1Y5dDQ5ZHBVT2NCTzhZbVhTN2x0N1ZSWjNWQXJwRnBpYnQ4?= =?utf-8?B?NzNadENacUZ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VMYkc5Y2E1ZUtXU01uWHk4Y2Eyb0p2Ym80UnFQWW0reDU1aGxjRFIr?= =?utf-8?B?ekhycEo1cE9sWHFBRGxhd296QWkrWWl4RXBic2Zhd2h5SnAyT21KbUl1ZWlF?= =?utf-8?B?SERkNy9TVnkxZ1hwQlZoeDcxT3c1eEU3MytHOG5sVldSNXU3Tjd4amQ3dSsv?= =?utf-8?B?eWwwV01EVTVpODRJWjdNUTR4Z3MvRTU4Yk96YzRiNHFyV3JwNmw3SEhEVWNj?= =?utf-8?B?dFplZnViNER6YWNoUGhIbHRBbCtIS3F4WS9zOHVJWVp6QnI1cWw3aVZ5bXpk?= =?utf-8?B?V2xKWU9GRWMrSHNOTE9TdDM0OGZla1Q4MHJFc0VScDdwSGMyZE1qQXJlR1g5?= =?utf-8?B?NDM3R0t3aGFpaVMwOXNvaUVCQ2hQbDFyR0trS2JSYjRPeGRKOUZ5ckxmMFE3?= =?utf-8?B?VVQ1dEhGZkRwNnJIbkFoYmt2OG5pTWFYUy9wdDFNSEZNK0lKdWoyRkRZT3Rl?= =?utf-8?B?bXgvLzJWTzU0RGRPeDhoQndyZE84SWY3SUtQREQ0eEM5NTZmL09nZHhUZ21o?= =?utf-8?B?N3hzMWdIUENPVTJPMHJrZzJFSkMzMHo3OVBoT2wxVDVwL0MzczVLMitTWkRv?= =?utf-8?B?WEVLTUVvaGV0SE9uVGNmR2lzSmtZM1NKVzRLaUprM3AxOHFTUTl2U1EvTVVT?= =?utf-8?Q?5zL7GhQgeq9J9v1//K5bAdXPp?= X-MS-Exchange-CrossTenant-Network-Message-Id: c0ad1322-fa04-4656-d46f-08dd2f11b839 X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5482.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jan 2025 11:52:11.0458 (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: 3BZPM2m2XaNIQ5VhC4i+moFyNK+WhBZ8whouFbT7T/Tv5E8x7YvpSwaVN7nYamDaj9vo0gWcMqnhYSOZwH4p4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB8448 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" On 12/19/2024 16:54, Bernatowicz, Marcin wrote: > > > On 12/19/2024 3:48 PM, Laguna, Lukasz wrote: >> On 12/18/2024 13:00, Marcin Bernatowicz wrote: >>> Added subtests validating below scenarios: >>> - auto-provisioned resources are allocated by PF driver in fairly >>> manner, >>> - auto-provisioned resources are released once VFs are disabled, >>> - verify that ranges of auto-provisioned resources are exclusive. >>> >>> The tests rely on ggtt_provisioned, lmem_provisioned, >>> contexts_provisioned and doorbells_provisioned debugfs attributes. >>> >>> Signed-off-by: Marcin Bernatowicz >>> Cc: Adam Miszczak >>> Cc: Jakub Kolakowski >>> Cc: Lukasz Laguna >>> Cc: Michał Wajdeczko >>> Cc: Michał Winiarski >>> Cc: Narasimha C V >>> Cc: Piotr Piórkowski >>> Cc: Satyanarayana K V P >>> Cc: Tomasz Lis >>> --- >>>   tests/intel/xe_sriov_auto_provisioning.c | 399 >>> +++++++++++++++++++++++ >>>   tests/meson.build                        |   1 + >>>   2 files changed, 400 insertions(+) >>>   create mode 100644 tests/intel/xe_sriov_auto_provisioning.c >>> >>> diff --git a/tests/intel/xe_sriov_auto_provisioning.c b/tests/intel/ >>> xe_sriov_auto_provisioning.c >>> new file mode 100644 >>> index 000000000..a5ae60525 >>> --- /dev/null >>> +++ b/tests/intel/xe_sriov_auto_provisioning.c >>> @@ -0,0 +1,399 @@ >>> +// SPDX-License-Identifier: MIT >>> +/* >>> + * Copyright(c) 2023 Intel Corporation. All rights reserved. >>> + */ >>> + >>> +#include >>> + >>> +#include "drmtest.h" >>> +#include "igt_core.h" >>> +#include "igt_sriov_device.h" >>> +#include "igt_sysfs.h" >>> +#include "xe/xe_sriov_debugfs.h" >>> +#include "xe/xe_sriov_provisioning.h" >>> +#include "xe/xe_query.h" >>> + >>> +/** >>> + * TEST: xe_sriov_auto_provisioning >>> + * Category: Core >>> + * Mega feature: SR-IOV >>> + * Sub-category: provisioning >>> + * Functionality: auto-provisioning >>> + * Run type: FULL >>> + * Description: Examine behavior of SR-IOV auto-provisioning >>> + * >>> + * SUBTEST: auto-provisioning-fair >> >> As we have auto_provisioning in the test name then maybe subtest >> named "fair" would be sufficient? > > maybe fair-allocation ? Yeah, sounds better. > >> >>> + * Description: >>> + *   Verify that auto-provisioned resources are allocated by PF >>> driver in fairly manner >>> + * >>> + * SUBTEST: auto-provisioned-resources-released-on-vfs-disabling >> >> Similar to the above, maybe "resources-releasing-on-vfs-disabling"? > > ok > >> >>> + * Description: >>> + *   Verify that auto-provisioned resources are released once VFs >>> are disabled >>> + * >>> + * SUBTEST: exclusive-ranges >>> + * Description: >>> + *   Verify that ranges of auto-provisioned resources are exclusive >>> + */ >>> + >>> +IGT_TEST_DESCRIPTION("Xe tests for SR-IOV auto-provisioning"); >>> + >>> +static int compare_ranges_by_vf_id(const void *a, const void *b) >>> +{ >>> +    const struct xe_sriov_provisioned_range *range_a = a; >>> +    const struct xe_sriov_provisioned_range *range_b = b; >>> + >>> +    return (range_a->vf_id - range_b->vf_id); >>> +} >>> + >>> +static int validate_vf_ids(enum xe_sriov_shared_res res, >>> +               struct xe_sriov_provisioned_range *ranges, >>> +               unsigned int nr_ranges, unsigned int num_vfs) >>> +{ >>> +    unsigned int current_vf_id = 0; >>> + >>> +    igt_assert(num_vfs); >>> + >>> +    if (igt_debug_on_f(nr_ranges == 0, >>> +               "%s: No VF ranges\n", >>> +               xe_sriov_debugfs_provisioned_attr_name(res))) >>> +        return -ENOENT; >>> + >>> +    igt_assert(ranges); >>> +    qsort(ranges, nr_ranges, sizeof(ranges[0]), >>> compare_ranges_by_vf_id); >>> + >>> +    for (unsigned int i = 0; i < nr_ranges; i++) { >>> +        unsigned int vf_id = ranges[i].vf_id; >>> + >>> +        /* Skip duplicates */ >>> +        if (vf_id == current_vf_id) >>> +            continue; >>> + >>> +        if (igt_debug_on_f(vf_id < 1 || vf_id > num_vfs, >>> +                   "%s: Out of range VF%u\n", >>> + xe_sriov_debugfs_provisioned_attr_name(res), vf_id)) >>> +            return -ERANGE; >>> + >>> +        if (igt_debug_on_f(vf_id > current_vf_id + 1, >>> +                   "%s: Missing VF%u\n", >>> + xe_sriov_debugfs_provisioned_attr_name(res), >>> +                   current_vf_id + 1)) >>> +            return -ESRCH; >>> + >>> +        current_vf_id = vf_id; >>> +    } >>> + >>> +    if (igt_debug_on_f(current_vf_id != num_vfs, >>> +               "%s: Missing VF%u\n", >>> +               xe_sriov_debugfs_provisioned_attr_name(res), num_vfs)) >>> +        return -ESRCH; >>> + >>> +    return 0; >>> +} >>> + >>> +/* Expects ranges sorted by VF IDs */ >>> +static int validate_fair_allocation(enum xe_sriov_shared_res res, >>> +                    struct xe_sriov_provisioned_range *ranges, >>> +                    unsigned int nr_ranges) >>> +{ >>> +    uint64_t expected_allocation = 0; >>> +    uint64_t current_allocation = 0; >>> +    unsigned int current_vf_id; >>> + >>> +    igt_assert(nr_ranges); >>> +    current_vf_id = ranges[0].vf_id; >>> + >>> +    for (unsigned int i = 0; i <= nr_ranges; i++) { >>> +        if (i == nr_ranges || ranges[i].vf_id != current_vf_id) { >>> +            /* Check allocation consistency for the previous VF ID */ >>> +            if (expected_allocation == 0) >>> +                expected_allocation = current_allocation; >>> +            else if (igt_debug_on_f(current_allocation != >>> expected_allocation, >>> +                        "%s: Allocation mismatch, expected=%lu >>> VF%u=%lu\n", >>> + xe_sriov_debugfs_provisioned_attr_name(res), >>> +                        expected_allocation, current_vf_id, >>> +                        current_allocation)) >>> +                return -1; >>> + >>> +            /* Reset for the new VF ID (if not at the end) */ >>> +            if (i < nr_ranges) { >>> +                current_vf_id = ranges[i].vf_id; >>> +                current_allocation = 0; >>> +            } >>> +        } >>> + >>> +        /* Accumulate allocation for the current VF ID */ >>> +        if (i < nr_ranges) >>> +            current_allocation += ranges[i].end - ranges[i].start + 1; >>> +    } >>> + >>> +    return 0; >>> +} >>> + >> >> Handling cases where one VF can have more than one range of resource >> adds extra complexity to the test logic. I started wondering if we >> should consider such case as valid. Maybe we should assert earlier >> instead? > > You mean "+=" complexity ? > > current_allocation += ranges[i].end - ranges[i].start + 1; > > vs > > current_allocation = ranges[i].end - ranges[i].start + 1; > > > and > > /* Skip duplicates */ > if (vf_id == current_vf_id) >     continue; > > vs > > if (vf_id == current_vf_id) >     return err; > > in validate_vf_ids ? > I though that some conditions and operations are introduced because of the support of multiple ranges, but that was my misunderstanding. When I looked on this again, it's fine. > Maybe we can move the validate_vf_ids to the lib > or after agree no duplicate ids/gaps allowed return sorted by VF id > entries from read function ? > >> >>> +static int check_fair_allocation(int pf_fd, unsigned int num_vfs, >>> unsigned int gt_id, >>> +                 enum xe_sriov_shared_res res) >>> +{ >>> +    struct xe_sriov_provisioned_range *ranges; >>> +    unsigned int nr_ranges; >>> +    int ret; >>> + >>> +    ret = xe_sriov_pf_debugfs_read_provisioned_ranges(pf_fd, res, >>> gt_id, &ranges, &nr_ranges); >>> +    if (igt_debug_on_f(ret, "Failed read %s on GT%u (%d)\n", >>> +               xe_sriov_debugfs_provisioned_attr_name(res), gt_id, >>> ret)) >>> +        return ret; >>> + >>> +    ret = validate_vf_ids(res, ranges, nr_ranges, num_vfs); >>> +    if (ret) { >>> +        free(ranges); >>> +        return ret; >>> +    } >>> + >>> +    ret = validate_fair_allocation(res, ranges, nr_ranges); >>> +    if (ret) { >>> +        free(ranges); >>> +        return ret; >>> +    } >>> + >>> +    free(ranges); >>> + >>> +    return 0; >>> +} >>> + >>> +static void auto_provisioning_fair(int pf_fd, unsigned int num_vfs) >>> +{ >>> +    enum xe_sriov_shared_res res; >>> +    unsigned int gt; >>> +    int fails = 0; >>> + >>> +    igt_sriov_disable_driver_autoprobe(pf_fd); >>> +    igt_sriov_enable_vfs(pf_fd, num_vfs); >>> + >>> +    xe_for_each_gt(pf_fd, gt) { >>> +        xe_sriov_for_each_provisionable_shared_res(res, pf_fd, gt) { >> >> I was OK with not defining dynamic subtest per GT to reduce the test >> execution time, but I had mixed feelings about not having separate >> subtests per resource. >> But the more I think about it, the more I'm convinced to your >> approach. For manual reproduction with specific resource we can >> define some test option taking the resource we want to validate (no >> need to implement it now, we can add it when needed). > > I don't have a strong opinion on this. The dynamic subtest logic > remains unchanged from the original version, except for the last > exclusive-ranges subtest, which was adjusted for consistency. We may > have fewer subtests/statistics, but each subtest should correctly > report if any resource "misbehaves". > > Thanks for review, > marcin >> >>> +            if (igt_debug_on_f(check_fair_allocation(pf_fd, >>> num_vfs, gt, res), >>> +                       "%s fair allocation failed on gt%u\n", >>> +                       xe_sriov_shared_res_to_string(res), gt)) >>> +                fails++; >>> +        } >>> +    } >>> + >>> +    igt_sriov_disable_vfs(pf_fd); >>> + >>> +    igt_fail_on_f(fails, "fair allocation failed\n"); >>> +} >>> + >>> +static void auto_provisioning_release(int pf_fd, unsigned int num_vfs) >>> +{ >>> +    struct xe_sriov_provisioned_range *ranges; >>> +    unsigned int nr_ranges; >>> +    enum xe_sriov_shared_res res; >>> +    unsigned int gt; >>> +    int fails = 0; >>> + >>> +    igt_sriov_disable_driver_autoprobe(pf_fd); >>> +    igt_sriov_enable_vfs(pf_fd, num_vfs); >>> + >>> +    xe_for_each_gt(pf_fd, gt) { >>> +        xe_sriov_for_each_provisionable_shared_res(res, pf_fd, gt) { >>> +            if >>> (igt_warn_on_f(xe_sriov_pf_debugfs_read_provisioned_ranges(pf_fd, res, >>> +                                              gt, >>> +                                              &ranges, >>> + &nr_ranges), >>> +                      "Failed read %s on gt%u\n", >>> + xe_sriov_debugfs_provisioned_attr_name(res), gt)) { >>> +                continue; >>> +            } >>> + >>> +            igt_warn_on_f(validate_vf_ids(res, ranges, nr_ranges, >>> num_vfs), >>> +                      "%s: VF IDs validation failed on gt%u\n", >>> + xe_sriov_debugfs_provisioned_attr_name(res), gt); >>> +            free(ranges); >>> +        } >>> +    } >>> + >>> +    igt_sriov_disable_vfs(pf_fd); >>> + >>> +    xe_for_each_gt(pf_fd, gt) { >>> +        xe_sriov_for_each_provisionable_shared_res(res, pf_fd, gt) { >>> +            if >>> (igt_debug_on_f(xe_sriov_pf_debugfs_read_provisioned_ranges(pf_fd, res, >>> +                                               gt, >>> +                                               &ranges, >>> + &nr_ranges), >>> +                       "Failed read %s on gt%u\n", >>> + xe_sriov_debugfs_provisioned_attr_name(res), gt)) { >>> +                fails++; >>> +                continue; >>> +            } >>> + >>> +            if (igt_debug_on_f(nr_ranges, >>> +                       "%s contains unexpected ranges on gt%u\n", >>> + xe_sriov_debugfs_provisioned_attr_name(res), gt)) { >>> +                fails++; >>> +                for (unsigned int i = 0; i < nr_ranges; i++) { >>> +                    igt_debug((res == XE_SRIOV_SHARED_RES_GGTT) ? >>> +                            "%s:VF%u: %lx-%lx\n" : >>> +                            "%s:VF%u %lu-%lu\n", >>> +                          xe_sriov_shared_res_to_string(res), >>> +                          ranges[i].vf_id, ranges[i].start, >>> ranges[i].end); >>> +                } >>> +            } >>> +            free(ranges); >>> +        } >>> +    } >>> + >>> +    igt_fail_on_f(fails, "shared resource release check failed\n"); >>> +} >>> + >>> +static int compare_ranges_by_start(const void *a, const void *b) >>> +{ >>> +    const struct xe_sriov_provisioned_range *range_a = a; >>> +    const struct xe_sriov_provisioned_range *range_b = b; >>> + >>> +    if (range_a->start < range_b->start) >>> +        return -1; >>> +    if (range_a->start > range_b->start) >>> +        return 1; >>> +    return 0; >>> +} >>> + >>> +static int check_no_overlap(int pf_fd, unsigned int num_vfs, >>> unsigned int gt_id, >>> +                enum xe_sriov_shared_res res) >>> +{ >>> +    struct xe_sriov_provisioned_range *ranges; >>> +    unsigned int nr_ranges; >>> +    int ret; >>> + >>> +    ret = xe_sriov_pf_debugfs_read_provisioned_ranges(pf_fd, res, >>> gt_id, &ranges, &nr_ranges); >>> +    if (ret) >>> +        return ret; >>> + >>> +    ret = validate_vf_ids(res, ranges, nr_ranges, num_vfs); >>> +    if (ret) { >>> +        free(ranges); >>> +        return ret; >>> +    } >>> + >>> +    igt_assert(ranges); >>> +    qsort(ranges, nr_ranges, sizeof(ranges[0]), >>> compare_ranges_by_start); >>> + >>> +    for (unsigned int i = 0; i < nr_ranges - 1; i++) >>> +        if (ranges[i].end >= ranges[i + 1].start) { >>> +            igt_debug((res == XE_SRIOV_SHARED_RES_GGTT) ? >>> +                  "Overlapping ranges: VF%u [%lx-%lx] and VF%u >>> [%lx- %lx]\n" : >>> +                  "Overlapping ranges: VF%u [%lu-%lu] and VF%u >>> [%lu- %lu]\n", >>> +                  ranges[i].vf_id, ranges[i].start, ranges[i].end, >>> +                  ranges[i + 1].vf_id, ranges[i + 1].start, >>> ranges[i + 1].end); >>> +            free(ranges); >>> +            return -1; >>> +        } >>> + >>> +    free(ranges); >>> + >>> +    return 0; >>> +} >>> + >>> +static void auto_provisioning_exclusive_ranges(int pf_fd, unsigned >>> int num_vfs) >>> +{ >>> +    enum xe_sriov_shared_res res; >>> +    unsigned int gt; >>> +    int fails = 0; >>> + >>> +    igt_sriov_disable_driver_autoprobe(pf_fd); >>> +    igt_sriov_enable_vfs(pf_fd, num_vfs); >>> + >>> +    xe_for_each_gt(pf_fd, gt) { >>> +        xe_sriov_for_each_provisionable_shared_res(res, pf_fd, gt) { >>> +            if (res == XE_SRIOV_SHARED_RES_LMEM) >>> +                /* >>> +                 * lmem_provisioned is not applicable for this test, >>> +                 * as it does not expose ranges >>> +                 */ >>> +                continue; >>> + >>> +            if (igt_debug_on_f(check_no_overlap(pf_fd, num_vfs, gt, >>> res), >>> +                       "%s overlap check failed on gt%u\n", >>> +                       xe_sriov_shared_res_to_string(res), gt)) >>> +                fails++; >>> +        } >>> +    } >>> + >>> +    igt_sriov_disable_vfs(pf_fd); >>> + >>> +    igt_fail_on_f(fails, "exclusive ranges check failed\n"); >>> +} >>> + >>> +igt_main >>> +{ >>> +    enum xe_sriov_shared_res res; >>> +    unsigned int gt; >>> +    bool autoprobe; >>> +    int pf_fd; >>> + >>> +    igt_fixture { >>> +        struct xe_sriov_provisioned_range *ranges; >>> +        unsigned int nr_ranges; >>> +        int ret; >>> + >>> +        pf_fd = drm_open_driver(DRIVER_XE); >>> +        igt_require(igt_sriov_is_pf(pf_fd)); >>> +        igt_require(igt_sriov_get_enabled_vfs(pf_fd) == 0); >>> + >>> +        xe_for_each_gt(pf_fd, gt) { >>> +            xe_sriov_for_each_provisionable_shared_res(res, pf_fd, >>> gt) { >>> +                ret = >>> xe_sriov_pf_debugfs_read_provisioned_ranges(pf_fd, res, gt, >>> +                                          &ranges, >>> +                                          &nr_ranges); >>> +                igt_skip_on_f(ret, "Failed read %s on gt%u (%d)\n", >>> + xe_sriov_debugfs_provisioned_attr_name(res), >>> +                          gt, ret); >>> +                igt_skip_on_f(nr_ranges != 0, "Unexpected %s >>> content on gt%u\n", >>> + xe_sriov_debugfs_provisioned_attr_name(res), gt); >>> +            } >>> +        } >>> +        autoprobe = igt_sriov_is_driver_autoprobe_enabled(pf_fd); >>> +    } >>> + >>> +    igt_describe("Verify that auto-provisioned resources are >>> allocated by PF driver in fairly manner"); >>> +    igt_subtest_with_dynamic("auto-provisioning-fair") { >>> +        for_random_sriov_num_vfs(pf_fd, num_vfs) { >>> +            igt_dynamic_f("numvfs-random") { >>> +                igt_debug("numvfs=%u\n", num_vfs); >>> +                auto_provisioning_fair(pf_fd, num_vfs); >>> +            } >>> +        } >>> +    } >>> + >>> +    igt_describe("Verify that auto-provisioned resources are >>> released once VFs are disabled"); >>> + igt_subtest_with_dynamic("auto-provisioned-resources-released-on- >>> vfs-disabling") { >>> +        for_random_sriov_num_vfs(pf_fd, num_vfs) { >>> +            igt_dynamic_f("numvfs-random") { >>> +                igt_debug("numvfs=%u\n", num_vfs); >>> +                auto_provisioning_release(pf_fd, num_vfs); >>> +            } >>> +        } >>> +    } >>> + >>> +    igt_describe("Verify that ranges of auto-provisioned resources >>> are exclusive"); >>> +    igt_subtest_with_dynamic_f("exclusive-ranges") { >>> +        unsigned int total_vfs = igt_sriov_get_total_vfs(pf_fd); >>> + >>> +        igt_skip_on(total_vfs < 2); >>> + >>> +        for_random_sriov_vf_in_range(pf_fd, 2, total_vfs, num_vfs) { >>> +            igt_dynamic_f("numvfs-random") { >>> +                igt_debug("numvfs=%u\n", num_vfs); >>> +                auto_provisioning_exclusive_ranges(pf_fd, num_vfs); >>> +            } >>> +        } >>> +    } >>> + >>> +    igt_fixture { >>> +        igt_sriov_disable_vfs(pf_fd); >>> +        /* abort to avoid execution of next tests with enabled VFs */ >>> +        igt_abort_on_f(igt_sriov_get_enabled_vfs(pf_fd) > 0, >>> "Failed to disable VF(s)"); >>> +        autoprobe ? igt_sriov_enable_driver_autoprobe(pf_fd) : >>> +                igt_sriov_disable_driver_autoprobe(pf_fd); >>> +        igt_abort_on_f(autoprobe != >>> igt_sriov_is_driver_autoprobe_enabled(pf_fd), >>> +                   "Failed to restore sriov_drivers_autoprobe >>> value\n"); >>> +        drm_close_driver(pf_fd); >>> +    } >>> +} >>> diff --git a/tests/meson.build b/tests/meson.build >>> index 2724c7a9a..01076f401 100644 >>> --- a/tests/meson.build >>> +++ b/tests/meson.build >>> @@ -315,6 +315,7 @@ intel_xe_progs = [ >>>       'xe_vm', >>>       'xe_waitfence', >>>       'xe_spin_batch', >>> +    'xe_sriov_auto_provisioning', >>>       'xe_sriov_flr', >>>       'xe_sysfs_defaults', >>>       'xe_sysfs_preempt_timeout', >