Project

General

Profile

Feature #12059

libtopo: add API for doing deep copy of a topo_list

Added by Rob Johnston 4 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

Libtopo provides a set of typedefs and interfaces for managing and iterating over doubly-linked lists (topo_list). This ticket to cover the work to add a new interface for making a deep copy of a topo_list.

History

#1

Updated by Rob Johnston 4 months ago

This new interface is currently being leveraged by the tooling that is SAS topology project in illumos-joyent. That tooling exercises the new topo_list_deepcopy() interface. For example:

https://github.com/joyent/illumos-joyent/blob/sastopo/usr/src/lib/fm/topo/libtopo/common/topo_digraph.c#L359

We're upstreaming this change as one of the prerequisites for upstreaming the larger pieces of the SAS Topology project. More specifically this change is leveraged by the code in topo_digraph.c for computing the set of paths between two vertices in a directed graph, which in turn is used to generate the list of all paths between SAS initiators and SAS targets as shown in the new sastopo CLI:

# /usr/lib/fm/fmd/sastopo -pV
sas://type=path/initiator=500304802354b900/port=500304802354b900/port=5000cca0496fa475/target=5000cca0496fa475

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 2 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     23                   23                   9                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 0
  Manufacturer:        HGST
  Model:               HUSMH8010BSS204

sas://type=path/initiator=500304802354b900/port=500304802354b900/port=5000cca031029f85/target=5000cca031029f85

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 2 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  1     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 1
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b900/port=500304802354b900/port=5000cca02c130f79/target=5000cca02c130f79

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 2 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  2     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 2
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b900/port=500304802354b900/port=5000cca0310200e1/target=5000cca0310200e1

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 2 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  3     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 3
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b900/port=500304802354b900/port=5000cca03102a121/target=5000cca03102a121

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 2 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  4     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 4
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b900/port=500304802354b900/port=5000cca031026069/target=5000cca031026069

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 2 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  5     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 5
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b900/port=500304802354b900/port=5000cca031025fed/target=5000cca031025fed

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 2 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  6     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 6
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b900/port=500304802354b900/port=5000cca02c0ea585/target=5000cca02c0ea585

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 2 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  7     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 7
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b700/port=500304802354b700/port=5000cca02c135669/target=5000cca02c135669

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 4 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 8
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b700/port=500304802354b700/port=5000cca0311ce94d/target=5000cca0311ce94d

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 4 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  1     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 9
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b700/port=500304802354b700/port=5000cca031026021/target=5000cca031026021

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 4 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  2     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 10
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b700/port=500304802354b700/port=5000cca0311ce235/target=5000cca0311ce235

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 4 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  3     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 11
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b700/port=500304802354b700/port=5000cca0311cf055/target=5000cca0311cf055

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 4 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  4     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 12
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b700/port=500304802354b700/port=5000cca0311cf0bd/target=5000cca0311cf0bd

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 4 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  5     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 13
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b700/port=500304802354b700/port=5000cca03102009d/target=5000cca03102009d

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 4 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  6     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 14
  Manufacturer:        HGST
  Model:               HUC101818CS4200

sas://type=path/initiator=500304802354b700/port=500304802354b700/port=5000cca031025f89/target=5000cca031025f89

  Node Type:           SAS Initiator
  Location:            CPU2 SLOT 4 PCI-E 3.0 X16
  Manufacturer:        Broadcom / LSI
  Model:               SAS3008 PCI-Express Fusion-MPT SAS-3

  Node Type:           SAS Initiator Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  7     0                    0                    0                    0                   

  Node Type:           SAS Target Port
  PHY Error Counters:
  PHY#  invalid-dword        running-disp-errs    loss-dword-sync      reset-problems      
  0     16                   0                    4                    0                   

  Node Type:           SAS Target
  Location:            Front Disk 15
  Manufacturer:        HGST
  Model:               HUC101818CS4200

#2

Updated by Electric Monk 4 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 2b1b28a876929b1115c4fb169d5af92fbf4ae607

commit  2b1b28a876929b1115c4fb169d5af92fbf4ae607
Author: Rob Johnston <rob.johnston@joyent.com>
Date:   2019-12-14T02:03:53.000Z

    12059 libtopo: add API for doing deep copy of a topo_list
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF