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 A715CA0C52; Mon, 25 Oct 2021 12:49:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DB7441123; Mon, 25 Oct 2021 12:49:34 +0200 (CEST) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by mails.dpdk.org (Postfix) with ESMTP id 117B74111B for ; Mon, 25 Oct 2021 12:49:34 +0200 (CEST) Received: by mail-lj1-f182.google.com with SMTP id q16so8471216ljg.3 for ; Mon, 25 Oct 2021 03:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=92+F8zR8kKPP5wkPSPVs2FSAc2RW8HvmWXbKEW5Pjnw=; b=NHlm6ZgHilgbVDQGcmp7bLcUWrdWanwk5zYWagi04MREQwuWf0cvQwgr6koc84CHoG 6F3tCL7vA2lq8QNUQe9b4yYHF1Q0tXyS2T0ZOOrjmdTWZD9E8G9mg7Q8IYzF1Kaww1s7 kz0HEvz27o3Hhd51CKu0Iat8IKWmFdzO+8nhSFbgnHpp83+VCMURq6PENPzBeQFa4BJv FVTeOmfz2/p+ITSvtm5TmzswGxyr9W5LSma+feOQc1p1Vve5JoU1aU50G+/zU2WxS9BJ xzJruT0ClfBmSMHFZk3XDUKjZS62lg/uXZaFbTgIjeTmZGdBFgQHMS84fW6igXI1acX7 0eng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=92+F8zR8kKPP5wkPSPVs2FSAc2RW8HvmWXbKEW5Pjnw=; b=FNjB+Rp1hj9reiO01O9Ug8lwqCt8EN+54UO9NWaMpijFwrPSBZnpNrH4+sYhcPKZzG xuN/1AnXei1v+TRJ3dLVu9IkNMrdGZbL96+mVUUgC239Qg8bhMhzd4jlSV0kCwDhqqH0 HJ0qIrvqW2M25afjXGoYHseU3w47BHgCb/QHM3IoM5+x+tff95SAwCmo/3weRPSouiWx KiBm1LWhFkzA+SsAj5Nbf/pZfPioZid+QAGwWLvckl3UBg5q+O2BOAgg2+/G8lI9Irm6 tjPyiRXTdXLbll2cR46+lM6KbxhtTvjGiuXKIB/haTHc4ZrXjhMyP+WQogVB0+BXPCx0 tqXQ== X-Gm-Message-State: AOAM530n447rHUtes1q83gQYNHIZAz8Pc+TbeR5KzZN/TRqWHBUEpj0s nfZD0KY125zya+W1QdB2zVg= X-Google-Smtp-Source: ABdhPJxNCxy7bqWkH3hbXJIPfqlJthGyLIClL73qqcALaBGp8sU5RmTqYzjZO6wvf1Qbpk6gsFUDig== X-Received: by 2002:a2e:2283:: with SMTP id i125mr19036277lji.305.1635158973699; Mon, 25 Oct 2021 03:49:33 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id j2sm1615856lfe.108.2021.10.25.03.49.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 03:49:33 -0700 (PDT) Date: Mon, 25 Oct 2021 13:49:32 +0300 From: Dmitry Kozlyuk To: David Marchand Cc: hkalra@marvell.com, dev@dpdk.org, Anatoly Burakov , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao Message-ID: <20211025134932.7be9f0f2@sovereign> In-Reply-To: <20211024200449.12024-10-david.marchand@redhat.com> References: <20211022204934.132186-1-hkalra@marvell.com> <20211024200449.12024-1-david.marchand@redhat.com> <20211024200449.12024-10-david.marchand@redhat.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v6 9/9] interrupts: extend event list 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 Sender: "dev" Hi David, With some nits below, Acked-by: Dmitry Kozlyuk 2021-10-24 22:04 (UTC+0200), David Marchand: > From: Harman Kalra > > Dynamically allocating the efds and elist array os intr_handle Typo: "os" -> "of" > structure, based on size provided by user. Eg size can be > MSIX interrupts supported by a PCI device. > > Signed-off-by: Harman Kalra > Signed-off-by: David Marchand > --- > Changes since v5: > - split from patch5, > > --- [...] > diff --git a/lib/eal/common/eal_common_interrupts.c b/lib/eal/common/eal_common_interrupts.c > index 3285c4335f..7feb9da8fa 100644 > --- a/lib/eal/common/eal_common_interrupts.c > +++ b/lib/eal/common/eal_common_interrupts.c [...] > int rte_intr_fd_set(struct rte_intr_handle *intr_handle, int fd) > @@ -239,6 +330,12 @@ int rte_intr_efds_index_get(const struct rte_intr_handle *intr_handle, > { > CHECK_VALID_INTR_HANDLE(intr_handle); > > + if (intr_handle->efds == NULL) { > + RTE_LOG(ERR, EAL, "Event fd list not allocated\n"); > + rte_errno = EFAULT; > + goto fail; > + } > + Here and below: The check for `nb_intr` will already catch not allocated `efds`, because `nb_intr` is necessarily 0 in this case. > if (index >= intr_handle->nb_intr) { > RTE_LOG(ERR, EAL, "Invalid index %d, max limit %d\n", index, > intr_handle->nb_intr); > @@ -256,6 +353,12 @@ int rte_intr_efds_index_set(struct rte_intr_handle *intr_handle, > { > CHECK_VALID_INTR_HANDLE(intr_handle); > > + if (intr_handle->efds == NULL) { > + RTE_LOG(ERR, EAL, "Event fd list not allocated\n"); > + rte_errno = EFAULT; > + goto fail; > + } > + > if (index >= intr_handle->nb_intr) { > RTE_LOG(ERR, EAL, "Invalid size %d, max limit %d\n", index, > intr_handle->nb_intr); > @@ -275,6 +378,12 @@ struct rte_epoll_event *rte_intr_elist_index_get( > { > CHECK_VALID_INTR_HANDLE(intr_handle); > > + if (intr_handle->elist == NULL) { > + RTE_LOG(ERR, EAL, "Event list not allocated\n"); > + rte_errno = EFAULT; > + goto fail; > + } > + > if (index >= intr_handle->nb_intr) { > RTE_LOG(ERR, EAL, "Invalid index %d, max limit %d\n", index, > intr_handle->nb_intr); > @@ -292,6 +401,12 @@ int rte_intr_elist_index_set(struct rte_intr_handle *intr_handle, > { > CHECK_VALID_INTR_HANDLE(intr_handle); > > + if (intr_handle->elist == NULL) { > + RTE_LOG(ERR, EAL, "Event list not allocated\n"); > + rte_errno = EFAULT; > + goto fail; > + } > + > if (index >= intr_handle->nb_intr) { > RTE_LOG(ERR, EAL, "Invalid index %d, max limit %d\n", index, > intr_handle->nb_intr); [...]