Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get Mac Address of an network adapter #368

Open
jasmeer opened this issue Jul 1, 2024 · 3 comments
Open

How to get Mac Address of an network adapter #368

jasmeer opened this issue Jul 1, 2024 · 3 comments

Comments

@jasmeer
Copy link

jasmeer commented Jul 1, 2024

Hi
Usually MAC address is available in NetworkDeviceFunction object. However, in my system NetworkDeviceFunction collection has no members:

curl -k https:/redfish/v1/Chassis/1/NetworkAdapters/slot-1/NetworkDeviceFunctions
{
"Name": "NetworkDeviceFunctionCollection",
"Description": "A collection of NetworkDeviceFunction resource instances.",
"@odata.etag": ""33e203339f0e2428c37"",
"@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-1/NetworkDeviceFunctions",
"[email protected]": 0,
"Members": [],
"@odata.type": "#NetworkDeviceFunctionCollection.NetworkDeviceFunctionCollection",
"@odata.context": "/redfish/v1/$metadata#NetworkDeviceFunctionCollection.NetworkDeviceFunctionCollection"
}

Why is it so? Is there any other way to find the Mac address set to a network port?

Thanks
Jasmeer

@jixj5
Copy link
Contributor

jixj5 commented Jul 3, 2024

Hi Jasmeer,
Some network cards do not provide NetworkDeviceFunction.
You can find the Mac address of network port in Ports Object.
such as: /redfish/v1/Chassis/1/NetworkAdapters/slot6_0x170000/Ports/0
image

@jasmeer
Copy link
Author

jasmeer commented Jul 3, 2024

Thank you for the reply.
In my system, ports and NetworkPorts collections are empty as well.

 https://localhost:17443/redfish/v1/Chassis/1/NetworkAdapters/slot-1
 
{
  "Id": "slot-1",
  "Description": "A NetworkAdapter represents the physical network adapter capable of connecting to a computer network.",
  "@odata.type": "#NetworkAdapter.v1_9_0.NetworkAdapter",
  "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-1",
  "Model": "ConnectX-6 Dx EN adapter card, 1",
  "SerialNumber": "MT2134X16430",
  "Oem": {
    "Lenovo": {
      "@odata.type": "#LenovoDeviceInfo.v1_0_0.LenovoDeviceInfo",
      "UUID": ""
    }
  },
  "@odata.context": "/redfish/v1/$metadata#NetworkAdapter.NetworkAdapter",
  "SKU": "MCX623106AN-CDAT",
  "Ports": {
    "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-1/Ports"
  },
  "Status": {
    "Health": "OK",
    "State": "Enabled"
  },
  "@odata.etag": "\"a8794521551034a43afa6\"",
  "Manufacturer": "MLNX",
  "NetworkPorts": {
    "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-1/NetworkPorts"
  },
  "Name": "NetworkAdapter",
  "PartNumber": "MCX623106AN-CDAT",
  "Controllers": [
    {
      "ControllerCapabilities": {
        "NetworkPortCount": 0,
        "NetworkDeviceFunctionCount": -2
      },
      "Links": {
        "PCIeDevices": [
          {
            "@odata.id": "/redfish/v1/Chassis/1/PCIeDevices/slot_1"
          }
        ],
        "NetworkDeviceFunctions": [],
        "NetworkPorts": [],
        "Ports": []
      },
      "FirmwarePackageVersion": "22.30.1004",
      "Location": {
        "Info": "Slot 1",
        "PartLocation": {
          "ServiceLabel": "PCIe 1",
          "LocationType": "Slot",
          "LocationOrdinalValue": 1
        },
        "[email protected]": "The property is deprecated. Please use PartLocation instead.",
        "InfoFormat": "Slot X",
        "[email protected]": "The property is deprecated. Please use PartLocation instead."
      },
      "PCIeInterface": {
        "MaxPCIeType": "Gen4",
        "MaxLanes": 16,
        "PCIeType": "Gen4",
        "LanesInUse": 16
      }
    }
  ],
  "NetworkDeviceFunctions": {
    "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-1/NetworkDeviceFunctions"
  }
}


 curl -k https://localhost:17443/redfish/v1/Chassis/1/NetworkAdapters/slot-1/Ports |  jq

{
  "Name": "PortCollection",
  "Description": "A collection of Port resource instances.",
  "@odata.type": "#PortCollection.PortCollection",
  "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-1/Ports",
  "[email protected]": 0,
  "Members": [],
  "@odata.etag": "\"22d2779d205f24e4a34\"",
  "@odata.context": "/redfish/v1/$metadata#PortCollection.PortCollection"
}

curl  https://localhost:17443/redfish/v1/Chassis/1/NetworkAdapters/slot-1/NetworkPorts| jq
  
{
  "Name": "NetworkPortCollection",
  "Description": "A collection of NetworkPort resource instances.",
  "@odata.type": "#NetworkPortCollection.NetworkPortCollection",
  "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/slot-1/NetworkPorts",
  "[email protected]": 0,
  "Members": [],
  "@odata.etag": "\"277748d09c7724231a0\"",
  "@odata.context": "/redfish/v1/$metadata#NetworkPortCollection.NetworkPortCollection"
} 

Why ports, networkports and netrworkdevicefunctions all are empty?

Thanks
Jasmeer

@jixj5
Copy link
Contributor

jixj5 commented Jul 3, 2024

Could you give me your server's products model (such as SR650), XCC/UEFI firmware versions and FFDC log?
Can you see the port and mac on web,such as
image

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants