【已评审】新增redfish属性支持OCP网卡归属多CPU的场景

背景

产业的OCP卡管理方案中,需要x16资源可以从2个CPU中出,每个CPU出一个x8,每张卡需要分配多个PCIeFunction以对应不同的CPU
前置评审:【已评审】OCP网卡支持多CPU归属的web界面和webreset接口
URL:https://device_ip/redfish/v1/Chassis/chassis_id/NetworkAdapters/networkadapters_id
当前仅能支持1个BDF显示、仅能支持归属1个CPU资源

字段 类型 说明
Oem/{OemIdentifier} 自定义属性
RootBDF 字符串 指定网络适配器的root port BDF
AssociatedResource 字符串 指定网络适配器的资源归属

redfish接口已在内部完成评审

关联ISSUE

支持多CPU场景下PCIe设备的资源归属识别

整体方案

新增OEM字段,支持网卡归属多CPU的场景

评审点

新增OEM字段,支持网卡归属多CPU的场景。原属性RootBDF和AssociatedResource在多CPU场景下返回null,单CPU场景仍然正常显示

详细描述

评审点: NetworkAdapter资源新增属性
资源URI: /redfish/v1/Chassis/{ChassisId}/NetworkAdapters/{NetworkAdapterId}
资源版本: NetworkAdapter.v1_12_1

属性名 类型 示例/默认值/取值约束 readonly 易变属性 实现PATCH 操作权限 描述
Oem object / / / / / 厂商自定义资源
    openUBMC object / / / / / 厂商标志
        RootBDFs[] array(string, null) 默认值:[] true ReadOnly 指定网络适配器的root port BDF列表,元素格式为Segment:Bus:Device.Function,Segment取值范围0000~ffff(十六进制小写),Bus取值范围00~ff(十六进制小写),Device取值范围00~1f(十六进制小写),Function取值范围0~7。例如“0000:96:00.0”表示Segment是0,BDF分别是0x96、0x00、0x00。按RootBDF对应的CPU丝印顺序排序,若RootBDF获取失败则返回null
Links object / / / / / 指向与此资源相关的其他资源的链接
    Oem object / / / / / 厂商自定义资源
        openUBMC object / / / / / 厂商标志
            Processors array / / / / / 指定网络适配器归属的处理器资源
                @odata.id string / true ReadOnly 指定网络适配器归属的处理器资源的访问路径

Schema定义
huawei_networkadapter.json新增定义

 "{{OemIdentifier}}NetworkAdapterOem": {
     "properties": {
         "RootBDFs": {
             "type": "array",
             "items": {
                 "type": [
                     "string",
                     "null"
                 ]
             },
             "readonly": true,
             "description": "Network adapter root port BDFs",
             "longDescription": "This property indicates the root port BDFs (Bus, Device, Function) resource allocated by the BIOS for the network adapter."
         }
     }
 }
 "{{OemIdentifier}}NetworkAdapterLinksOem": {
    "type": "object",
    "patternProperties": {
        "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[a-zA-Z_][a-zA-Z0-9_.]+$": {
            "type": [
                "array",
                "boolean",
                "number",
                "null",
                "object",
                "string"
            ],
            "description": "This property shall specify a valid odata or Redfish property."
       }
    },
    "additionalProperties": false,
    "properties": {
        "Processors": {
            "type": "array",
            "items": {
                "$ref": "http://redfish.dmtf.org/schemas/v1/Processor.json#/definitions/Processor"
            },
            "readonly": true,
            "description": "An array of links to the processors associated in this networkadapter.",
            "longDescription": "This property shall contain an array of links to resources of type `Processor` type that this networkadapter associated."
        }
    }
}

RootBDF属性的longDescription增加以下说明:

If the BIOS allocates more than one root port BDF, the value will be `null` and the `RootBDFs` property shall be used instead.

AssociatedResource属性的longDescription增加以下说明:

If the network adapter is associated with more than one processor, the value will be `null` and the `Links/Oem/<OemIdentifier>/Processors` property shall be used instead.

networkadapter.v1_12_1.json新增定义

"Links": {
    "$ref": "http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/Links",
    "description": "The links to other resources that are related to this resource.",
    "longDescription": "This property shall contain links to resources that are related to but are not contained by, or subordinate to, this resource."
}

响应示例

{
    "Oem": {
        "openUBMC": {
            "RootBDFs": [
                "0000:40:00.0",
                "0000:c1:00.0"
            ]
        }
    },
    "Links": {
        "Oem": {
            "openUBMC": {
                "Processors": [
                    {
                        "@odata.id": "/redfish/v1/Systems/1/Processors/1"
                    },
                    {
                        "@odata.id": "/redfish/v1/Systems/1/Processors/2"
                    }
                ]
            }
        }
    }
}

评审结论

1、同意在/redfish/v1/Chassis/{ChassisId}/NetworkAdapters/{NetworkAdapterId}新增属性Oem//RootBDFs、Links/Oem//Processors,详见详细描述
2、原属性RootBDF和AssociatedResource在多CPU场景下GET操作返回null,单CPU场景GET操作保持原有设计

遗留问题

1、RootBDFs类型不正确
结论:确认标准规范中也有array(string,null)的表述
2、原属性RootBDF和AssociatedResource返回null的场景需在schema补充描述
结论:已补充对应描述