ACK: [PATCH] pci: maxreadreq: skip test if /sys/bus/pci/devices is not available
Alex Hung
alex.hung at canonical.com
Wed May 6 03:47:56 UTC 2015
On 04/30/2015 05:03 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Rather than exiting with an error we should skip this test if
> /sys/bus/pci/devices does not exit, for example, on an ARM64 in a VM.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/pci/maxreadreq/maxreadreq.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/src/pci/maxreadreq/maxreadreq.c b/src/pci/maxreadreq/maxreadreq.c
> index 93745a4..ea9db36 100644
> --- a/src/pci/maxreadreq/maxreadreq.c
> +++ b/src/pci/maxreadreq/maxreadreq.c
> @@ -32,6 +32,16 @@
> #include <fcntl.h>
> #include <inttypes.h>
>
> +static int maxreadreq_init(fwts_framework *fw)
> +{
> + if (access(FWTS_PCI_DEV_PATH, R_OK) < 0) {
> + fwts_log_info(fw, "Could not access %s, skipping test",
> + FWTS_PCI_DEV_PATH);
> + return FWTS_SKIP;
> + }
> + return FWTS_OK;
> +}
> +
> /*
> * This test checks if MaxReadReq is set > 128 for non-internal stuff
> * A too low value hurts performance
> @@ -141,6 +151,7 @@ static fwts_framework_minor_test maxreadreq_tests[] = {
> };
>
> static fwts_framework_ops maxreadreq_ops = {
> + .init = maxreadreq_init,
> .description = "Test firmware has set PCI Express MaxReadReq to a higher value on non-motherboard devices.",
> .minor_tests = maxreadreq_tests
> };
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list