[PATCH 05/15] cxl: Allow a default context to be associated with an external pci_dev

Andrew Donnellan andrew.donnellan at au1.ibm.com
Wed Jul 13 15:52:45 AEST 2016

On 11/07/16 21:50, Ian Munsie wrote:
> From: Ian Munsie <imunsie at au1.ibm.com>
> The cxl kernel API has a concept of a default context associated with
> each PCI device under the virtual PHB. The Mellanox CX4 will also use
> the cxl kernel API, but it does not use a virtual PHB - rather, the AFU
> appears as a physical function as a peer to the networking functions.
> In order to allow the kernel API to work with those networking
> functions, we will need to associate a default context with them as
> well. To this end, refactor the corresponding code to do this in vphb.c
> and export it so that it can be called from the PHB code.
> Signed-off-by: Ian Munsie <imunsie at au1.ibm.com>
> Reviewed-by: Frederic Barrat <fbarrat at linux.vnet.ibm.com>

Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

> diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c
> index 012b6aa..c5b9c201 100644
> --- a/drivers/misc/cxl/vphb.c
> +++ b/drivers/misc/cxl/vphb.c
> @@ -40,11 +40,28 @@ static void cxl_teardown_msi_irqs(struct pci_dev *pdev)
>  	 */
>  }
> +bool _cxl_pci_associate_default_context(struct pci_dev *dev, struct cxl_afu *afu)

If we're sharing these functions between the vPHB and peer models, do we 
have a better place than vphb.c for them?

> +{
> +	struct cxl_context *ctx;
> +
> +	/*
> +	 * Allocate a context to do cxl things too. This is used for interrupts


Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited

More information about the Linuxppc-dev mailing list