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 214D242C05; Thu, 1 Jun 2023 17:25:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A0DD840EF0; Thu, 1 Jun 2023 17:25:45 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id D49C640DDC for ; Thu, 1 Jun 2023 17:25:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685633144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S1OyCPYlSBoWUoEiICsKKQQMxoO95oFdGAz9dicLwmY=; b=CHtCEnLEmW9LEWjwine6qvNeo/+yL/waTuQeIsIDdB24JFS6j4X1FjZqI93XC7PI7eCWX7 AT67hpwju2qZ3uYESiOyHzowoQ19VLdzpT+jenGOCGquaA6pTXsJqnkWXv9RxRVC8Y2kLk /3mg9Nefl05v+VNFpxZKiy7UUgZ7Hts= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-43-UQxjKlS9PEyRcm5VpG8mHg-1; Thu, 01 Jun 2023 11:25:43 -0400 X-MC-Unique: UQxjKlS9PEyRcm5VpG8mHg-1 Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-1b0116fefffso3419985ad.2 for ; Thu, 01 Jun 2023 08:25:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685633142; x=1688225142; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S1OyCPYlSBoWUoEiICsKKQQMxoO95oFdGAz9dicLwmY=; b=RCOT2zX14DNiBrz82RZyRPHa7YrONN82+ufEDxCnzqBglOyZwgXQBsQeShUf87eIT2 rPjOGu3/eSwuMBUztbS0sxkWZG8eC+qDdZUA/+PG/L4SMVQulNeuVNTp+EQxPTssjBdh Lk77MA0AlItNWzRr1o/mdWdzTA90YgdDx4r7LpOlt1D8RkdKwMDGGer87CJWJo8dmnbm tGCp6VqIumKkZXF2H6J5lWePZGxbGT0YIS/ICpHlFBwNGqnNdvrhO0qf00aGNf7PRIMx y2hMVdbhcMS6cZ8s7cYgnfaY94UuCnWrFDiTWIT6LckQoH0ppP7AGH5FvvmCdL8APRju 8jGg== X-Gm-Message-State: AC+VfDwz0593Gw7Jd+j5m/Jpkxd8YKYCRz7g1Wwe/LZcCG5hzCIAMvaQ ZW6uAfJJbzA+RgNw3PeceFlCxL93lKKfR816goa6Wa8VH9NmwBGfQLMwhmtR9Z9409mjXwpxHXw /f0l+WAy11JnVRh4qWmI= X-Received: by 2002:a17:902:7d90:b0:1af:f4f5:6fa3 with SMTP id a16-20020a1709027d9000b001aff4f56fa3mr5113712plm.55.1685633141962; Thu, 01 Jun 2023 08:25:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ50EzN8ZlWEzxNmhFxDVYL1aUW6vCkrS+i3oO1c2Gy+wCW10GPCw/R/acp7BUlFWknLQYjqRIteNgUuVpeUemg= X-Received: by 2002:a17:902:7d90:b0:1af:f4f5:6fa3 with SMTP id a16-20020a1709027d9000b001aff4f56fa3mr5113696plm.55.1685633141688; Thu, 01 Jun 2023 08:25:41 -0700 (PDT) MIME-Version: 1.0 References: <20230124140746.594066-1-nipun.gupta@amd.com> <20230525100821.12148-1-nipun.gupta@amd.com> <20230525100821.12148-4-nipun.gupta@amd.com> In-Reply-To: <20230525100821.12148-4-nipun.gupta@amd.com> From: David Marchand Date: Thu, 1 Jun 2023 17:25:30 +0200 Message-ID: Subject: Re: [PATCH v5 3/5] eal/interrupts: add IRQ count in interrupt handle To: Nipun Gupta 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Thu, May 25, 2023 at 12:08=E2=80=AFPM 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 =3D 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_interru= pts.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_inter= rupts.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 on= e? 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. > + * @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_coun= t); > + --=20 David Marchand