【已评审】新增redfish接口支持NPU虚拟网卡光模块拓扑信息显示

背景

新机型NPU虚拟网卡的网口和光模块在数量和连接关系等方面跟旧机型存在较大差异,原有的北向接口无法满足新的相关信息显示

前置评审:【已评审】WEB支持NPU虚拟网卡光模块信息显示
redfish接口已在内部完成评审

关联ISSUE

BMC支持获取并显示网口及其光模块拓扑关系信息

整体方案

新增redfish接口

评审点

1、光模块资源新增光模块Lane与网口Lane的关联关系
2、网口资源新增关联处理器端口

详细描述

场景1: 光模块资源新增光模块Lane与网口Lane的关联关系

评审点1:光模块资源新增属性
资源URI:/redfish/v1/Chassis/{ChassisId}/Transceivers/{TransceiverId}
资源版本:HwTransceiver.v1_0_0

属性名 类型 示例/默认值/取值约束 readonly 易变属性 实现PATCH 操作权限 描述
LaneMappings object / / / / / 光模块通道的映射关系
 @odata.id string / true 否 否 ReadOnly 光模块通道映射关系资源节点的访问路径

响应示例

{
    "LaneMappings": {
        "@odata.id": "/redfish/v1/Chassis/1/Transceivers/OpticalModule_EthernetAdapterBoard1Port1/LaneMappings"
    }
}

评审点2: 新增光模块通道映射关系Oem集合资源
资源URI: /redfish/v1/Chassis/{ChassisId}/Transceivers/{TransceiverId}/LaneMappings
资源版本: HwTransceiverLaneMappingCollection.v1_0_0
嵌套资源: 本资源嵌套于HwTransceiver资源的LaneMappings属性中
Link资源: 不涉及

属性名 类型 示例/默认值/取值约束 readonly 易变属性 实现PATCH 操作权限 描述
@odata.context string / true 否 否 ReadOnly 光模块通道映射关系集合资源模型的OData描述信息
@odata.id string / true 否 否 ReadOnly 光模块通道映射关系集合资源的访问路径
@odata.type string / true 否 否 ReadOnly 光模块通道映射关系集合资源的类型
Name string / true 否 否 ReadOnly 光模块通道映射关系集合资源的名称
Members@odata.count integer / true 否 否 ReadOnly 光模块通道映射关系资源数量
Members array / true 否 否 ReadOnly 光模块通道映射关系资源列表
 @odata.id string / true 否 否 ReadOnly 单个光模块通道映射关系资源的访问路径

Schema定义:

{
    "$ref": "#/definitions/HwTransceiverLaneMappingCollection",
    "$schema": "http://redfish.dmtf.org/schemas/v1/redfish-schema.v1_1_0.json",
    "copyright": "Copyright © Huawei Technologies Co., Ltd. 2025. All rights reserved",
    "title": "#HwTransceiverLaneMappingCollection.v1_0_0.HwTransceiverLaneMappingCollection",
    "definitions": {
        "HwTransceiverLaneMappingCollection": {
            "anyOf": [
                {
                    "$ref": "http://redfish.dmtf.org/schemas/v1/odata.4.0.0.json#/definitions/idRef"
                },
                {
                    "type": "object",
                    "patternProperties": {
                        "^([a-zA-Z_][a-zA-Z0-9_]*)?@(odata|Redfish|Message|Privileges)\\.[a-zA-Z_][a-zA-Z0-9_.]+$": {
                            "description": "This property shall specify a valid odata or Redfish property.",
                            "type": [
                                "array",
                                "boolean",
                                "number",
                                "null",
                                "object",
                                "string"
                            ]
                        }
                    },
                    "additionalProperties": false,
                    "properties": {
                        "@odata.context": {
                            "$ref": "http://redfish.dmtf.org/schemas/v1/odata.4.0.0.json#/definitions/context"
                        },
                        "@odata.id": {
                            "$ref": "http://redfish.dmtf.org/schemas/v1/odata.4.0.0.json#/definitions/id"
                        },
                        "@odata.type": {
                            "$ref": "http://redfish.dmtf.org/schemas/v1/odata.4.0.0.json#/definitions/type"
                        },
                        "Name": {
                            "$ref": "http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/Name"
                        },
                        "Members@odata.count": {
                            "$ref": "http://redfish.dmtf.org/schemas/v1/odata.4.0.0.json#/definitions/count"
                        },
                        "Members": {
                            "type": "array",
                            "items": {
                                "$ref": "http://redfish.dmtf.org/schemas/v1/HwTransceiverLanemapping.json#/definitions/HwTransceiverLanemapping"
                            },
                            "readonly": true,
                            "description": "Contains the members of this collection."
                        }
                    }
                }
            ],
            "updatable": false,
			"insertable": false,
			"deletable": false,
			"uris": [
                "/redfish/v1/Chassis/{ChassisId}/Transceivers/{TransceiverId}/LaneMappings/{LaneId}",
                "/redfish/v1/Chassis/:chassisid/Transceivers/OpticalModule_:opticalid/LaneMappings/{LaneId}"
            ],
            "description": "A Collection of Transceiver Lane Mapping configuration resource instances."
        }
    }
}

响应示例:

{
    "@odata.context": "/redfish/v1/$metadata#HwTransceiverLaneMappingCollection.HwTransceiverLaneMappingCollection",
    "@odata.id": "/redfish/v1/Chassis/1/Transceivers/OpticalModule_EthernetAdapterBoard1Port1/LaneMappings",
    "@odata.type": "#HwTransceiverLaneMappingCollection.v1_0_0.HwTransceiverLaneMappingCollection",
    "Name": "OpticalModule EthernetAdapterBoard1 Lane Mapping Collection",
    "Members@odata.count": 2,
    "Members": [
        {
            "@odata.id": "/redfish/v1/Chassis/1/Transceivers/OpticalModule_EthernetAdapterBoard1Port1/LaneMappings/1"
        },
        {
            "@odata.id": "/redfish/v1/Chassis/1/Transceivers/OpticalModule_EthernetAdapterBoard1Port1/LaneMappings/2"
        }
    ]
}

评审点3: 新增光模块通道映射关系Oem资源
资源URI: /redfish/v1/Chassis/{ChassisId}/Transceivers/{TransceiverId}/LaneMappings/{MappingId}
资源版本: HwTransceiverLaneMapping.v1_0_0
嵌套资源: 本资源嵌套于HwTransceiverLaneMappingCollection资源的Members属性中
Link资源: 不涉及

属性名 类型 示例/默认值/取值约束 readonly 易变属性 实现PATCH 操作权限 描述
@odata.context string / true 否 否 ReadOnly 光模块通道映射关系资源模型的OData描述信息
@odata.id string / true 否 否 ReadOnly 光模块通道映射关系资源的访问路径
@odata.type string / true 否 否 ReadOnly 光模块通道映射关系资源的类型
Name string / true 否 否 ReadOnly 光模块通道映射关系资源的名称
Id string / true 否 否 ReadOnly 光模块通道映射关系资源的ID
LaneId integer,null / true 否 否 ReadOnly 光模块通道ID
RelatedNetworkPortLane object / / / / / 光模块通道关联的网口通道
 NetworkPort object / / / / / 光模块通道关联的网口
  @odata.id string / true 否 否 ReadOnly 光模块通道关联网口资源的访问路径
 NetworkPortLaneId integer,null / true 否 否 ReadOnly 光模块通道关联网口通道的ID

Schema定义:

{
    "$schema": "http://redfish.dmtf.org/schemas/v1/redfish-schema.v1_1_0.json",
    "title": "#HwTransceiverLaneMapping.v1_0_0.HwTransceiverLaneMapping",
    "$ref": "#/definitions/HwTransceiverLaneMapping",
    "copyright": "Copyright © Huawei Technologies Co., Ltd. 2025. All rights reserved",
    "definitions": {
        "NetworkPort": {
            "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": true,
            "properties": {
                "@odata.id": {
                    "type": "string",
                    "readonly": true,
                    "description": "Path to access the network port resource node."
                }
            }
        },
        "RelatedNetworkPortLane": {
            "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": "The network port lane associated with the transceiver lane."
                }
            },
            "additionalProperties": false,
            "properties": {
                "NetworkPort": {
                    "type": "object",
                    "items": {
                        "$ref": "#/definitions/NetworkPorts"
                    },
                    "readonly": true,
                    "description": "Path to access the network port resource node."
                },
                "NetworkPortLaneId": {
                    "type": [
                        "number",
                        "null"
                    ],
                    "readonly": true,
                    "description": "The ID of the network port lane associated with the transceiver lane."
                }
            }
        },
        "HwTransceiverLaneMapping": {
           "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": {
                "@odata.context": {
                    "$ref": "http://redfish.dmtf.org/schemas/v1/odata.4.0.0.json#/definitions/context"
                },
                "@odata.id": {
                    "$ref": "http://redfish.dmtf.org/schemas/v1/odata.4.0.0.json#/definitions/id"
                },
                "@odata.type": {
                    "$ref": "http://redfish.dmtf.org/schemas/v1/odata.4.0.0.json#/definitions/type"
                },
                "Name": {
                            "$ref": "http://redfish.dmtf.org/schemas/v1/Resource.json#/definitions/Name"
                },
                "Id":{
                    "type": [
                        "string",
                        "null"
                    ],
                    "readonly": true,
                    "description": "The ID of the transceiver lane mapping relationship resource."
                },
                "LaneId":{
                    "type": [
                        "number",
                        "null"
                    ],
                    "readonly": true,
                    "description": "The ID of the transceiver lane mapping relationship resource."
                },
                "RelatedNetworkPortLane": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/RelatedNetworkPortLane"
                    },
                    "description": "The network port lane associated with the transceiver lane.",
                    "longDescription": "This object shall contain details of the lane mappings associated with this transceiver."
                }
            },
            "description": "This is the schema definition for the lane mappings.  It represents the properties for the resource itself.",
            "longDescription": "This resource shall be used to represent the lane mappings  for a Redfish implementation."
        }
        
    }
}

响应示例:

{
    "@odata.context": "/redfish/v1/$metadata#HwTransceiverLaneMapping.HwTransceiverLaneMapping",
    "@odata.id": "/redfish/v1/Chassis/1/Transceivers/OpticalModule_EthernetAdapterBoard1Port1/LaneMappings/1",
    "@odata.type": "#HwTransceiverLaneMapping.v1_0_0.HwTransceiverLaneMapping",
    "Name": "OpticalModule EthernetAdapterBoard1 Port1 LaneMapping 1",
    "Id": "OpticalModuleEthernetAdapterBoard1Port1LaneMapping1",
    "LaneId" : 1,
    "RelatedNetworkPortLane" : {
        "NetworkPort" : {
            "@odata.id" : "/redfish/v1/Chassis/1/NetworkAdapters/EthernetAdapterBoard1/Ports/1",
        },
        "NetworkPortLaneId" : 1
    }
}

场景2: 网口资源新增关联处理器端口

评审点1: Processor资源新增属性
资源URI: /redfish/v1/Systems/{ComputerSystemId}/Processors/{ProcessorId}
资源版本: Processor.v1_17_0

属性名 类型 示例/默认值/取值约束 readonly 易变属性 实现PATCH 操作权限 描述
Ports object / / / / / 指定处理器端口集合资源(仅NPU资源具有)
 @odata.id string / true 否 否 ReadOnly 指定处理器端口集合资源的访问路径(仅NPU资源具有)

响应示例:

{
     "Ports": {
         "@odata.id" : "/redfish/v1/Systems/1/Processors/Npu1/Ports"
     }
}

评审点2: 新增处理器端口标准集合资源
资源URI: /redfish/v1/Systems/{ComputerSystemId}/Processors/{ProcessorId}/Ports
资源版本: 不涉及
Required属性: @odata.id、@odata.type、Members、Name
嵌套资源: 本资源嵌套于Processor资源的Ports属性中
Link资源: 不涉及

属性名 类型 示例/默认值/取值约束 readonly 易变属性 实现PATCH 操作权限 描述
@odata.context string / true 否 否 ReadOnly 指定处理器端口集合资源模型的OData描述信息
@odata.id string / true 否 否 ReadOnly 指定处理器端口集合资源的访问路径
@odata.type string / true 否 否 ReadOnly 指定处理器端口集合资源的类型
Name string / true 否 否 ReadOnly 指定处理器端口集合资源的名称
Members@odata.count integer / true 否 否 ReadOnly 指定处理器的端口资源数量
Members array / true 否 否 ReadOnly 指定处理器的端口资源列表
 @odata.id string / true 否 否 ReadOnly 指定处理器单个端口资源节点的访问路径

响应示例:

{
    "@odata.context": "/redfish/v1/$metadata#PortCollection.PortCollection",
    "@odata.id": "/redfish/v1/Systems/1/Processors/Npu6/Ports",
    "@data.type": "#PortCollection.PortCollection",
    "Name": "Processor Port Collection",
    "Members@odata.count": 2,
    "Members": [
        {
            "@odata.id": "/redfish/v1/Systems/1/Processors/Npu6/Ports/0"
        },
        {
            "@odata.id": "/redfish/v1/Systems/1/Processors/Npu6/Ports/1"
        }
    ]
}

评审点3: 新增处理器端口标准资源
资源URI: /redfish/v1/Systems/{ComputerSystemId}/Processors/{ProcessorId}/Ports/{PortId}
资源版本: Port.v1_17_0
Required属性: @odata.id、@odata.type、Id、Name
嵌套资源: 本资源嵌套于Processor资源的Ports属性中
Link资源: 本资源链接到网口资源

属性名 类型 示例/默认值/取值约束 readonly 易变属性 实现PATCH 操作权限 描述
@odata.context string / true 否 否 ReadOnly 处理器指定端口资源模型的OData描述信息
@odata.id string / true 否 否 ReadOnly 处理器指定端口资源的访问路径
@odata.type string / true 否 否 ReadOnly 处理器指定端口资源的类型
Name string / true 否 否 ReadOnly 处理器指定端口资源的名称
Id string / true 否 否 ReadOnly 处理器指定端口资源的ID
PortId string,null / true 否 否 ReadOnly 处理器指定端口的硬件定义标识符
Links object / / / / / 指向与此资源相关的其他资源的链接
 Oem object / / / / / 厂商自定义资源
  openUBMC object / / / / / 厂商标志
         NetworkPorts array / / / / / 处理器指定端口关联的网口资源列表
           @odata.id string / true 否 否 ReadOnly 处理器指定端口关联网口资源的访问路径
Oem object / / / / / 厂商自定义资源
 openUBMC object / / / / / 厂商标志
  IODieId integer,null / true 否 否 ReadOnly 处理器指定端口归属的IO Die ID

Schema定义:

 "NetworkPorts": {
    "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": true,
    "properties": {
        "@odata.id": {
            "type": "string",
            "readonly": true,
            "description": "Path to access the network ports resource node."
        }
    }
}

"NetworkPorts":  {
    "type": "array",
    "items": {
        "$ref": "#/definitions/NetworkPorts"
    },
    "readonly": true,
    "description": "Path to access the network port resources node."
}

"IODieId": {
    "type": [
        "number",
        "null"
    ],
    "readonly": true,
    "description": "The IO Die Id of this processor port"
}

响应示例:

{
    "@odata.context": "/redfish/v1/$metadata#Port.Port",
    "@odata.id": "/redfish/v1/Systems/1/Processors/Npu1/Ports/1",
    "@odata.type": "#Port.v1_17_0.Port",
    "Name": "NPU1 IODie0 Port5",
    "Id": "1",
    "PortId": "Port 5",
    "Links": {
        "Oem": {
            "openUBMC": {
                "NetworkPorts": [
                    {
                        "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/EthernetAdapterBoard/Ports/1"
                    },
                    {
                        "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/EthernetAdapterBoard/Ports/2"
                    }
                ]
            }
        }
    },
    "Oem": {
        "openUBMC": {
            "IODieId": 0
        }
    }
}

评审点4: 网口资源新增属性
资源URI: /redfish/v1/Chassis/{ChassisId}/NetworkAdapters/{NetworkAdapterId}/Ports/{PortId}
资源版本: Port.v1_17_0

属性名 类型 示例/默认值/取值约束 readonly 易变属性 实现PATCH 操作权限 描述
Links object / / / / / 指向与此资源相关的其他资源的链接
 Oem object / / / / / 厂商自定义资源
  openUBMC object / / / / / 厂商标志
            Processors array / / / / / 指定网口关联的处理器资源列表
                @odata.id string / true 否 否 ReadOnly 指定网口关联处理器资源的访问路径

Schema定义:

  "Processors": {
      "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": true,
      "properties": {
          "@odata.id": {
              "type": "string",
              "readonly": true,
              "description": "Path to access the processor resource node."
          }
      }
  }

响应示例:

{
    "Links": {
        "Oem": {
            "openUBMC": {
                "Processors": [
                    {
                        "@odata.id": "/redfish/v1/Systems/1/Processors/Npu1"
                    },
                    {
                        "@odata.id": "/redfish/v1/Systems/1/Processors/Npu2"
                    }
                ]
            }
        }
    }
}

评审结论

1、新增HwTransceiver资源,不再复用HwOpticalModule资源
2、同意HwTransceiver资源增加LaneMappings属性用于链接到光模块通道映射关系Oem集合资源
3、同意新增光模块通道映射关系Oem集合资源(HwTransceiverLaneMappingCollection)以及
光模块通道映射关系Oem资源(HwTransceiverLaneMapping)
5、同意Processor资源新增标准属性Ports属性
6、同意新增处理器端口标准集合资源和处理器端口标准资源
7、同意处理器端口标准资源新增属性Oem/{OemIdentifier}/IODieId、Links/Oem/{OemIdentifier}/NetworkPorts、Links/Oem/{OemIdentifier}/Processors
以上新增资源和属性详见详细描述

遗留问题

1、/redfish/v1/Chassis/{ChassisId}/Transceivers/{TransceiverId}/LaneMappings建议按标准集合资源实现,通过加?$expand=.展开详细信息
结论:与诉求方确认,接受通过此方式展开详细信息,接口已调整

1 个赞