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 8132745A11; Mon, 23 Sep 2024 17:47:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14037402CB; Mon, 23 Sep 2024 17:47:52 +0200 (CEST) Received: from mail-oo1-f48.google.com (mail-oo1-f48.google.com [209.85.161.48]) by mails.dpdk.org (Postfix) with ESMTP id BB0E74027C for ; Mon, 23 Sep 2024 17:47:50 +0200 (CEST) Received: by mail-oo1-f48.google.com with SMTP id 006d021491bc7-5e1bf327af8so2142705eaf.2 for ; Mon, 23 Sep 2024 08:47:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727106470; x=1727711270; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wrtht9zWE54uz8l9uY072jDveJlBOmJImXvR+qg5+6Q=; b=ESdcY9dXDiTNvlu4w6CFpqvM3vU2FnFY5FNJqn3l4XnPkoVzEE8UPm8evOPw/IWXZj A41Gd+zmPNFMDGhyh8TOYvQ/wkTJwegx28SmDJ5cnWLpY55Nj2bz9FqqR5IPXazIY6Tc wmDRMIWCA/jHZQPae8KZ1sts4QahIq2JzkQsoSBFhFhLvKidcH+7rKk5yWlddK1TF77F 7OSSvkI4eSseFYO/4vBK038lduKhI80joacyvVaDk2dF2MDxOCIwhCagMh1ms5j2o7iT 1ObmgLgTsKFwsLxULdY6X6EXJNpY7E+40iAZMKf8pNuQaDZUFoAK+AX6vl7CViwTJX9t 9TcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727106470; x=1727711270; 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=wrtht9zWE54uz8l9uY072jDveJlBOmJImXvR+qg5+6Q=; b=kRQc1aw233y/xVy2X5kam4b7RpL3HS2rN7tA5WnxBmGOkJLkBtkLXTwVob34PITT6u iwBjF/Y8NB45A0kGDdposs0PT2BBmUYuoLMl4F3WDCqntA081NtG0gm1y3PuBL2ZoDtg zgytJEMetG0PLxPafI9F8ifZw7Gl403INla4b0a78WaHIsObOrFTDsV/0RlcYNUYHY+t 10BPQUpxD3VSrBSNSaJ9PVdt46iRQ/ZXKfZ3ZkQ2tDoszXwg0nqqQ6sjIdje3kwbXUTG +/sxpl7zICNO6XEQK3KzjYHgC1cguM/JOsyzu+Jc5cqPkqZmrNvxcGKdEd7hp6z9sALv xB+g== X-Forwarded-Encrypted: i=1; AJvYcCUU+yPRaeGpiuc26DKM2KJLD1MArM+j76jdiR+heqZRWrjVha4UjnELW4fEluKrN/0GCDY=@dpdk.org X-Gm-Message-State: AOJu0YxUjgmQOH/WHYFeKe7bvL5pJKna0Z9Ilva+Blt/2lI2lM57sUq+ jBnaV6GasxWvvvoHrtretIdMVd3SwVbI/FfdQ+c2/YnNCMf/gq6T/t7NjFLaZL6hfVchrIuA3g1 PH8lLwnhPSbu7hIX8ysI04h46uqU= X-Google-Smtp-Source: AGHT+IEwB4Z56S4ZWcslI5bPcke1M/4WSXphIlfDPZZLv1eWSoeyfqMKUXzV7eEMYAafwj1d6eAazWQstdvhG0chso8= X-Received: by 2002:a05:6358:6f84:b0:1b1:a7f4:fee4 with SMTP id e5c5f4694b2df-1bc975e5cc7mr257210155d.14.1727106469693; Mon, 23 Sep 2024 08:47:49 -0700 (PDT) MIME-Version: 1.0 References: <20240906142557.13893-1-pbhagavatula@marvell.com> <20240919180243.1255-1-pbhagavatula@marvell.com> In-Reply-To: <20240919180243.1255-1-pbhagavatula@marvell.com> From: Jerin Jacob Date: Mon, 23 Sep 2024 21:17:23 +0530 Message-ID: Subject: Re: [PATCH v2] common/cnxk: unregister IRQ before reconfigure To: pbhagavatula@marvell.com Cc: jerinj@marvell.com, Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra , dev@dpdk.org 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, Sep 19, 2024 at 11:33=E2=80=AFPM wrote: > > From: Pavan Nikhilesh > > Unregister SSO device and NPA IRQs before resizing > them. > > Signed-off-by: Pavan Nikhilesh # Add fixes: tag # Change commit message to common/cnxk: fix... > --- > v2 Changes: > - Reorder npa interrupt un-registration. > > drivers/common/cnxk/roc_dev.c | 16 +++++++--------- > drivers/common/cnxk/roc_dev_priv.h | 2 ++ > drivers/common/cnxk/roc_sso.c | 7 +++++++ > 3 files changed, 16 insertions(+), 9 deletions(-) > > diff --git a/drivers/common/cnxk/roc_dev.c b/drivers/common/cnxk/roc_dev.= c > index daf7684d8e..4a5787e7f9 100644 > --- a/drivers/common/cnxk/roc_dev.c > +++ b/drivers/common/cnxk/roc_dev.c > @@ -1017,8 +1017,8 @@ mbox_unregister_vf_irq(struct plt_pci_device *pci_d= ev, struct dev *dev) > RVU_VF_INT_VEC_MBOX); > } > > -static void > -mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev) > +void > +dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev *dev) > { > if (dev_is_vf(dev)) > mbox_unregister_vf_irq(pci_dev, dev); > @@ -1096,8 +1096,8 @@ roc_pf_vf_flr_irq(void *param) > } > } > > -static int > -vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *dev) > +void > +dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct dev *d= ev) > { > struct plt_intr_handle *intr_handle =3D pci_dev->intr_handle; > int i; > @@ -1113,8 +1113,6 @@ vf_flr_unregister_irqs(struct plt_pci_device *pci_d= ev, struct dev *dev) > > dev_irq_unregister(intr_handle, roc_pf_vf_flr_irq, dev, > RVU_PF_INT_VEC_VFFLR1); > - > - return 0; > } > > int > @@ -1600,7 +1598,7 @@ dev_init(struct dev *dev, struct plt_pci_device *pc= i_dev) > iounmap: > dev_vf_mbase_put(pci_dev, vf_mbase); > mbox_unregister: > - mbox_unregister_irq(pci_dev, dev); > + dev_mbox_unregister_irq(pci_dev, dev); > if (dev->ops) > plt_free(dev->ops); > mbox_fini: > @@ -1636,10 +1634,10 @@ dev_fini(struct dev *dev, struct plt_pci_device *= pci_dev) > if (dev->lmt_mz) > plt_memzone_free(dev->lmt_mz); > > - mbox_unregister_irq(pci_dev, dev); > + dev_mbox_unregister_irq(pci_dev, dev); > > if (!dev_is_vf(dev)) > - vf_flr_unregister_irqs(pci_dev, dev); > + dev_vf_flr_unregister_irqs(pci_dev, dev); > /* Release PF - VF */ > mbox =3D &dev->mbox_vfpf; > if (mbox->hwbase && mbox->dev) > diff --git a/drivers/common/cnxk/roc_dev_priv.h b/drivers/common/cnxk/roc= _dev_priv.h > index 50e12cbf17..df7dc222ed 100644 > --- a/drivers/common/cnxk/roc_dev_priv.h > +++ b/drivers/common/cnxk/roc_dev_priv.h > @@ -131,6 +131,8 @@ int dev_irqs_disable(struct plt_intr_handle *intr_han= dle); > int dev_irq_reconfigure(struct plt_intr_handle *intr_handle, uint16_t ma= x_intr); > > int dev_mbox_register_irq(struct plt_pci_device *pci_dev, struct dev *de= v); > +void dev_mbox_unregister_irq(struct plt_pci_device *pci_dev, struct dev = *dev); > int dev_vf_flr_register_irqs(struct plt_pci_device *pci_dev, struct dev = *dev); > +void dev_vf_flr_unregister_irqs(struct plt_pci_device *pci_dev, struct d= ev *dev); > > #endif /* _ROC_DEV_PRIV_H */ > diff --git a/drivers/common/cnxk/roc_sso.c b/drivers/common/cnxk/roc_sso.= c > index 293b0c81a1..7d45b06dda 100644 > --- a/drivers/common/cnxk/roc_sso.c > +++ b/drivers/common/cnxk/roc_sso.c > @@ -842,7 +842,14 @@ sso_update_msix_vec_count(struct roc_sso *roc_sso, u= int16_t sso_vec_cnt) > return dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec= _cnt + npa_vec_cnt); > } > > + /* Before re-configuring unregister irqs */ > npa_vec_cnt =3D (dev->npa.pci_dev =3D=3D pci_dev) ? NPA_LF_INT_VE= C_POISON + 1 : 0; > + if (npa_vec_cnt) > + npa_unregister_irqs(&dev->npa); > + > + dev_mbox_unregister_irq(pci_dev, dev); > + if (!dev_is_vf(dev)) > + dev_vf_flr_unregister_irqs(pci_dev, dev); > > /* Re-configure to include SSO vectors */ > rc =3D dev_irq_reconfigure(pci_dev->intr_handle, mbox_vec_cnt + n= pa_vec_cnt + sso_vec_cnt); > -- > 2.25.1 >