| NVIDIA DOCA SDK | Data Center on a Chip Framework Documentation |

Macros | |
| #define | DOCA_SHIFT(_x) (__doca_builtin_ffsll(_x) - 1) |
| #define | DOCA_HTOBE16(_x) _byteswap_ushort(_x) |
| #define | DOCA_HTOBE32(_x) _byteswap_ulong(_x) |
| #define | DOCA_BETOH16(_x) _byteswap_ushort(_x) |
| #define | DOCA_BETOH32(_x) _byteswap_ulong(_x) |
| #define | DOCA_U8_GENMASK(_h, _l) ((UINT8_MAX - (UINT8_C(1) << (_l)) + 1) & (UINT8_MAX >> (8 - 1 - (_h)))) |
| #define | DOCA_U8P_GENMASK(_h, _l, _p) |
| #define | DOCA_BE16_GENMASK(_h, _l) (DOCA_HTOBE16((UINT16_MAX - (UINT16_C(1) << (_l)) + 1) & (UINT16_MAX >> (16 - 1 - (_h))))) |
| #define | DOCA_BE16P_GENMASK(_h, _l, _p) |
| #define | DOCA_BE32_GENMASK(_h, _l) (DOCA_HTOBE32((UINT32_MAX - (UINT32_C(1) << (_l)) + 1) & (UINT32_MAX >> (32 - 1 - (_h))))) |
| #define | DOCA_BE32P_GENMASK(_h, _l, _p) |
| #define | DOCA_U8_SET(_m, _v) ((_v << DOCA_SHIFT(_m)) & _m) |
| #define | DOCA_U8P_SET(_m, _v, _p) |
| #define | DOCA_BE16_SET(_m, _v) ((DOCA_HTOBE16(_v << DOCA_SHIFT(DOCA_BETOH16(_m)))) & _m) |
| #define | DOCA_BE16P_SET(_m, _v, _p) |
| #define | DOCA_BE32_SET(_m, _v) ((DOCA_HTOBE32(_v << DOCA_SHIFT(DOCA_BETOH32(_m)))) & _m) |
| #define | DOCA_BE32P_SET(_m, _v, _p) |
| #define | DOCA_U8_GET(_m, _f) (((_m) & (_f)) >> DOCA_SHIFT((_m))) |
| #define | DOCA_BE16_GET(_m, _f) ((DOCA_BETOH16((_m) & (_f)) >> DOCA_SHIFT(DOCA_BETOH16(_m)))) |
| #define | DOCA_BE32_GET(_m, _f) ((DOCA_BETOH32((_m) & (_f)) >> DOCA_SHIFT(DOCA_BETOH32(_m)))) |
Functions | |
| static int | __doca_builtin_ffsll (long long x) |
DOCA bitfield introduces bitfield operations on DOCA type that are common for many libraries.
| #define DOCA_BE16_GENMASK | ( | _h, | |
| _l | |||
| ) | (DOCA_HTOBE16((UINT16_MAX - (UINT16_C(1) << (_l)) + 1) & (UINT16_MAX >> (16 - 1 - (_h))))) |
DOCA_BE16_GENMASK() - generate continuous mask from _l bit to _h bit, return in big endian For example, DOCA_BE16_GENMASK(11, 4) -> htons(0x0FF0)
| _l | lowest bit |
| _h | highest bit |
Definition at line 161 of file doca_bitfield.h.
| #define DOCA_BE16_GET | ( | _m, | |
| _f | |||
| ) | ((DOCA_BETOH16((_m) & (_f)) >> DOCA_SHIFT(DOCA_BETOH16(_m)))) |
DOCA_BE16_GET() - get a bitfield segment value
| _m | doca_be16_t, shifted mask defined field's width and position |
| _f | doca_be16_t, entire register value |
DOCA_BE16_GET() get the field value in host endian specified by _m from the register passed in as _f by masking and shifting it down
Definition at line 304 of file doca_bitfield.h.
| #define DOCA_BE16_SET | ( | _m, | |
| _v | |||
| ) | ((DOCA_HTOBE16(_v << DOCA_SHIFT(DOCA_BETOH16(_m)))) & _m) |
DOCA_BE16_SET() - set a bitfield segment in big endian and return
| _m | doca_be16_t, shifted mask defined field's width and position |
| _v | host endian, value to set in field |
DOCA_BE16_SET() mask and shift up the value and return in doca_be16_t The return value should be logical OR with other fields in register.
Definition at line 237 of file doca_bitfield.h.
| #define DOCA_BE16P_GENMASK | ( | _h, | |
| _l, | |||
| _p | |||
| ) |
DOCA_BE16P_GENMASK() - generate continuous mask from _l bit to _h bit, put in _p pointed memory in big endian
| _l | lowest bit |
| _h | highest bit |
| _p | pointer of doca_be16_t |
Definition at line 172 of file doca_bitfield.h.
| #define DOCA_BE16P_SET | ( | _m, | |
| _v, | |||
| _p | |||
| ) |
DOCA_BE16P_SET() - set a bitfield segment in _p pointed doca_be16_t field
| _m | doca_be16_t, shifted mask defined field's width and position |
| _v | host endian, value to set in field |
| _p | doca_be16_t, pointer to field |
DOCA_BE16P_SET() mask and shift up the value and logical OR with other fields in doca_be16_t
Definition at line 248 of file doca_bitfield.h.
| #define DOCA_BE32_GENMASK | ( | _h, | |
| _l | |||
| ) | (DOCA_HTOBE32((UINT32_MAX - (UINT32_C(1) << (_l)) + 1) & (UINT32_MAX >> (32 - 1 - (_h))))) |
DOCA_BE32_GENMASK() - generate continuous mask from _l bit to _h bit, return in big endian For example, DOCA_BE32_GENMASK(23, 4) -> htonl(0x00FFFFF0)
| _l | lowest bit |
| _h | highest bit |
Definition at line 184 of file doca_bitfield.h.
| #define DOCA_BE32_GET | ( | _m, | |
| _f | |||
| ) | ((DOCA_BETOH32((_m) & (_f)) >> DOCA_SHIFT(DOCA_BETOH32(_m)))) |
DOCA_BE32_GET() - get a bitfield segment value
| _m | doca_be32_t, shifted mask defined field's width and position |
| _f | doca_be32_t, entire register value |
DOCA_BE32_GET() get the field value in host endian specified by _m from the register passed in as _f by masking and shifting it down
Definition at line 315 of file doca_bitfield.h.
| #define DOCA_BE32_SET | ( | _m, | |
| _v | |||
| ) | ((DOCA_HTOBE32(_v << DOCA_SHIFT(DOCA_BETOH32(_m)))) & _m) |
DOCA_BE32_SET() - set a bitfield segment in big endian and return
| _m | doca_be32_t, shifted mask defined field's width and position |
| _v | host endian, value to set in field |
DOCA_BE32_SET() mask and shift up the value and return in doca_be32_t The return value should be logical OR with other fields in register.
Definition at line 265 of file doca_bitfield.h.
| #define DOCA_BE32P_GENMASK | ( | _h, | |
| _l, | |||
| _p | |||
| ) |
DOCA_BE32P_GENMASK() - generate continuous mask from _l bit to _h bit, put in _p pointed memory in big endian
| _l | lowest bit |
| _h | highest bit |
| _p | pointer of doca_be32_t |
Definition at line 195 of file doca_bitfield.h.
| #define DOCA_BE32P_SET | ( | _m, | |
| _v, | |||
| _p | |||
| ) |
DOCA_BE32P_SET() - set a bitfield segment in _p pointed doca_be32_t field
| _m | doca_be32_t, shifted mask defined field's width and position |
| _v | host endian, value to set in field |
| _p | doca_be32_t, pointer to field |
DOCA_BE32P_SET() mask and shift up the value and logical OR with other fields in doca_be32_t
Definition at line 276 of file doca_bitfield.h.
| #define DOCA_BETOH16 | ( | _x | ) | _byteswap_ushort(_x) |
DOCA_BETOH16() - convert 16bit to host endian from big endian
| _x | value |
Definition at line 121 of file doca_bitfield.h.
| #define DOCA_BETOH32 | ( | _x | ) | _byteswap_ulong(_x) |
DOCA_BETOH32() - convert 32bit to host endian from big endian
| _x | value |
Definition at line 128 of file doca_bitfield.h.
| #define DOCA_HTOBE16 | ( | _x | ) | _byteswap_ushort(_x) |
DOCA_HTOBE16() - convert 16bit type to big endian from host endian
| _x | value |
Definition at line 107 of file doca_bitfield.h.
| #define DOCA_HTOBE32 | ( | _x | ) | _byteswap_ulong(_x) |
DOCA_HTOBE32() - convert 32bit type to big endian from host endian
| _x | value |
Definition at line 114 of file doca_bitfield.h.
| #define DOCA_SHIFT | ( | _x | ) | (__doca_builtin_ffsll(_x) - 1) |
DOCA_SHIFT() - get number of bits shifted
| _x | value |
Definition at line 100 of file doca_bitfield.h.
| #define DOCA_U8_GENMASK | ( | _h, | |
| _l | |||
| ) | ((UINT8_MAX - (UINT8_C(1) << (_l)) + 1) & (UINT8_MAX >> (8 - 1 - (_h)))) |
DOCA_U8_GENMASK() - generate continuous mask from _l bit to _h bit, return in host endian For example, DOCA_U8_GENMASK(7, 4) -> 0xF0
| _l | lowest bit |
| _h | highest bit |
Definition at line 139 of file doca_bitfield.h.
| #define DOCA_U8_GET | ( | _m, | |
| _f | |||
| ) | (((_m) & (_f)) >> DOCA_SHIFT((_m))) |
DOCA_U8_GET() - get a bitfield segment value
| _m | uint8_t, shifted mask defined field's width and position |
| _f | uint8_t, entire register value |
DOCA_U8_GET() get the field value in host endian specified by _m from the register passed in as _f by masking and shifting it down
Definition at line 293 of file doca_bitfield.h.
| #define DOCA_U8_SET | ( | _m, | |
| _v | |||
| ) | ((_v << DOCA_SHIFT(_m)) & _m) |
DOCA_U8_SET() - set a bitfield segment in host endian and return
| _m | uint8_t, shifted mask defined field's width and position |
| _v | host endian, value to set in field |
DOCA_U8_SET() mask and shift up the value and return in uint8_t The return value should be logical OR with other fields in register.
Definition at line 209 of file doca_bitfield.h.
| #define DOCA_U8P_GENMASK | ( | _h, | |
| _l, | |||
| _p | |||
| ) |
DOCA_U8P_GENMASK() - generate continuous mask from _l bit to _h bit, put in _p pointed memory in host endian
| _l | lowest bit |
| _h | highest bit |
| _p | pointer of uint8_t |
Definition at line 149 of file doca_bitfield.h.
| #define DOCA_U8P_SET | ( | _m, | |
| _v, | |||
| _p | |||
| ) |
DOCA_U8P_SET() - set a bitfield segment in _p pointed uint8_t field
| _m | uint8_t, shifted mask defined field's width and position |
| _v | host endian, value to set in field |
| _p | uint8_t, pointer to field |
DOCA_U8P_SET() mask and shift up the value and logical OR with other fields in uint8_t
Definition at line 220 of file doca_bitfield.h.
|
static |
__doca_builtin_ffsll() - internal implementation on windows, equal to gnu's __builtin_ffsll();
| x | value |
Definition at line 84 of file doca_bitfield.h.