Commit 2ed4b36d authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

nfp: shorten CPP core probe logs

We currently print reserved BAR mappings info as we create them.
This makes the probe logs longer than necessary.  Print into a
buffer instead and log all the info as a single line.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8b3d5a47
...@@ -588,9 +588,15 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface) ...@@ -588,9 +588,15 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface)
NFP_PCIE_BAR_PCIE2CPP_MapType( NFP_PCIE_BAR_PCIE2CPP_MapType(
NFP_PCIE_BAR_PCIE2CPP_MapType_EXPLICIT3), NFP_PCIE_BAR_PCIE2CPP_MapType_EXPLICIT3),
}; };
char status_msg[196] = {};
struct nfp_bar *bar; struct nfp_bar *bar;
int i, bars_free; int i, bars_free;
int expl_groups; int expl_groups;
char *msg, *end;
msg = status_msg +
snprintf(status_msg, sizeof(status_msg) - 1, "RESERVED BARs: ");
end = status_msg + sizeof(status_msg) - 1;
bar = &nfp->bar[0]; bar = &nfp->bar[0];
for (i = 0; i < ARRAY_SIZE(nfp->bar); i++, bar++) { for (i = 0; i < ARRAY_SIZE(nfp->bar); i++, bar++) {
...@@ -637,8 +643,7 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface) ...@@ -637,8 +643,7 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface)
bar->iomem = ioremap_nocache(nfp_bar_resource_start(bar), bar->iomem = ioremap_nocache(nfp_bar_resource_start(bar),
nfp_bar_resource_len(bar)); nfp_bar_resource_len(bar));
if (bar->iomem) { if (bar->iomem) {
dev_info(nfp->dev, msg += snprintf(msg, end - msg, "0.0: General/MSI-X SRAM, ");
"BAR0.0 RESERVED: General Mapping/MSI-X SRAM\n");
atomic_inc(&bar->refcnt); atomic_inc(&bar->refcnt);
bars_free--; bars_free--;
...@@ -665,7 +670,7 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface) ...@@ -665,7 +670,7 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface)
/* Configure, and lock, BAR0.1 for PCIe XPB (MSI-X PBA) */ /* Configure, and lock, BAR0.1 for PCIe XPB (MSI-X PBA) */
bar = &nfp->bar[1]; bar = &nfp->bar[1];
dev_info(nfp->dev, "BAR0.1 RESERVED: PCIe XPB/MSI-X PBA\n"); msg += snprintf(msg, end - msg, "0.1: PCIe XPB/MSI-X PBA, ");
atomic_inc(&bar->refcnt); atomic_inc(&bar->refcnt);
bars_free--; bars_free--;
...@@ -684,9 +689,8 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface) ...@@ -684,9 +689,8 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface)
bar->iomem = ioremap_nocache(nfp_bar_resource_start(bar), bar->iomem = ioremap_nocache(nfp_bar_resource_start(bar),
nfp_bar_resource_len(bar)); nfp_bar_resource_len(bar));
if (bar->iomem) { if (bar->iomem) {
dev_info(nfp->dev, msg += snprintf(msg, end - msg,
"BAR0.%d RESERVED: Explicit%d Mapping\n", "0.%d: Explicit%d, ", 4 + i, i);
4 + i, i);
atomic_inc(&bar->refcnt); atomic_inc(&bar->refcnt);
bars_free--; bars_free--;
...@@ -704,8 +708,7 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface) ...@@ -704,8 +708,7 @@ static int enable_bars(struct nfp6000_pcie *nfp, u16 interface)
sort(&nfp->bar[0], nfp->bars, sizeof(nfp->bar[0]), sort(&nfp->bar[0], nfp->bars, sizeof(nfp->bar[0]),
bar_cmp, NULL); bar_cmp, NULL);
dev_info(nfp->dev, "%d NFP PCI2CPP BARs, %d free\n", dev_info(nfp->dev, "%sfree: %d/%d\n", status_msg, bars_free, nfp->bars);
nfp->bars, bars_free);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment