Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ib_pack.h File Reference
#include <rdma/ib_verbs.h>

Go to the source code of this file.

Data Structures

struct  ib_field
 
struct  ib_unpacked_lrh
 
struct  ib_unpacked_grh
 
struct  ib_unpacked_bth
 
struct  ib_unpacked_deth
 
struct  ib_unpacked_eth
 
struct  ib_unpacked_vlan
 
struct  ib_ud_header
 

Macros

#define RESERVED   .field_name = "reserved"
 
#define IB_OPCODE(transport, op)
 

Enumerations

enum  {
  IB_LRH_BYTES = 8, IB_ETH_BYTES = 14, IB_VLAN_BYTES = 4, IB_GRH_BYTES = 40,
  IB_BTH_BYTES = 12, IB_DETH_BYTES = 8
}
 
enum  {
  IB_OPCODE_RC = 0x00, IB_OPCODE_UC = 0x20, IB_OPCODE_RD = 0x40, IB_OPCODE_UD = 0x60,
  IB_OPCODE_SEND_FIRST = 0x00, IB_OPCODE_SEND_MIDDLE = 0x01, IB_OPCODE_SEND_LAST = 0x02, IB_OPCODE_SEND_LAST_WITH_IMMEDIATE = 0x03,
  IB_OPCODE_SEND_ONLY = 0x04, IB_OPCODE_SEND_ONLY_WITH_IMMEDIATE = 0x05, IB_OPCODE_RDMA_WRITE_FIRST = 0x06, IB_OPCODE_RDMA_WRITE_MIDDLE = 0x07,
  IB_OPCODE_RDMA_WRITE_LAST = 0x08, IB_OPCODE_RDMA_WRITE_LAST_WITH_IMMEDIATE = 0x09, IB_OPCODE_RDMA_WRITE_ONLY = 0x0a, IB_OPCODE_RDMA_WRITE_ONLY_WITH_IMMEDIATE = 0x0b,
  IB_OPCODE_RDMA_READ_REQUEST = 0x0c, IB_OPCODE_RDMA_READ_RESPONSE_FIRST = 0x0d, IB_OPCODE_RDMA_READ_RESPONSE_MIDDLE = 0x0e, IB_OPCODE_RDMA_READ_RESPONSE_LAST = 0x0f,
  IB_OPCODE_RDMA_READ_RESPONSE_ONLY = 0x10, IB_OPCODE_ACKNOWLEDGE = 0x11, IB_OPCODE_ATOMIC_ACKNOWLEDGE = 0x12, IB_OPCODE_COMPARE_SWAP = 0x13,
  IB_OPCODE_FETCH_ADD = 0x14, IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST),
  IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST), IB_OPCODE =(RC, SEND_FIRST)
}
 
enum  { IB_LNH_RAW = 0, IB_LNH_IP = 1, IB_LNH_IBA_LOCAL = 2, IB_LNH_IBA_GLOBAL = 3 }
 

Functions

void ib_pack (const struct ib_field *desc, int desc_len, void *structure, void *buf)
 
void ib_unpack (const struct ib_field *desc, int desc_len, void *buf, void *structure)
 
void ib_ud_header_init (int payload_bytes, int lrh_present, int eth_present, int vlan_present, int grh_present, int immediate_present, struct ib_ud_header *header)
 
int ib_ud_header_pack (struct ib_ud_header *header, void *buf)
 
int ib_ud_header_unpack (void *buf, struct ib_ud_header *header)
 

Macro Definition Documentation

#define IB_OPCODE (   transport,
  op 
)
Value:
IB_OPCODE_ ## transport ## _ ## op = \
IB_OPCODE_ ## transport + IB_OPCODE_ ## op

Definition at line 68 of file ib_pack.h.

#define RESERVED   .field_name = "reserved"

Definition at line 56 of file ib_pack.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
IB_LRH_BYTES 
IB_ETH_BYTES 
IB_VLAN_BYTES 
IB_GRH_BYTES 
IB_BTH_BYTES 
IB_DETH_BYTES 

Definition at line 38 of file ib_pack.h.

anonymous enum
Enumerator:
IB_OPCODE_RC 
IB_OPCODE_UC 
IB_OPCODE_RD 
IB_OPCODE_UD 
IB_OPCODE_SEND_FIRST 
IB_OPCODE_SEND_MIDDLE 
IB_OPCODE_SEND_LAST 
IB_OPCODE_SEND_LAST_WITH_IMMEDIATE 
IB_OPCODE_SEND_ONLY 
IB_OPCODE_SEND_ONLY_WITH_IMMEDIATE 
IB_OPCODE_RDMA_WRITE_FIRST 
IB_OPCODE_RDMA_WRITE_MIDDLE 
IB_OPCODE_RDMA_WRITE_LAST 
IB_OPCODE_RDMA_WRITE_LAST_WITH_IMMEDIATE 
IB_OPCODE_RDMA_WRITE_ONLY 
IB_OPCODE_RDMA_WRITE_ONLY_WITH_IMMEDIATE 
IB_OPCODE_RDMA_READ_REQUEST 
IB_OPCODE_RDMA_READ_RESPONSE_FIRST 
IB_OPCODE_RDMA_READ_RESPONSE_MIDDLE 
IB_OPCODE_RDMA_READ_RESPONSE_LAST 
IB_OPCODE_RDMA_READ_RESPONSE_ONLY 
IB_OPCODE_ACKNOWLEDGE 
IB_OPCODE_ATOMIC_ACKNOWLEDGE 
IB_OPCODE_COMPARE_SWAP 
IB_OPCODE_FETCH_ADD 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 
IB_OPCODE 

Definition at line 72 of file ib_pack.h.

anonymous enum
Enumerator:
IB_LNH_RAW 
IB_LNH_IP 
IB_LNH_IBA_LOCAL 
IB_LNH_IBA_GLOBAL 

Definition at line 170 of file ib_pack.h.

Function Documentation

void ib_pack ( const struct ib_field desc,
int  desc_len,
void structure,
void buf 
)

ib_pack - Pack a structure into a buffer :Array of structure field descriptions :Number of entries in :Structure to pack from :Buffer to pack into

ib_pack() packs a list of structure fields into a buffer, controlled by the array of fields in .

Definition at line 62 of file packer.c.

void ib_ud_header_init ( int  payload_bytes,
int  lrh_present,
int  eth_present,
int  vlan_present,
int  grh_present,
int  immediate_present,
struct ib_ud_header header 
)

ib_ud_header_init - Initialize UD header structure :Length of packet payload : specify if LRH is present : specify if Eth header is present : packet is tagged vlan :GRH flag (if non-zero, GRH will be included) : specify if immediate data is present :Structure to initialize

Definition at line 226 of file ud_header.c.

int ib_ud_header_pack ( struct ib_ud_header header,
void buf 
)

ib_ud_header_pack - Pack UD header struct into wire format :UD header struct :Buffer to pack into

ib_ud_header_pack() packs the UD header structure into wire format in the buffer .

Definition at line 289 of file ud_header.c.

int ib_ud_header_unpack ( void buf,
struct ib_ud_header header 
)

ib_ud_header_unpack - Unpack UD header struct from wire format :UD header struct :Buffer to pack into

ib_ud_header_pack() unpacks the UD header structure from wire format in the buffer .

Definition at line 340 of file ud_header.c.

void ib_unpack ( const struct ib_field desc,
int  desc_len,
void buf,
void structure 
)

ib_unpack - Unpack a buffer into a structure :Array of structure field descriptions :Number of entries in :Buffer to unpack from :Structure to unpack into

ib_pack() unpacks a list of structure fields from a buffer, controlled by the array of fields in .

Definition at line 149 of file packer.c.