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: <20251118005005.1473648-1-zhipingz@meta.com>
Date: Mon, 17 Nov 2025 16:50:01 -0800
From: <zhipingz@...a.com>
To: Jonathan Cameron <jonathan.cameron@...wei.com>
CC: <jgg@...pe.ca>, <leon@...nel.org>, <bhelgaas@...gle.com>,
        <linux-rdma@...r.kernel.org>, <linux-pci@...r.kernel.org>,
        <netdev@...r.kernel.org>, <kbusch@...nel.org>, <yochai@...dia.com>,
        <yishaih@...dia.com>
Subject: Re: [RFC 1/2] Set steering-tag directly for PCIe P2P memory access

> From: Jonathan Cameron @ 2025-11-14 13:12 UTC (permalink / raw)
>  To: Zhiping Zhang
>  Cc: Jason Gunthorpe, Leon Romanovsky, Bjorn Helgaas, linux-rdma,
>	linux-pci, netdev, Keith Busch, Yochai Cohen, Yishai Hadas
>
> 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.
>

Thanks for catching that! I’ll add the trailing comma to the enum in the patch.

> >  };
> >  
> >  #ifdef CONFIG_PCIE_TPH


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ