public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Niklas Cassel <cassel@kernel.org>
Cc: "Krzysztof Wilczyński" <kw@linux.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Damien Le Moal" <dlemoal@kernel.org>,
	linux-pci@vger.kernel.org, "Frank Li" <Frank.Li@nxp.com>
Subject: Re: [PATCH v2 0/2] PCI endpoint test: Add support for capabilities
Date: Tue, 26 Nov 2024 18:50:20 +0530	[thread overview]
Message-ID: <20241126132020.efpyad6ldvvwfaki@thinkpad> (raw)
In-Reply-To: <20241121152318.2888179-4-cassel@kernel.org>

On Thu, Nov 21, 2024 at 04:23:19PM +0100, Niklas Cassel wrote:
> Hello all,
> 
> The pci-epf-test driver recently moved to the pci_epc_mem_map() API.
> This API call handle unaligned addresses seamlessly, if the EPC driver
> being used has implemented the .align_addr callback.
> 
> This means that pci-epf-test no longer need any special padding to the
> buffers that is allocated on the host side. (This was only done in order
> to satisfy the EPC's alignment requirements.)
> 
> In fact, to test that the pci_epc_mem_map() API is working as intended,
> it is important that the host side does not only provide buffers that
> are nicely aligned.
> 

I don't agree with the idea of testing the endpoint internal API behavior with
the pci_endpoint_test driver. The driver is supposed to test the functionality
of the endpoint, which it already does. By adding these kind of checks, we are
just going to make the driver bloat.

I suppose if the API behavior is wrong, then it should be caught in the existing
READ/WRITE tests, no?

> However, since not all EPC drivers have implemented the .align_addr
> callback, add support for capabilities in pci-epf-test, and if the
> EPC driver implements the .align_addr callback, set a new
> CAP_UNALIGNED_ACCESS capability. If CAP_UNALIGNED_ACCESS is set, do not
> allocate overly sized buffers on the host side.
> 

This also feels wrong to me. The host driver should care about the alignment
restrictions of the endpoint and then allocate the buffers accordingly, not the
other way.

That being said, I really like to get rid of the hardcoded
'pci_endpoint_test_data::alignment' field and make the driver learn about it
dynamically. I'm just thinking out loud here.

- Mani
 
-- 
மணிவண்ணன் சதாசிவம்

  parent reply	other threads:[~2024-11-26 13:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21 15:23 [PATCH v2 0/2] PCI endpoint test: Add support for capabilities Niklas Cassel
2024-11-21 15:23 ` [PATCH v2 1/2] PCI: endpoint: pci-epf-test: " Niklas Cassel
2024-11-21 19:38   ` Frank Li
2024-11-30  8:12   ` Manivannan Sadhasivam
2024-12-03  4:43     ` Niklas Cassel
2024-12-08 12:42       ` Manivannan Sadhasivam
2024-12-12  8:49         ` Niklas Cassel
2024-11-21 15:23 ` [PATCH v2 2/2] misc: pci_endpoint_test: " Niklas Cassel
2024-11-21 19:43   ` Frank Li
2024-11-25 15:17     ` Niklas Cassel
2024-11-30  8:21   ` Manivannan Sadhasivam
2024-12-03  4:48     ` Niklas Cassel
2024-11-26 13:20 ` Manivannan Sadhasivam [this message]
2024-11-27 11:23   ` [PATCH v2 0/2] PCI endpoint test: " Niklas Cassel
2024-11-27 11:32     ` Niklas Cassel
2024-11-27 11:55       ` Niklas Cassel
2024-11-27 11:40     ` Damien Le Moal
2024-11-30  8:05     ` 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=20241126132020.efpyad6ldvvwfaki@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=Frank.Li@nxp.com \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-pci@vger.kernel.org \
    /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