lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240607165651.00006554@Huawei.com>
Date: Fri, 7 Jun 2024 16:56:51 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Wei Huang <wei.huang2@....com>
CC: <linux-pci@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<linux-doc@...r.kernel.org>, <netdev@...r.kernel.org>, <bhelgaas@...gle.com>,
	<corbet@....net>, <davem@...emloft.net>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <pabeni@...hat.com>, <alex.williamson@...hat.com>,
	<gospo@...adcom.com>, <michael.chan@...adcom.com>,
	<ajit.khaparde@...adcom.com>, <somnath.kotur@...adcom.com>,
	<andrew.gospodarek@...adcom.com>, <manoj.panicker2@....com>,
	<Eric.VanTassell@....com>, <vadim.fedorenko@...ux.dev>, <horms@...nel.org>,
	<bagasdotme@...il.com>
Subject: Re: [PATCH V2 1/9] PCI: Introduce PCIe TPH support framework

On Fri, 31 May 2024 16:38:33 -0500
Wei Huang <wei.huang2@....com> wrote:

> This patch implements the framework for PCIe TPH support. It introduces
> tph.c source file, along with CONFIG_PCIE_TPH, to Linux PCIe subsystem.
> A new member, named tph_cap, is also introduced in pci_dev to cache TPH
> capability offset.
> 
> Co-developed-by: Eric Van Tassell <Eric.VanTassell@....com>
> Signed-off-by: Eric Van Tassell <Eric.VanTassell@....com>
> Signed-off-by: Wei Huang <wei.huang2@....com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@...adcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@...adcom.com> 
> Reviewed-by: Andy Gospodarek <andrew.gospodarek@...adcom.com>


One trivial comment inline.
With that fixed.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>

> diff --git a/drivers/pci/pcie/tph.c b/drivers/pci/pcie/tph.c
> new file mode 100644
> index 000000000000..5f0cc06b74bb
> --- /dev/null
> +++ b/drivers/pci/pcie/tph.c
> @@ -0,0 +1,28 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * TPH (TLP Processing Hints) support
> + *
> + * Copyright (C) 2024 Advanced Micro Devices, Inc.
> + *     Eric Van Tassell <Eric.VanTassell@....com>
> + *     Wei Huang <wei.huang2@....com>
> + */
> +
> +#define pr_fmt(fmt) "TPH: " fmt
> +#define dev_fmt pr_fmt
> +
> +#include <linux/acpi.h>
> +#include <uapi/linux/pci_regs.h>
> +#include <linux/kernel.h>
> +#include <linux/errno.h>
> +#include <linux/msi.h>
> +#include <linux/pci.h>
> +#include <linux/msi.h>
> +#include <linux/pci-acpi.h>

Introduce headers as you first use them.  That way we can more
easily see if there are unused ones in this list.


> +
> +#include "../pci.h"
> +
> +void pcie_tph_init(struct pci_dev *dev)
> +{
> +	dev->tph_cap = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_TPH);
> +}
> +
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 15168881ec94..1f1ae55a5f83 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2484,6 +2484,7 @@ static void pci_init_capabilities(struct pci_dev *dev)
>  	pci_dpc_init(dev);		/* Downstream Port Containment */
>  	pci_rcec_init(dev);		/* Root Complex Event Collector */
>  	pci_doe_init(dev);		/* Data Object Exchange */
> +	pcie_tph_init(dev);             /* TLP Processing Hints */
>  
>  	pcie_report_downtraining(dev);
>  	pci_init_reset_methods(dev);
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 5bece7fd11f8..d75a88ec5136 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -530,6 +530,10 @@ struct pci_dev {
>  
>  	/* These methods index pci_reset_fn_methods[] */
>  	u8 reset_methods[PCI_NUM_RESET_METHODS]; /* In priority order */
> +
> +#ifdef CONFIG_PCIE_TPH
> +	u16 tph_cap; /* TPH capability offset */
> +#endif
>  };
>  
>  static inline struct pci_dev *pci_physfn(struct pci_dev *dev)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ