| 1 | --- |
| 2 | date: 2006-10-31 |
| 3 | footer: libibverbs |
| 4 | header: "Libibverbs Programmer's Manual" |
| 5 | layout: page |
| 6 | license: 'Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md' |
| 7 | section: 3 |
| 8 | title: IBV_RATE_TO_MULT |
| 9 | --- |
| 10 | |
| 11 | # NAME |
| 12 | |
| 13 | ibv_rate_to_mult - convert IB rate enumeration to multiplier of 2.5 Gbit/sec |
| 14 | |
| 15 | mult_to_ibv_rate - convert multiplier of 2.5 Gbit/sec to an IB rate |
| 16 | enumeration |
| 17 | |
| 18 | # SYNOPSIS |
| 19 | |
| 20 | ```c |
| 21 | #include <infiniband/verbs.h> |
| 22 | |
| 23 | int ibv_rate_to_mult(enum ibv_rate rate); |
| 24 | |
| 25 | enum ibv_rate mult_to_ibv_rate(int mult); |
| 26 | ``` |
| 27 | |
| 28 | # DESCRIPTION |
| 29 | |
| 30 | **ibv_rate_to_mult()** converts the IB transmission rate enumeration *rate* to |
| 31 | a multiple of 2.5 Gbit/sec (the base rate). For example, if *rate* is |
| 32 | **IBV_RATE_5_GBPS**, the value 2 will be returned (5 Gbit/sec = 2 * 2.5 |
| 33 | Gbit/sec). |
| 34 | |
| 35 | **mult_to_ibv_rate()** converts the multiplier value (of 2.5 Gbit/sec) *mult* |
| 36 | to an IB transmission rate enumeration. For example, if *mult* is 2, the rate |
| 37 | enumeration **IBV_RATE_5_GBPS** will be returned. |
| 38 | |
| 39 | # RETURN VALUE |
| 40 | |
| 41 | **ibv_rate_to_mult()** returns the multiplier of the base rate 2.5 Gbit/sec. |
| 42 | |
| 43 | **mult_to_ibv_rate()** returns the enumeration representing the IB |
| 44 | transmission rate. |
| 45 | |
| 46 | # SEE ALSO |
| 47 | |
| 48 | **ibv_query_port**(3) |
| 49 | |
| 50 | # AUTHOR |
| 51 | |
| 52 | Dotan Barak <[email protected]> |