cxl-lib

module
v1.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: Apache-2.0

README

cxl-lib

Go Language utility library for CXL device information.

Introduction

cxl-lib is a standalone package for cxl device detection, information parsing and management in Linux system. User could either import this library as a module or compile the comand line version for easy interact with the CXL devices.

Source code files of the cxl-lib open source project are available to you under The Apache-2.0 License. The cxl-lib project repository is maintained at https://github.com/Seagate.

cxl Compute Express Link (CXL) is an open standard for high-speed, high capacity central processing unit (CPU)-to-device and CPU-to-memory connections, designed for high performance data center computers.

cxl-lib follows CXL specification rev 1.1.

pci.ids is the database for parsing pci vendor. User could obtain the latest version from http://pci-ids.ucw.cz/ or https://github.com/pciutils/pciids.git

Usage

package main

import (
    "fmt"
    "github.com/Seagate/cxl-lib/pkg/cxl"
)

func main() {
	devList := cxl.InitCxlDevList()

    prFmt := "%12s | %20s | %10s | %10s | %15s | %18s \n"
    fmt.Printf("Print the list of CXL devs. Total devices found: %d\n", len(devList))
    fmt.Printf(prFmt, "BUS:DEV.FUN", "Vendor", "Device", "Rev", "Type", "SN")
    for _, dev := range devList {
        vendorName := dev.GetVendorInfo()
        if len(vendorName) > 15 {
            vendorName = vendorName[:15] + "..."
        }
        fmt.Printf(prFmt, dev.GetBdfString(), vendorName, dev.GetDeviceInfo(), dev.GetCxlRev(), dev.GetCxlType(), dev.GetSerialNumber())
    }

}

Directories

Path Synopsis
cmd
pkg
cxl
This file implements the CXL Mailbox related structures and methods based on CXL spec rev3.0
This file implements the CXL Mailbox related structures and methods based on CXL spec rev3.0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL