@@ -11,6 +11,8 @@ import (
1111
1212const HPEvendorID string = "0x17db"
1313
14+ var cxiDriverRoot = "/sys/module/cxi_ss1/drivers"
15+
1416// In the future, we may want to include lib paths into the helm.
1517var LibPaths = map [string ]string {
1618 "libfabric" : "/opt/cray/lib64" ,
@@ -61,22 +63,29 @@ func GetLibs() ([]string, error) {
6163// GetHPECXIs return a map of HPE Cassini on a node identified by the part of the pci address
6264// This may be changed to use cxilib calls instead of sysfs.
6365func GetHPECXIs () map [string ]int {
64- if _ , err := os .Stat ("/sys/module/cxi_core/drivers/" ); err != nil {
66+ if _ , err := os .Stat (cxiDriverRoot ); err != nil {
6567 klog .Warningf ("HPE CXI driver unavailable: %s" , err )
6668 return make (map [string ]int )
6769 }
6870
69- matches , _ := filepath .Glob ("/sys/module/cxi_core/drivers/pci:cxi_core/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]:*" )
71+ cxiRegex := filepath .Join (cxiDriverRoot , "pci:cxi_ss1/[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]:*" )
72+ klog .Info (cxiRegex )
73+ matches , _ := filepath .Glob (cxiRegex )
7074
75+ klog .Info ("Found matches:" )
76+ klog .Info (matches )
7177 devices := make (map [string ]int )
7278
7379 for _ , path := range matches {
80+ // This is a directory with "net"
81+ // /sys/module/cxi_ss1/drivers/pci:cxi_ss1/0000:01:00.0/
82+
7483 klog .Info (path )
7584 devPaths , _ := filepath .Glob (path + "/net/*" )
7685
7786 for _ , devPath := range devPaths {
7887 name := filepath .Base (devPath )
79- if name [0 :3 ] == "hsn " {
88+ if name [0 :3 ] == "hsi " {
8089 nic_id , _ := strconv .Atoi (name [len (name )- 1 :])
8190 devices [name ] = nic_id
8291 }
0 commit comments