[RFC 0/2] Type2 multipf support

<[email protected]>
Newsgroups org.kernel.vger.linux-cxl,org.kernel.vger.netdev
Message-ID <[email protected]>
From: Alejandro Lucero <[email protected]>

Commit message of first patch explains why this is needed but I want to
add some comments here.

First, the final Type2 basic support was possible once Dan Williams and
I reached an agreement on how to solve the potential unwinding spenarios
linked to a cxl memdev object. The actions triggering this unwinding are:

 - User space unbinding the cxl mem device from the cxl mem driver.
 - User space removing cxl_acpi module.
 - User space unbinding Type2/accelerator pci device from its driver.
 - User space removing Type2/accelerator driver.

The last two trigger the unwinding from the Type2/accelerator driver
exit path, while the first two start the unwinding which in turn invoke
the Type2 driver release from its pci device.

In any case, the decission was to release the Type2 driver always
instead of a degraded functionality if CXL.mem is only part of the full
functionality. This needs to be extended to other non-PF0 PFs, so all
the scenarios listed above ending up releasing those other PFs as well
from their drivers.

This needs to link a memdev to those non-PF0 PFs, and invoke those PFs
release from their drivers when unwinding. This is not complicated per
se but the devil is in the potential race conditions between the
linking/unlinking and the memdev release. I think it does only require
to keep a reference to the memdev device for the time the
linking/unlinking happens, but maybe there are corner cases I did not
think about. I have tested it with real hardware advertising two PFs and
under all the scenarios listed, but stressing this requires another
framework, likely under qemu or adding a new cxl test set.

FWIW, using vanilla 7.2 as cxl next has not the sfc changes yet.

Alejandro Lucero (2):
  cxl/memdev: add support for mutipf device
  sfc: add multipf support

 drivers/cxl/core/memdev.c          | 122 +++++++++++++++++++++++++++++
 drivers/cxl/cxlmem.h               |   1 +
 drivers/net/ethernet/sfc/efx_cxl.c | 106 +++++++++++++++++++++++--
 include/cxl/cxl.h                  |   4 +
 4 files changed, 227 insertions(+), 6 deletions(-)


base-commit: 818bebeb63dd6bf5f4e07e145f6cdbace520a34c
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.