15a727b48SDelphine CC Chiu# NC-SI core dump 25a727b48SDelphine CC Chiu 35a727b48SDelphine CC ChiuAuthor: DelphineCCChiu (<Delphine_CC_Chiu@wiwynn.com>) 45a727b48SDelphine CC Chiu 55a727b48SDelphine CC ChiuCreated: 03/12/2024 65a727b48SDelphine CC Chiu 75a727b48SDelphine CC Chiu## Problem Description 85a727b48SDelphine CC Chiu 95a727b48SDelphine CC ChiuNIC core-dump is essential for NIC issue debugging, and it could be retrieved 105a727b48SDelphine CC Chiuvia both in-band and out of band method. The design here is providing the 115a727b48SDelphine CC Chiusolution for NIC out of band dumping from BMC over NC-SI protocol. 125a727b48SDelphine CC Chiu 135a727b48SDelphine CC Chiu## Background and References 145a727b48SDelphine CC Chiu 155a727b48SDelphine CC ChiuNC-SI command for dump retrieval: Reference: NC-SI spec v1.2: section: 8.4.114 165a727b48SDelphine CC Chiu<https://www.dmtf.org/sites/default/files/standards/documents/DSP0222_1.2.0.pdf> 175a727b48SDelphine CC Chiu 185a727b48SDelphine CC ChiuNC-SI over MCTP: 195a727b48SDelphine CC Chiu<https://www.dmtf.org/sites/default/files/standards/documents/DSP0261_1.3.0.pdf> 205a727b48SDelphine CC Chiu 215a727b48SDelphine CC Chiu## Requirements 225a727b48SDelphine CC Chiu 235a727b48SDelphine CC ChiuThis feature requires Linux kernel to support transferring new NC-SI command 245a727b48SDelphine CC Chiu(0x4D) in net/ncsi module 255a727b48SDelphine CC Chiu<https://github.com/torvalds/linux/commits/master/net/ncsi> 265a727b48SDelphine CC Chiu 275a727b48SDelphine CC Chiu## Proposed Design 285a727b48SDelphine CC Chiu 295a727b48SDelphine CC Chiu### Interface 305a727b48SDelphine CC Chiu 315a727b48SDelphine CC ChiuThis design will reuse existing phosphor-debug-collector module: 32*879601d9SJagpal Singh Gill<https://github.com/openbmc/phosphor-debug-collector> and extend the dump 335a727b48SDelphine CC Chiucreation interface with a new "NC-SICoreDump" dump type. 345a727b48SDelphine CC Chiu 355a727b48SDelphine CC ChiuThe D-Bus interface for dump creation will be:"xyz.openbmc_project.Dump.Manager 365a727b48SDelphine CC Chiu/xyz/openbmc_project/dump/bmc xyz.openbmc_project.Dump.Create" 375a727b48SDelphine CC Chiu 385a727b48SDelphine CC ChiuTo indicate which NC-SI link to target, The CreateDump method need one 395a727b48SDelphine CC Chiuadditional input parameter: "NICTarget". An EID or network interface, such as 405a727b48SDelphine CC Chiueth0 could be a valid value. 415a727b48SDelphine CC Chiu 425a727b48SDelphine CC Chiu### Dump Retrieval 435a727b48SDelphine CC Chiu 445a727b48SDelphine CC ChiuUsing standard NC-SI command: Retrieve Data From NC(0x4D) to get the dumps by 455a727b48SDelphine CC ChiuNC-SI over RBT or NC-SI over MCTP protocol. All NC-SI dump procedure will be 465a727b48SDelphine CC Chiuimplemented in ncsi-netlink and ncsi-mctp utility in phosphor-networkd: 475a727b48SDelphine CC Chiu<https://github.com/openbmc/phosphor-networkd/blob/master/src/ncsi_netlink_main.cpp> 485a727b48SDelphine CC Chiu 495a727b48SDelphine CC Chiu### Integrate with phosphor-debug-collector 505a727b48SDelphine CC Chiu 515a727b48SDelphine CC ChiuSince phosphor-debug-collector using shell scripts for data collection, a new 525a727b48SDelphine CC Chiucollector script named "ncsicoredump" will be added. This script will help to 535a727b48SDelphine CC Chiucall ncsi-netlink or ncsi-mctp by different NICTarget and generate dump file 545a727b48SDelphine CC Chiuunder specific folder. 555a727b48SDelphine CC Chiu 565a727b48SDelphine CC ChiuThe following block diagram illustrate entire dump procedure and relationship 575a727b48SDelphine CC Chiubetween modules: 585a727b48SDelphine CC Chiu 595a727b48SDelphine CC Chiu```text 605a727b48SDelphine CC Chiu 615a727b48SDelphine CC Chiu +----------------+ +-----------+ 625a727b48SDelphine CC Chiu | | | | 635a727b48SDelphine CC Chiu -------------> Dump manager +-----------> DumpEntry | 645a727b48SDelphine CC Chiu CreateDump | | | | 655a727b48SDelphine CC Chiu +--------+-------+ +-----------+ 665a727b48SDelphine CC Chiu | 675a727b48SDelphine CC Chiu | 685a727b48SDelphine CC Chiu | 695a727b48SDelphine CC Chiu +--------v-------+ 705a727b48SDelphine CC Chiu | | 715a727b48SDelphine CC Chiu | Dreport | 725a727b48SDelphine CC Chiu | | 735a727b48SDelphine CC Chiu +--------+-------+ 745a727b48SDelphine CC Chiu | 755a727b48SDelphine CC Chiu | 765a727b48SDelphine CC Chiu | 775a727b48SDelphine CC Chiu +--------v-------+ 785a727b48SDelphine CC Chiu | | 795a727b48SDelphine CC Chiu | Plugin: +------------------+ 805a727b48SDelphine CC Chiu | ncsicoredump | | 815a727b48SDelphine CC Chiu | | | 825a727b48SDelphine CC Chiu +--------+-------+ | 835a727b48SDelphine CC Chiu | | 845a727b48SDelphine CC Chiu | | 855a727b48SDelphine CC Chiu | | 865a727b48SDelphine CC Chiu | | 875a727b48SDelphine CC Chiu +------------+ +--------v-------+ +-------v------+ +------------+ 885a727b48SDelphine CC Chiu | | | | | | | | 895a727b48SDelphine CC Chiu | DumpFile <-------+ NCSI-NetLink | | NCSI-MCTP +--------> DumpFile | 905a727b48SDelphine CC Chiu | | | | | | | | 915a727b48SDelphine CC Chiu +------------+ +--------^-------+ +-------^------+ +------------+ 925a727b48SDelphine CC Chiu | | 935a727b48SDelphine CC Chiu --------------------------------+--------------------------+----------------------------- 945a727b48SDelphine CC Chiu Kernel |Netlink |MCTP 955a727b48SDelphine CC Chiu +--------v-------+ +--------v-------+ 965a727b48SDelphine CC Chiu | | | | 975a727b48SDelphine CC Chiu |Net/NC-SI module| | I2C driver | 985a727b48SDelphine CC Chiu | | | | 995a727b48SDelphine CC Chiu +--------^-------+ +--------^-------+ 1005a727b48SDelphine CC Chiu | | 1015a727b48SDelphine CC Chiu |NC-SI |SMBUS 1025a727b48SDelphine CC Chiu | | 1035a727b48SDelphine CC Chiu +--------v--------------------------v-------+ 1045a727b48SDelphine CC Chiu | | 1055a727b48SDelphine CC Chiu | NIC | 1065a727b48SDelphine CC Chiu | | 1075a727b48SDelphine CC Chiu +-------------------------------------------+ 1085a727b48SDelphine CC Chiu 1095a727b48SDelphine CC Chiu``` 1105a727b48SDelphine CC Chiu 1115a727b48SDelphine CC Chiu## Alternatives Considered 1125a727b48SDelphine CC Chiu 1135a727b48SDelphine CC ChiuWe shall block duplicated dump procedure by the reception ordering of NC-SI 1145a727b48SDelphine CC Chiucommand(0x4d) shall be maintained. Since the core dump will contain up to 2 1155a727b48SDelphine CC Chiucrash dump inside, we only support core dump now by it's sufficient for current 1165a727b48SDelphine CC Chiuusage. 1175a727b48SDelphine CC Chiu 1185a727b48SDelphine CC Chiu## Impacts 1195a727b48SDelphine CC Chiu 1205a727b48SDelphine CC ChiuNone. 1215a727b48SDelphine CC Chiu 1225a727b48SDelphine CC Chiu## Testing 1235a727b48SDelphine CC Chiu 1245a727b48SDelphine CC ChiuCo-work with NIC vendor(Broadcom) for dump process/file validation. 125