---
name: "umad_register2"
section: "3"
platform: "linux"
package: "rdma-core"
version: "65.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/umad_register2"
---

# umad\_register2(3)

register the specified management class and version for port

## NAME

umad\_register2 - register the specified management class and version for port

## SYNOPSIS

```
#include <infiniband/umad.h>

int umad_register2(int port_fd, struct umad_reg_attr *attr, uint32_t *agent_id);
```

## DESCRIPTION

**umad\_register2()** registers for a MAD agent using the provided registration attributes

*port\_fd* the port on which to register the agent

*attr* The registration attributes as defined by the structure passed.  See below for details of this structure.

*agent\_id* returned on success.  agent\_id identifies the kernel MAD agent a MAD is received by or to be sent by.  agent\_id is returned in the umad header "struct ib\_user\_mad" on recv and specified in umad\_send when sending.

## REGISTRATION ATTRIBUTE STRUCTURE

```
struct umad_reg_attr {
uint8_t    mgmt_class;
uint8_t    mgmt_class_version;
uint32_t   flags;
uint64_t   method_mask[2];
uint32_t   oui;
uint8_t    rmpp_version;
};
mgmt_class
Management class to register for.
mgmt_class_version
Management class version to register for.
flags
Registration flags.  If a flag specified is not supported by the kernel,
an error is returned, and the supported flags are returned in this field.
```

Current flags are: UMAD\_USER\_RMPP -- flag to indicate the kernel should not process RMPP packets.  All RMPP packets will be treated like individual MADs.  The user is responsible for implementing the RMPP protocol.

*method\_mask* A bit mask which indicates which unsolicited methods this agent should receive.  Setting this array to 0 will result in the agent only receiving response MADs for which a request was sent.

*oui* The oui (in host order) to use for vendor classes 0x30 - 0x4f. Otherwise ignored.

*rmpp\_version* If the class supports RMPP and kernel RMPP is enabled (the default) indicate which rmpp\_version to use.

## RETURN VALUE

**umad\_register2()** returns 0 on success and +ERRNO on failure.

## SEE ALSO

[**umad\_unregister**(3)](/umad_unregister/3.md)

## AUTHOR

- Ira Weiny \<ira.weiny@intel.com\>
