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 A00AEA0548; Wed, 3 Nov 2021 16:11:18 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E04941153; Wed, 3 Nov 2021 16:11:18 +0100 (CET) Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by mails.dpdk.org (Postfix) with ESMTP id 3677D41134 for ; Wed, 3 Nov 2021 16:11:16 +0100 (CET) Received: by mail-il1-f173.google.com with SMTP id w15so2883255ill.2 for ; Wed, 03 Nov 2021 08:11:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HvH7GbqGVNd+mZbHao37LjaRwJwswCmGnEvHAP84AyI=; b=UzxT/sWb+LKutOtFW0IZ2HdB8Uz3W05NVvbTWSBk6q6tNfWBIDLEAp9m2XthoZ1e7Z r7F75Xjnz8UhlfDd6jwETEa3udpuhxYR1dq7OQfdOGUIqY0OFjHSsv6hV963cS2kJ3FP VwBo+TkKWFg45lIxIG0QJfHkLF/t7jYz6rTFpE3JGtmhFAzkWi6orWMc4xDragyozZ2a bdpWEuGWsT0F/v1OZd0R2E3I0AiCJFW/w/rR5M72lFD9pAwvNv4cBW9SFRD1jakCUqp1 D4QmvsR7HatqBmIRfGDEPHJsyPHjrmGWYYQ5HzVl/XHGwYykHum9RLDGj9K1t4U7dECN iTUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HvH7GbqGVNd+mZbHao37LjaRwJwswCmGnEvHAP84AyI=; b=xz1WO1JFk8mm8eVbdXj53BWLuV5PmK0xBeFWoq482sUigaqrajHSvoAQTxykoAHadq 7nCe0f3HRB7rm5EShV4vbldotJawjDB8F6pTUwiJOeN+xNigcY3xofvWdbhYC7O9F9QL uyXrfc86tMiY7rUYjXVhiUQZ5QeItIGK0K9BvKmIv8bpsToSMRDp3u2apd9ZMZe3B4GZ ROGoP8LED07Lx07YW7Pqul1Rhi5qv9ZKI/QPYHzjIXI4O3ORfclEwqEraHsF/EgbzHFU g9V4iJr8nVbDa1CV0xo0wYma11XhqHRS1ugyI/MDn7IRYbOka0XDEZfdTMN2Oget0b/3 msoA== X-Gm-Message-State: AOAM533KhibVe7E6J4EAuV/JmaLQpBRDyipXohQxQgEuHR2eqIdkVqLW WTVXfdCyuhsy/RcS4QPGET7nJ/59w5Aq1KG3Qxo= X-Google-Smtp-Source: ABdhPJxE5HNtk3dm3zn2ZXFdlca7aseGGj0fr/A1jIqCGTbpwPxEhVAq8zNZaks1E2tsX/IVutdW45i02sjjCV/cxaQ= X-Received: by 2002:a05:6e02:1aac:: with SMTP id l12mr2613751ilv.295.1635952275511; Wed, 03 Nov 2021 08:11:15 -0700 (PDT) MIME-Version: 1.0 References: <20211101174407.81854-1-hkalra@marvell.com> <20211103075915.109838-1-hkalra@marvell.com> In-Reply-To: <20211103075915.109838-1-hkalra@marvell.com> From: Jerin Jacob Date: Wed, 3 Nov 2021 20:40:49 +0530 Message-ID: To: Harman Kalra Cc: dpdk-dev , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2] common/cnxk: fix device MSIX greater than default value 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" On Wed, Nov 3, 2021 at 1:29 PM Harman Kalra wrote: > > Handling the case where number of MSIX interrupts are greater > than default value i.e. PLT_MAX_RXTX_INTR_VEC_ID. On PCI probe > device is queried for supported MSIX interrupts, and respective > interrupt resources are reallocated with this value. Same MSIX > count should be used while registering new interrupt vectors. > > Fixes: 8cb5d08db940 ("interrupts: extend event list") > > Signed-off-by: Harman Kalra Acked-by: Jerin Jacob Applied to dpdk-next-net-mrvl/for-next-net. Thanks > --- > V2: > * Corrected fixes commit which actually introduced this issue. > > drivers/common/cnxk/roc_irq.c | 13 +++---------- > 1 file changed, 3 insertions(+), 10 deletions(-) > > diff --git a/drivers/common/cnxk/roc_irq.c b/drivers/common/cnxk/roc_irq.c > index 3b34467b96..7a24297d72 100644 > --- a/drivers/common/cnxk/roc_irq.c > +++ b/drivers/common/cnxk/roc_irq.c > @@ -14,7 +14,8 @@ > #include > > #define MSIX_IRQ_SET_BUF_LEN \ > - (sizeof(struct vfio_irq_set) + sizeof(int) * (PLT_MAX_RXTX_INTR_VEC_ID)) > + (sizeof(struct vfio_irq_set) + sizeof(int) * \ > + (plt_intr_max_intr_get(intr_handle))) > > static int > irq_get_info(struct plt_intr_handle *intr_handle) > @@ -34,7 +35,7 @@ irq_get_info(struct plt_intr_handle *intr_handle) > plt_base_dbg("Flags=0x%x index=0x%x count=0x%x max_intr_vec_id=0x%x", > irq.flags, irq.index, irq.count, PLT_MAX_RXTX_INTR_VEC_ID); > > - if (irq.count > PLT_MAX_RXTX_INTR_VEC_ID) { > + if (irq.count == 0) { > plt_err("HW max=%d > PLT_MAX_RXTX_INTR_VEC_ID: %d", irq.count, > PLT_MAX_RXTX_INTR_VEC_ID); > plt_intr_max_intr_set(intr_handle, PLT_MAX_RXTX_INTR_VEC_ID); > @@ -92,14 +93,6 @@ irq_init(struct plt_intr_handle *intr_handle) > int32_t *fd_ptr; > uint32_t i; > > - if (plt_intr_max_intr_get(intr_handle) > > - PLT_MAX_RXTX_INTR_VEC_ID) { > - plt_err("Max_intr=%d greater than PLT_MAX_RXTX_INTR_VEC_ID=%d", > - plt_intr_max_intr_get(intr_handle), > - PLT_MAX_RXTX_INTR_VEC_ID); > - return -ERANGE; > - } > - > len = sizeof(struct vfio_irq_set) + > sizeof(int32_t) * plt_intr_max_intr_get(intr_handle); > > -- > 2.18.0 >