From: Frank Li <Frank.li@nxp.com>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: "Jon Mason" <jdmason@kudzu.us>,
"Dave Jiang" <dave.jiang@intel.com>,
"Allen Hubbe" <allenbh@gmail.com>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
ntb@lists.linux.dev, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] PCI: endpoint: pci-epf-vntb: Align mw naming with config names
Date: Tue, 3 Jun 2025 15:43:27 -0400 [thread overview]
Message-ID: <aD9QX767hHbCvFHQ@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20250603-pci-vntb-bar-mapping-v2-2-fc685a22ad28@baylibre.com>
On Tue, Jun 03, 2025 at 07:03:39PM +0200, Jerome Brunet wrote:
> The config file related to the memory windows start the numbering of
> the MW from 1. The other NTB function does the same, yet the enumeration
> defining the BARs of the vNTB function starts numbering the MW from 0.
>
> Both numbering are fine I suppose but mixing the two is a bit confusing.
> The configfs file being the interface with userspace, lets keep that stable
> and consistently start the numbering of the MW from 1.
>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> ---
> drivers/pci/endpoint/functions/pci-epf-vntb.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> index 35fa0a21fc91100a5539bff775e7ebc25e1fb9c1..2198282a80a40774047502a37f0288ca396bdb0e 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> @@ -70,9 +70,9 @@ static struct workqueue_struct *kpcintb_workqueue;
> enum epf_ntb_bar {
> BAR_CONFIG,
> BAR_DB,
> - BAR_MW0,
> BAR_MW1,
> BAR_MW2,
> + BAR_MW3,
> };
>
> /*
> @@ -576,7 +576,7 @@ static int epf_ntb_mw_bar_init(struct epf_ntb *ntb)
>
> for (i = 0; i < ntb->num_mws; i++) {
> size = ntb->mws_size[i];
> - barno = ntb->epf_ntb_bar[BAR_MW0 + i];
> + barno = ntb->epf_ntb_bar[BAR_MW1 + i];
>
> ntb->epf->bar[barno].barno = barno;
> ntb->epf->bar[barno].size = size;
> @@ -629,7 +629,7 @@ static void epf_ntb_mw_bar_clear(struct epf_ntb *ntb, int num_mws)
> int i;
>
> for (i = 0; i < num_mws; i++) {
> - barno = ntb->epf_ntb_bar[BAR_MW0 + i];
> + barno = ntb->epf_ntb_bar[BAR_MW1 + i];
> pci_epc_clear_bar(ntb->epf->epc,
> ntb->epf->func_no,
> ntb->epf->vfunc_no,
> @@ -676,7 +676,7 @@ static int epf_ntb_init_epc_bar(struct epf_ntb *ntb)
> epc_features = pci_epc_get_features(ntb->epf->epc, ntb->epf->func_no, ntb->epf->vfunc_no);
>
> /* These are required BARs which are mandatory for NTB functionality */
> - for (bar = BAR_CONFIG; bar <= BAR_MW0; bar++, barno++) {
> + for (bar = BAR_CONFIG; bar <= BAR_MW1; bar++, barno++) {
> barno = pci_epc_get_next_free_bar(epc_features, barno);
> if (barno < 0) {
> dev_err(dev, "Fail to get NTB function BAR\n");
> @@ -1048,7 +1048,7 @@ static int vntb_epf_mw_set_trans(struct ntb_dev *ndev, int pidx, int idx,
> struct device *dev;
>
> dev = &ntb->ntb.dev;
> - barno = ntb->epf_ntb_bar[BAR_MW0 + idx];
> + barno = ntb->epf_ntb_bar[BAR_MW1 + idx];
> epf_bar = &ntb->epf->bar[barno];
> epf_bar->phys_addr = addr;
> epf_bar->barno = barno;
>
> --
> 2.47.2
>
next prev parent reply other threads:[~2025-06-03 19:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 17:03 [PATCH v2 0/3] PCI: endpoint: pci-epf-vntb: allow arbitrary BAR mapping Jerome Brunet
2025-06-03 17:03 ` [PATCH v2 1/3] PCI: endpoint: pci-epf-vntb: Return an error code on bar init Jerome Brunet
2025-06-03 17:03 ` [PATCH v2 2/3] PCI: endpoint: pci-epf-vntb: Align mw naming with config names Jerome Brunet
2025-06-03 19:43 ` Frank Li [this message]
2025-06-03 17:03 ` [PATCH v2 3/3] PCI: endpoint: pci-epf-vntb: Allow BAR assignment via configfs Jerome Brunet
2025-06-03 19:46 ` Frank Li
2025-06-30 20:38 ` Bjorn Helgaas
2025-07-01 7:37 ` Jerome Brunet
2025-06-23 12:06 ` [PATCH v2 0/3] PCI: endpoint: pci-epf-vntb: allow arbitrary BAR mapping Manivannan Sadhasivam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aD9QX767hHbCvFHQ@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=allenbh@gmail.com \
--cc=bhelgaas@google.com \
--cc=dave.jiang@intel.com \
--cc=jbrunet@baylibre.com \
--cc=jdmason@kudzu.us \
--cc=kishon@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=ntb@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®