Re: [PATCH] PCI: endpoint: pci-epf-test: Allow overriding default BAR sizes

Niklas Cassel
2026-01-27T09:47:57Z

On Tue, Jan 27, 2026 at 12:44:13PM +0900, Koichiro Den wrote:
> On Fri, Jan 23, 2026 at 07:07:48PM +0100, Niklas Cassel wrote:
> > Add bar{0,1,2,3,4,5}_size attributes in configfs, so that the user is not
> > restricted to run pci-epf-test with the hardcoded BAR size values defined
> > in pci-epf-test.c.
> >
> > This code is shamelessly more or less copy pasted from pci-epf-vntb.c
> >
> > Signed-off-by: Niklas Cassel <cassel@kernel.org>
>
> This is useful, thanks!
> I've used this patch as a dependency for my series [1], and it works fine.
>
> Tested-by: Koichiro Den <den@valinux.co.jp>
>
> [1] https://lore.kernel.org/linux-pci/20260124145012.2794108-1-den@valinux.co.jp/

Thank you for testing!

Just to clarify:
Your series is currently not depending on this patch, and neither do I think
that it should.

There will be a trivial conflict when PCI maintainers will try to merge them.

But the solution is to use your new values:

-static size_t bar_size[] = { 512, 512, 1024, 16384, 131072, 1048576 };
+static size_t bar_size[] = { 131072, 131072, 131072, 131072, 131072, 1048576 };

With my new variable name (default_bar_size):

-static size_t bar_size[] = { 512, 512, 1024, 16384, 131072, 1048576 };
+/* default BAR sizes, can be overridden by the user using configfs */
+static size_t default_bar_size[] = { 512, 512, 1024, 16384, 131072, 1048576 };

So AFAICT, it should a one line conflict resolution.

Since it is so trivial, it would be nice if the PCI maintainers could
handle that when applying, but I guess in worst case, one of us will
need to respin.

Kind regards,
Niklas