[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251114131232.00006e9e@huawei.com>
Date: Fri, 14 Nov 2025 13:12:32 +0000
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: Zhiping Zhang <zhipingz@...a.com>
CC: Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>, "Bjorn
Helgaas" <bhelgaas@...gle.com>, <linux-rdma@...r.kernel.org>,
<linux-pci@...r.kernel.org>, <netdev@...r.kernel.org>, Keith Busch
<kbusch@...nel.org>, Yochai Cohen <yochai@...dia.com>, Yishai Hadas
<yishaih@...dia.com>
Subject: Re: [RFC 1/2] Set steering-tag directly for PCIe P2P memory access
On Thu, 13 Nov 2025 13:37:11 -0800
Zhiping Zhang <zhipingz@...a.com> wrote:
> PCIe: Add a memory type for P2P memory access
>
> The current tph memory type definition applies for CPU use cases. For device
> memory accessed in the peer-to-peer (P2P) manner, we need another memory
> type.
>
> Signed-off-by: Zhiping Zhang <zhipingz@...a.com>
> ---
> drivers/pci/tph.c | 4 ++++
> include/linux/pci-tph.h | 4 +++-
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/tph.c b/drivers/pci/tph.c
> index cc64f93709a4..d983c9778c72 100644
> --- a/drivers/pci/tph.c
> +++ b/drivers/pci/tph.c
> @@ -67,6 +67,8 @@ static u16 tph_extract_tag(enum tph_mem_type mem_type, u8 req_type,
> if (info->pm_st_valid)
> return info->pm_st;
> break;
> + default:
> + return 0;
> }
> break;
> case PCI_TPH_REQ_EXT_TPH: /* 16-bit tag */
> @@ -79,6 +81,8 @@ static u16 tph_extract_tag(enum tph_mem_type mem_type, u8 req_type,
> if (info->pm_xst_valid)
> return info->pm_xst;
> break;
> + default:
> + return 0;
> }
> break;
> default:
> diff --git a/include/linux/pci-tph.h b/include/linux/pci-tph.h
> index 9e4e331b1603..b989302b6755 100644
> --- a/include/linux/pci-tph.h
> +++ b/include/linux/pci-tph.h
> @@ -14,10 +14,12 @@
> * depending on the memory type: Volatile Memory or Persistent Memory. When a
> * caller query about a target's Steering Tag, it must provide the target's
> * tph_mem_type. ECN link: https://members.pcisig.com/wg/PCI-SIG/document/15470.
> + * Add a new tph type for PCI peer-to-peer access use case.
> */
> enum tph_mem_type {
> TPH_MEM_TYPE_VM, /* volatile memory */
> - TPH_MEM_TYPE_PM /* persistent memory */
> + TPH_MEM_TYPE_PM, /* persistent memory */
> + TPH_MEM_TYPE_P2P /* peer-to-peer accessable memory */
Trivial but this time definitely add the trailing comma! Maybe there will never
be any more in here but maybe there will and we can avoid a line of
churn next time.
> };
>
> #ifdef CONFIG_PCIE_TPH
Powered by blists - more mailing lists