UMAD_SET_GRH_NET(3)

πŸ“¦
version 65.0 Β· 2 versions
  • 65.0 Β· alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.3.10.2 Β· nixos 26.05, nixpkgs unstable
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– UMAD_SET_GRH_NET πŸ’–

okay bestie, so this is a page from the OpenIB Programmer's Manual and it's literally called umad_set_grh_net β€” she sets GRH fields inside your umad buffer, but make it network ordering 🫢


✨ NAME ✨

umad_set_grh_net β€” set GRH fields within umad buffer using network ordering πŸ’…


🌸 SYNOPSIS 🌸

#include <infiniband/umad.h>

int umad_set_grh_net(void *umad, void *mad_addr);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: umad_set_grh_net() sets the GRH fields β€” and when I say the GRH fields I mean grh_present, gid, hop_limit, traffic_class, and flow_label β€” inside the umad buffer you hand her, based on the mad_addr you supply. ✨

and listen, the mad_addr fields you pass in are expected to be in network order. no cap. that's the whole point of the _net in the name, she's not doing the byte-swapping for you πŸ™ˆ

if the mad_addr pointer you give her is NULL? then no GRH gets set at all. simple as that.

the mad_addr argument is a pointer to an ib_mad_addr_t struct, as specified in <infiniband/umad.h>. and the umad argument is a pointer to an ib_user_mad_t struct, also as specified in <infiniband/umad.h>. iconic header, we love her πŸ’œ

typedef struct ib_mad_addr {
        uint32_t qpn;
        uint32_t qkey;
        uint16_t lid;
        uint8_t  sl;
        uint8_t  path_bits;
        uint8_t  grh_present;
        uint8_t  gid_index;
        uint8_t  hop_limit;
        uint8_t  traffic_class;
        uint8_t  gid[16];
        uint32_t flow_label;
} ib_mad_addr_t;

typedef struct ib_user_mad {
        uint32_t agent_id;
        uint32_t status;
        uint32_t timeout_ms;
        uint32_t retries;
        uint32_t length;
        ib_mad_addr_t addr;
        uint8_t  data[0];
} ib_user_mad_t;

πŸŽ€ RETURN VALUE πŸŽ€

umad_set_grh_net() returns 0 on success, and a negative value on errors. currently, there are no errors indicated β€” like, zero. none. the error list is empty, bestie πŸ’€


πŸ’€ KNOWN BUGS πŸ’€

Not implemented.

yeah. she's giving concept. she's giving idea. she is not giving implementation 😭


🌈 SEE ALSO 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Hal Rosenstock <halr@voltaire.com> πŸ’–


and that's the whole page fr fr πŸ“ this was OpenIB, dated May 24, 2007 β€” yes she's an elder but she's still serving ✨ mwah, study hard, drink water, and remember: network order or it didn't happen πŸ’…πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from