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 EC20142C07; Thu, 1 Jun 2023 20:05:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B26B40EF0; Thu, 1 Jun 2023 20:05:19 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2056.outbound.protection.outlook.com [40.107.92.56]) by mails.dpdk.org (Postfix) with ESMTP id 4648D40DDC for ; Thu, 1 Jun 2023 20:05:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hhcdSqBJcEU/MUvUo5qZHCZyhNV+iII6c8ZjZyzuuoWUFqSazWAGOxuVpeJMnM13peBK8Itgl38Vb255a0kLcXNoFjMkUiuOylCYap/UaJWUyNFnI/vHibCqSIzSx/d9qz+KShR+bYCneHT450og7Y9N7dLC/ZVKoxUKQn+Y7ISQZch4I3WMW7jZqrAwc/00is0NyOHoxwwCmXLUCuS46a+KaV4CAk0CJshorkIdRMijFL3Iic3ozZkSekRBSaasIrB+9iEYRSZ5fvSuHn4LaulukUGb0zJGJtVbh2AV4sxeR6DfhlgEa59cKZSyoAD/i2yABRZDMxsCGTtYJydaig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=kcdF2yPJPoB0ID6sl+6EbQ8KKJ/2Q96jwj+dEqpoOP8=; b=V6bBI0FZgNrM1u3vJnGLcvoKhy+pedIJbJJvZr7jYiWiGN0yNb/hWEowGjdl34FHBfySJkRnE5Am1ByZF0sqFG4aC7n2U4F1p4VEACvuTk/VxvwF0IAUUADGct+m1Ffzo1S/eh14f7z4gKY4JOU4kDCbDBHlGGvL4ydAS7X+aqclAcn+JQwZeepADc0rWbDa4K7Y2ErVomf2uCdvGvvyJ+ZoaqMW0SLftJd54bSZIfrV0DtDnsdl3lOaNloLAd7aQfxMjdg+TG7nSbIMgF3aBog6YdKmxVTLZyF3wnXmtfIEfLC5yGhH2THghyjR22+38sZAJNy/iMTBgvuzJzZL7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kcdF2yPJPoB0ID6sl+6EbQ8KKJ/2Q96jwj+dEqpoOP8=; b=cLgiMtG9VYddBBiYvbA8BkGd8/4DYliF9MRQ4qLfBrm3I2OLxCwubcB68+wCacz9NL4EDjOSZtZD7vYCEqVCAMV33hSHdB8Udgv4hUI0jv87ovMYgxx3Q/mG1Hm5LQtZlIGWn0z6N6ZvDLSshnfugCCyuauk7f+6awd72grOKcY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH3PR12MB8308.namprd12.prod.outlook.com (2603:10b6:610:131::8) by PH7PR12MB5654.namprd12.prod.outlook.com (2603:10b6:510:137::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.24; Thu, 1 Jun 2023 18:05:14 +0000 Received: from CH3PR12MB8308.namprd12.prod.outlook.com ([fe80::e452:1914:1054:de79]) by CH3PR12MB8308.namprd12.prod.outlook.com ([fe80::e452:1914:1054:de79%7]) with mapi id 15.20.6455.020; Thu, 1 Jun 2023 18:05:13 +0000 Message-ID: Date: Thu, 1 Jun 2023 23:34:21 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v5 3/5] eal/interrupts: add IRQ count in interrupt handle Content-Language: en-US To: David Marchand Cc: dev@dpdk.org, thomas@monjalon.net, hkalra@marvell.com, anatoly.burakov@intel.com, stephen@networkplumber.org, ferruh.yigit@amd.com, harpreet.anand@amd.com, nikhil.agarwal@amd.com References: <20230124140746.594066-1-nipun.gupta@amd.com> <20230525100821.12148-1-nipun.gupta@amd.com> <20230525100821.12148-4-nipun.gupta@amd.com> From: Nipun Gupta In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PN3PR01CA0045.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:98::8) To CH3PR12MB8308.namprd12.prod.outlook.com (2603:10b6:610:131::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR12MB8308:EE_|PH7PR12MB5654:EE_ X-MS-Office365-Filtering-Correlation-Id: 0cb88846-699f-49a9-d5ef-08db62cabf62 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ojwSHbiqcGmORCH4GtP7plDkYhIfPyq9ckHFq8tepMc6vA0n+mt/vr86OOlbd0Oaaln4mvsWnjMyEkK5BGUBYXZA56N1BnbHEWVnBZRizyf54xQXg1iGCIG2+sfYpjNMCEOjabMpXJtrI/wDOw04VG1sfj/DV32wTB9U/hOZY9gSsL+nr1qhuk+lWnHfZpfLNjiMoKjyL9ExJNsaIheBVQ4Zgt7bif3kTJn9w8i/2HaMxeDxI4I3INixgu7druIJK1Y1sVbaN74MU4SgU3mtg3kBgiflkOu0bYqIoAcIvXaTevc16N6iu5+GOTACVZFlXrgmNQtRfCqZrdmcbrg949lMrevca3phB4EUpJsE1gau/UnKKczAg9jRM2KRknSvg0isXhkAfFic3oSp7ZGmHn546ymhMWMxNlnM9Rjv9OEg4lGdU/mEJ9X/G0dYe79OQ2VOBpOZ+XM5PTcuN7qoavYqGaCLHutpcgo79MJTrP1HfBL/BSiQ2v/BsH7jjO+SrstvYfxPyhGtvGBzl4CqzEmQ1BHVwsTfsErik89sAFXoXz764QoArnwgED0dn6NZL9NgzI1C+uGNFUMaGSSX0c0zipQ6kKvT9XxQmnUn+X5ssacLs+VlmRBaKd3aOz3tyLsQyaKAP8cbU27c0cVDeg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH3PR12MB8308.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(396003)(376002)(346002)(39860400002)(136003)(366004)(451199021)(31686004)(6916009)(44832011)(2906002)(41300700001)(316002)(4326008)(8676002)(66556008)(66946007)(66476007)(5660300002)(8936002)(6486002)(53546011)(186003)(6506007)(2616005)(26005)(83380400001)(6512007)(31696002)(86362001)(6666004)(478600001)(36756003)(38100700002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dTZKZjlqL21HWS9CMTdWRGNtWSsrNUw2WVdnMmRmd2xWUmdJOW5sY2pIdUZ6?= =?utf-8?B?RzlnMitPOTN6QkRjYWdLMmRnODFWUDdjQ2pxVlA0MEt2NmZ3OEZtWDFBZUFa?= =?utf-8?B?dkVTVXh0QXJPcDdqcXh2NnpjOGxyZEo0R29NU3MwUU5hcUtLbS9yOEhOR255?= =?utf-8?B?ZE1GU3ZnS291MG95VDNZVzM3djlLd3Fkb1FsMlRMaE9QdDkxRVNnWm5HdFEv?= =?utf-8?B?emV1NUg3c1FmVmhPNm9PMDA1VW5oc0dRZnJ4YzRkYUR2R0hyaE5iWDg5QTVT?= =?utf-8?B?RGFzckU0WGliSWhEcTYrMVppUllncGhRUFVGbmpUcEUzK2oyVmVD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lrJhfdoocb6eI?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cb88846-699f-49a9-d5ef-08db62cabf62 X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB8308.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2023 18:05:13.8320 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ICj+ML9Ih9AX59zLTWseM1XS3tZcWZ49ojgWyL7EfAxulTQJagomw7lXqp9R4r+w X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5654 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 Hi David, On 6/1/2023 8:55 PM, David Marchand wrote: > > On Thu, May 25, 2023 at 12:08 PM Nipun Gupta wrote: >> >> Have total number of IRQ count support in interrupt handle. >> In case of VFIO this IRQ count is returned when >> VFIO_DEVICE_GET_IRQ_INFO ioctl is invoked. This IRQ_count can >> used by the devices to store/provide total number of interrupts >> available and to enable or disable these interrupts. >> >> Signed-off-by: Nipun Gupta >> Acked-by: Ferruh Yigit >> --- >> lib/eal/common/eal_common_interrupts.c | 21 +++++++++++++++++ >> lib/eal/common/eal_interrupts.h | 1 + >> lib/eal/include/rte_interrupts.h | 32 ++++++++++++++++++++++++++ >> lib/eal/version.map | 2 ++ >> 4 files changed, 56 insertions(+) >> >> diff --git a/lib/eal/common/eal_common_interrupts.c b/lib/eal/common/eal_common_interrupts.c >> index 97b64fed58..a0167d9ad4 100644 >> --- a/lib/eal/common/eal_common_interrupts.c >> +++ b/lib/eal/common/eal_common_interrupts.c >> @@ -398,6 +398,27 @@ int rte_intr_elist_index_set(struct rte_intr_handle *intr_handle, >> return -rte_errno; >> } >> >> +int rte_intr_irq_count_set(struct rte_intr_handle *intr_handle, >> + int irq_count) >> +{ >> + CHECK_VALID_INTR_HANDLE(intr_handle); >> + >> + intr_handle->irq_count = irq_count; >> + >> + return 0; >> +fail: >> + return -rte_errno; >> +} >> + >> +int rte_intr_irq_count_get(const struct rte_intr_handle *intr_handle) >> +{ >> + CHECK_VALID_INTR_HANDLE(intr_handle); >> + >> + return intr_handle->irq_count; >> +fail: >> + return -rte_errno; >> +} >> + >> int rte_intr_vec_list_alloc(struct rte_intr_handle *intr_handle, >> const char *name, int size) >> { >> diff --git a/lib/eal/common/eal_interrupts.h b/lib/eal/common/eal_interrupts.h >> index 482781b862..eaf8e20187 100644 >> --- a/lib/eal/common/eal_interrupts.h >> +++ b/lib/eal/common/eal_interrupts.h >> @@ -16,6 +16,7 @@ struct rte_intr_handle { >> }; >> uint32_t alloc_flags; /**< flags passed at allocation */ >> enum rte_intr_handle_type type; /**< handle type */ >> + uint32_t irq_count; /**< Total IRQ count */ >> uint32_t max_intr; /**< max interrupt requested */ >> uint32_t nb_efd; /**< number of available efd(event fd) */ >> uint8_t efd_counter_size; /**< size of efd counter, used for vdev */ >> diff --git a/lib/eal/include/rte_interrupts.h b/lib/eal/include/rte_interrupts.h >> index 487e3c8875..415d1fcac0 100644 >> --- a/lib/eal/include/rte_interrupts.h >> +++ b/lib/eal/include/rte_interrupts.h >> @@ -506,6 +506,38 @@ __rte_internal >> int >> rte_intr_max_intr_get(const struct rte_intr_handle *intr_handle); >> >> +/** >> + * @internal >> + * Set the IRQ count field of interrupt handle with user >> + * provided IRQ count value. > > I am intrigued by this new notion. > We already have different sizes in the intr_handle, why do we need a new one? > > Plus, in the cdx patch using this new API, I see that an fd array is > filled based on nb_efd. > So it seems to me that this new irq_count is just a duplicate of nb_efd. The API rte_intr_efd_enable() sets the nb_efd and max_intr to values provided by the caller (+ NB_OTHER_INTR for max_intr). These values are dependent on the number of interrupts which are enabled by any DPDK driver rather than the actual number of interrupts supported or provided by the Linux driver. With CDX bus the devices can have interrupts which are not really bound by the number of queues, and as these devices are programmable (FPGA based), users are free to implement the interrupts as per the need. I need to provide the total number of interrupts supported by the device to the drivers. nb_intr is also there, which is default initialized by RTE_MAX_RXTX_INTR_VEC_ID, due to which this does not seem to be best fit. Though as per the meaning it shall represent the total number of interrupts supported by the device. Maybe we can remove the default value and use this as a total interrupt count supported for the device? w.r.t. comments on the other patches, I will fix them in the next respin. Regards, Nipun > > >> + * @param intr_handle >> + * pointer to the interrupt handle. >> + * @param irq_count >> + * IRQ count >> + * >> + * @return >> + * - On success, zero. >> + * - On failure, a negative value and rte_errno is set. >> + */ >> +__rte_internal >> +int >> +rte_intr_irq_count_set(struct rte_intr_handle *intr_handle, int irq_count); >> + > > > -- > David Marchand >