IBND_DISCOVER_FABRIC(3)

✨ IBND_DISCOVER_FABRIC ✨

okay bestie so this is from the OpenIB Programmer's Manual, and it's literally the whole ibnetdiscover library glow-up. manual page name is IBND_DISCOVER_FABRIC(3), in case you were wondering 🫢


πŸ’– NAME πŸ’–

ibnd_discover_fabric, ibnd_destroy_fabric, ibnd_debug ibnd_show_progress β€” initialize the ibnetdiscover library. that's it, that's the job, no cap ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <infiniband/ibnetdisc.h>

ibnd_fabric_t *ibnd_discover_fabric(struct ibmad_port *ibmad_port, int timeout_ms, ib_portid_t *from, int hops)
void ibnd_destroy_fabric(ibnd_fabric_t *fabric)
void ibnd_debug(int i)
void ibnd_show_progress(int i)
int ibnd_set_max_smps_on_wire(int i)

πŸ¦‹ DESCRIPTION πŸ¦‹

ibnd_discover_fabric() πŸ”

so this one goes out and discovers the fabric connected to the port you hand it in ibmad_port, using the timeout you specified. it's giving main character energy fr fr.

the "from" and "hops" parameters are optional and they let you scan just a part of a fabric β€” you say "start at this node "from"" and "go this many "hops" away from it" and boom πŸ’₯. what you get back is a "sub-fabric" that's "centered" literally wherever you felt like choosing. iconic behavior honestly.

⚠️ heads up bestie: ibmad_port must be opened with at least IB_SMI_CLASS and IB_SMI_DIRECT_CLASS classes or ibnd_discover_fabric will simply not work. not optional. periodt.

ibnd_destroy_fabric() 🧹

frees all memory and resources associated with the fabric. clean up after yourself, bestie, we don't leave mess πŸ’…

ibnd_debug() πŸ›

sets the debug level that gets printed while library operations are taking place. turn it up if you want the tea β˜•

ibnd_show_progress() πŸ‘€

tells the library "yes queen, print debug output showing your progress through the fabric." you get to watch it vibe its way node by node 🌈

ibnd_set_max_smps_on_wire() πŸ“‘

sets the number of SMP's that will be issued on the wire simultaneously. more at once = more chaos, your call.


πŸ”₯ RETURN VALUE πŸ”₯

  • ibnd_discover_fabric() β€” returns NULL on failure, otherwise you get a valid ibnd_fabric_t object. slay ✨
  • ibnd_destory_fabric(), ibnd_debug() β€” NONE (yes, ibnd_destory_fabric, that's literally how it's spelled up in here, we don't make the rules πŸ™ˆ)
  • ibnd_set_max_smps_on_wire() β€” the previous value is returned

🌸 EXAMPLES 🌸

discover the entire fabric connected to device mthca0 , port 1 πŸŽ€

     int mgmt_classes[2] = {IB_SMI_CLASS, IB_SMI_DIRECT_CLASS};
     struct ibmad_port *ibmad_port = mad_rpc_open_port(ca, ca_port,
mgmt_classes, 2);      ibnd_fabric_t *fabric =
ibnd_discover_fabric(ibmad_port, 100, NULL, 0);      ...
     ibnd_destroy_fabric(fabric);      mad_rpc_close_port(ibmad_port);

discover only a single node and those nodes connected to it πŸ¦‹

     ...       str2drpath(&(port_id.drpath), from, 0, 0);      ...
     ibnd_discover_fabric(ibmad_port, 100, &port_id, 1);      ...

⭐ SEE ALSO ⭐

libibmad, mad_rpc_open_port β€” go read those too, iykyk πŸ“š


πŸ‘‘ AUTHORS πŸ‘‘

Ira Weiny <weiny2@llnl.gov> β€” thank you for your service, legend 🫢


that's the whole page bestie, go discover a fabric and be iconic about it πŸ’–βœ¨

OpenIB Β· July 25, 2008 Β· IBND_DISCOVER_FABRIC(3) β€” mwah, signing off πŸ’…πŸŽ€

πŸ“¦ where this page comes from