STRUCT CXL_PORT(9)
π struct cxl_port(9) π
okay so this is a page from the Kernel API Manual, and honestly? it's a glow-up. buckle up bestie, we're gonna meet struct cxl_port π
β¨ NAME β¨
struct cxl_port β a logical collection of upstream port devices and downstream port devices, all so we can construct a CXL memory decode hierarchy. it's giving "found family, but make it hardware" π«Ά
πΈ SYNOPSIS πΈ
struct cxl_port {
struct device dev;
struct device *uport_dev;
struct device *host_bridge;
int id;
struct xarray dports;
struct xarray endpoints;
struct xarray regions;
struct cxl_dport *parent_dport;
struct ida decoder_ida;
struct cxl_register_map reg_map;
struct cxl_component_regs regs;
int nr_dports;
int hdm_end;
int commit_end;
bool dead;
unsigned int depth;
struct cxl_cdat {
void *table;
size_t length;
} cdat;
bool cdat_available;
long pci_latency;
resource_size_t component_reg_phys;
};
like, look at all those little guys. no cap, every single one matters π
π¦ MEMBERS π¦
here's the whole roster, and yes we're going through everybody, because nobody gets left out on my watch β¨
devβ this port's device. the main character, lowkey πuport_devβ the PCI or platform device that implements the upstream port capability. it's the one actually doing the work behind the scenes, iykykhost_bridgeβ shortcut to the platform attach point for this port π«Άidβ the id for the port device-name. name tag energy π·οΈdportsβ thecxl_dportinstances referenced by decodersendpointsβcxl_epinstances, aka the endpoints that are a descendant of this port πregionsβcxl_region_refinstances, aka the regions mapped by this portparent_dportβ the dport that points to this port in the parent. it's giving "who's your parent" πdecoder_idaβ allocator for decoder idsreg_mapβ component and ras register mapping parametersregsβ mapped component registersnr_dportsβ number of entries indports. literally just a count, bestie π’hdm_endβ tracks the last allocated HDM decoder instance, for allocation orderingcommit_endβ cursor to track the highest committed decoder, for commit orderingdeadβ the last ep has been removed, so force port re-creation. dramatic? yes. necessary? also yes πdepthβ how deep this port is relative to the root.depth 0is the root, so the root is the one sitting at the top of the group chat πcdatβ cached CDAT datacdat_availableβ whether a CDAT attribute should be available insysfspci_latencyβ upstream latency in picosecondscomponent_reg_physβ physical address of the component register
ngl,deadis my favorite member name. imagine a struct just having a field calleddead. iconic. no notes. π₯
π SEE ALSO π
- kernel file
./drivers/cxl/cxl.h cxl objects(9)struct cxl_decoder(9)struct cxl_endpoint_decoder(9)struct cxl_switch_decoder(9)struct cxl_rd_ops(9)struct cxl_root_decoder(9)struct cxl_region_params(9)struct cxl_region(9)struct cxl_root(9)struct cxl_dport(9)struct cxl_ep(9)struct cxl_region_ref(9)struct cxl_endpoint_dvsec_info(9)
and that's the whole page, bestie π before you go: this lil masterpiece came out of ./drivers/cxl and it's dated October 2026 β so like, future vibes fr fr. slay, go read some kernel headers πΈβ¨π¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms