photon  1.1
Data Structures | Macros | Typedefs | Functions
photon_request.h File Reference
#include "photon_backend.h"
#include "photon_rdma_ledger.h"
#include "photon_rdma_INFO_ledger.h"
#include "bit_array/bit_array.h"
#include "libsync/locks.h"
#include "libsync/queues.h"

Go to the source code of this file.

Data Structures

struct  photon_req
 
struct  photon_req_table
 

Macros

#define DEF_NR_LEVELS   (14)
 
#define DEF_NUM_REQUESTS   (1024)
 
#define DEF_MAX_REQUESTS   (1<<20)
 
#define NULL_REQUEST   0x0
 
#define DEF_MAX_BUF_ENTRIES   64
 
#define REQUEST_NEW   0x01
 
#define REQUEST_PENDING   0x02
 
#define REQUEST_FAILED   0x03
 
#define REQUEST_COMPLETED   0x04
 
#define REQUEST_FREE   0x05
 
#define REQUEST_COOK_MASK   0xfff00000
 
#define REQUEST_COOK_NIL   0xff000000
 
#define REQUEST_COOK_SEND   0xff100000
 
#define REQUEST_COOK_RECV   0xff200000
 
#define REQUEST_COOK_EAGER   0xff300000
 
#define REQUEST_COOK_ELEDG   0xff400000
 
#define REQUEST_COOK_PLEDG   0xff500000
 
#define REQUEST_COOK_EBUF   0xff600000
 
#define REQUEST_COOK_PBUF   0xff700000
 
#define REQUEST_COOK_FIN   0xff800000
 
#define REQUEST_COOK_SINFO   0xff900000
 
#define REQUEST_COOK_RINFO   0xffa00000
 
#define REQUEST_COOK_GPWC   0xffb00000
 
#define REQUEST_OP_DEFAULT   0x0000
 
#define REQUEST_OP_SENDBUF   (1<<1)
 
#define REQUEST_OP_SENDREQ   (1<<2)
 
#define REQUEST_OP_SENDFIN   (1<<3)
 
#define REQUEST_OP_RECVBUF   (1<<4)
 
#define REQUEST_OP_PWC   (1<<5)
 
#define REQUEST_OP_COLL   (1<<6)
 
#define REQUEST_FLAG_NIL   0x0000
 
#define REQUEST_FLAG_WFIN   (1<<1)
 
#define REQUEST_FLAG_EAGER   (1<<2)
 
#define REQUEST_FLAG_EDONE   (1<<3)
 
#define REQUEST_FLAG_LDONE   (1<<4)
 
#define REQUEST_FLAG_NO_LCE   (1<<5)
 
#define REQUEST_FLAG_NO_RCE   (1<<6)
 
#define REQUEST_FLAG_ROP   (1<<7)
 
#define REQUEST_FLAG_1PWC   (1<<8)
 
#define REQUEST_FLAG_2PWC   (1<<9)
 
#define REQUEST_FLAG_CMD   (1<<10)
 
#define MARK_DONE(e, s)   (sync_fadd(&e->tail, s, SYNC_RELAXED))
 
#define PROC_REQUEST_ID(p, id)   (((uint64_t)p<<32) | id)
 
#define IS_VALID_PROC(p)   ((p >= 0) && (p < _photon_nproc))
 

Typedefs

typedef struct photon_req_t * photonRequest
 
typedef struct photon_req_table_t * photonRequestTable
 

Functions

PHOTON_INTERNAL int photon_request_init (photonConfig cfg)
 
PHOTON_INTERNAL photonRequest photon_get_request (int proc)
 
PHOTON_INTERNAL int photon_free_request (photonRequest req)
 
PHOTON_INTERNAL int photon_count_request (int proc)
 
photonRequest photon_lookup_request (photon_rid rid)
 
PHOTON_INTERNAL photonRequest photon_setup_request_direct (photonBuffer lbuf, photonBuffer rbuf, uint64_t size, int proc, int events)
 
PHOTON_INTERNAL photonRequest photon_setup_request_ledger_info (photonRILedgerEntry ri_entry, int curr, int proc)
 
PHOTON_INTERNAL photonRequest photon_setup_request_ledger_eager (photonRDMALedgerEntry l_entry, int curr, int proc)
 
PHOTON_INTERNAL photonRequest photon_setup_request_send (photonAddr addr, int *bufs, int nbufs)
 
PHOTON_INTERNAL photonRequest photon_setup_request_recv (photonAddr addr, int msn, int msize, int bindex, int nbufs)
 

Macro Definition Documentation

◆ DEF_MAX_BUF_ENTRIES

#define DEF_MAX_BUF_ENTRIES   64

Definition at line 33 of file photon_request.h.

◆ DEF_MAX_REQUESTS

#define DEF_MAX_REQUESTS   (1<<20)

Definition at line 30 of file photon_request.h.

◆ DEF_NR_LEVELS

#define DEF_NR_LEVELS   (14)

Definition at line 28 of file photon_request.h.

◆ DEF_NUM_REQUESTS

#define DEF_NUM_REQUESTS   (1024)

Definition at line 29 of file photon_request.h.

◆ IS_VALID_PROC

#define IS_VALID_PROC (   p)    ((p >= 0) && (p < _photon_nproc))

Definition at line 77 of file photon_request.h.

◆ MARK_DONE

#define MARK_DONE (   e,
 
)    (sync_fadd(&e->tail, s, SYNC_RELAXED))

Definition at line 75 of file photon_request.h.

◆ NULL_REQUEST

#define NULL_REQUEST   0x0

Definition at line 32 of file photon_request.h.

◆ PROC_REQUEST_ID

#define PROC_REQUEST_ID (   p,
  id 
)    (((uint64_t)p<<32) | id)

Definition at line 76 of file photon_request.h.

◆ REQUEST_COMPLETED

#define REQUEST_COMPLETED   0x04

Definition at line 38 of file photon_request.h.

◆ REQUEST_COOK_EAGER

#define REQUEST_COOK_EAGER   0xff300000

Definition at line 45 of file photon_request.h.

◆ REQUEST_COOK_EBUF

#define REQUEST_COOK_EBUF   0xff600000

Definition at line 48 of file photon_request.h.

◆ REQUEST_COOK_ELEDG

#define REQUEST_COOK_ELEDG   0xff400000

Definition at line 46 of file photon_request.h.

◆ REQUEST_COOK_FIN

#define REQUEST_COOK_FIN   0xff800000

Definition at line 50 of file photon_request.h.

◆ REQUEST_COOK_GPWC

#define REQUEST_COOK_GPWC   0xffb00000

Definition at line 53 of file photon_request.h.

◆ REQUEST_COOK_MASK

#define REQUEST_COOK_MASK   0xfff00000

Definition at line 41 of file photon_request.h.

◆ REQUEST_COOK_NIL

#define REQUEST_COOK_NIL   0xff000000

Definition at line 42 of file photon_request.h.

◆ REQUEST_COOK_PBUF

#define REQUEST_COOK_PBUF   0xff700000

Definition at line 49 of file photon_request.h.

◆ REQUEST_COOK_PLEDG

#define REQUEST_COOK_PLEDG   0xff500000

Definition at line 47 of file photon_request.h.

◆ REQUEST_COOK_RECV

#define REQUEST_COOK_RECV   0xff200000

Definition at line 44 of file photon_request.h.

◆ REQUEST_COOK_RINFO

#define REQUEST_COOK_RINFO   0xffa00000

Definition at line 52 of file photon_request.h.

◆ REQUEST_COOK_SEND

#define REQUEST_COOK_SEND   0xff100000

Definition at line 43 of file photon_request.h.

◆ REQUEST_COOK_SINFO

#define REQUEST_COOK_SINFO   0xff900000

Definition at line 51 of file photon_request.h.

◆ REQUEST_FAILED

#define REQUEST_FAILED   0x03

Definition at line 37 of file photon_request.h.

◆ REQUEST_FLAG_1PWC

#define REQUEST_FLAG_1PWC   (1<<8)

Definition at line 71 of file photon_request.h.

◆ REQUEST_FLAG_2PWC

#define REQUEST_FLAG_2PWC   (1<<9)

Definition at line 72 of file photon_request.h.

◆ REQUEST_FLAG_CMD

#define REQUEST_FLAG_CMD   (1<<10)

Definition at line 73 of file photon_request.h.

◆ REQUEST_FLAG_EAGER

#define REQUEST_FLAG_EAGER   (1<<2)

Definition at line 65 of file photon_request.h.

◆ REQUEST_FLAG_EDONE

#define REQUEST_FLAG_EDONE   (1<<3)

Definition at line 66 of file photon_request.h.

◆ REQUEST_FLAG_LDONE

#define REQUEST_FLAG_LDONE   (1<<4)

Definition at line 67 of file photon_request.h.

◆ REQUEST_FLAG_NIL

#define REQUEST_FLAG_NIL   0x0000

Definition at line 63 of file photon_request.h.

◆ REQUEST_FLAG_NO_LCE

#define REQUEST_FLAG_NO_LCE   (1<<5)

Definition at line 68 of file photon_request.h.

◆ REQUEST_FLAG_NO_RCE

#define REQUEST_FLAG_NO_RCE   (1<<6)

Definition at line 69 of file photon_request.h.

◆ REQUEST_FLAG_ROP

#define REQUEST_FLAG_ROP   (1<<7)

Definition at line 70 of file photon_request.h.

◆ REQUEST_FLAG_WFIN

#define REQUEST_FLAG_WFIN   (1<<1)

Definition at line 64 of file photon_request.h.

◆ REQUEST_FREE

#define REQUEST_FREE   0x05

Definition at line 39 of file photon_request.h.

◆ REQUEST_NEW

#define REQUEST_NEW   0x01

Definition at line 35 of file photon_request.h.

◆ REQUEST_OP_COLL

#define REQUEST_OP_COLL   (1<<6)

Definition at line 61 of file photon_request.h.

◆ REQUEST_OP_DEFAULT

#define REQUEST_OP_DEFAULT   0x0000

Definition at line 55 of file photon_request.h.

◆ REQUEST_OP_PWC

#define REQUEST_OP_PWC   (1<<5)

Definition at line 60 of file photon_request.h.

◆ REQUEST_OP_RECVBUF

#define REQUEST_OP_RECVBUF   (1<<4)

Definition at line 59 of file photon_request.h.

◆ REQUEST_OP_SENDBUF

#define REQUEST_OP_SENDBUF   (1<<1)

Definition at line 56 of file photon_request.h.

◆ REQUEST_OP_SENDFIN

#define REQUEST_OP_SENDFIN   (1<<3)

Definition at line 58 of file photon_request.h.

◆ REQUEST_OP_SENDREQ

#define REQUEST_OP_SENDREQ   (1<<2)

Definition at line 57 of file photon_request.h.

◆ REQUEST_PENDING

#define REQUEST_PENDING   0x02

Definition at line 36 of file photon_request.h.

Typedef Documentation

◆ photonRequest

typedef struct photon_req_t* photonRequest

Definition at line 126 of file photon_request.h.

◆ photonRequestTable

typedef struct photon_req_table_t* photonRequestTable

Definition at line 127 of file photon_request.h.

Function Documentation

◆ photon_count_request()

PHOTON_INTERNAL int photon_count_request ( int  proc)

Definition at line 165 of file photon_request.c.

◆ photon_free_request()

PHOTON_INTERNAL int photon_free_request ( photonRequest  req)

Definition at line 189 of file photon_request.c.

◆ photon_get_request()

PHOTON_INTERNAL photonRequest photon_get_request ( int  proc)

Definition at line 88 of file photon_request.c.

◆ photon_lookup_request()

photonRequest photon_lookup_request ( photon_rid  rid)

Definition at line 138 of file photon_request.c.

◆ photon_request_init()

PHOTON_INTERNAL int photon_request_init ( photonConfig  cfg)

Definition at line 26 of file photon_request.c.

◆ photon_setup_request_direct()

PHOTON_INTERNAL photonRequest photon_setup_request_direct ( photonBuffer  lbuf,
photonBuffer  rbuf,
uint64_t  size,
int  proc,
int  events 
)

Definition at line 209 of file photon_request.c.

◆ photon_setup_request_ledger_eager()

PHOTON_INTERNAL photonRequest photon_setup_request_ledger_eager ( photonRDMALedgerEntry  l_entry,
int  curr,
int  proc 
)

Definition at line 297 of file photon_request.c.

◆ photon_setup_request_ledger_info()

PHOTON_INTERNAL photonRequest photon_setup_request_ledger_info ( photonRILedgerEntry  ri_entry,
int  curr,
int  proc 
)

Definition at line 257 of file photon_request.c.

◆ photon_setup_request_recv()

PHOTON_INTERNAL photonRequest photon_setup_request_recv ( photonAddr  addr,
int  msn,
int  msize,
int  bindex,
int  nbufs 
)

Definition at line 332 of file photon_request.c.

◆ photon_setup_request_send()

PHOTON_INTERNAL photonRequest photon_setup_request_send ( photonAddr  addr,
int *  bufs,
int  nbufs 
)

Definition at line 358 of file photon_request.c.