OpenMPI  0.1.1
btl_sctp_frag.h
1 /*
2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2009 The University of Tennessee and The University
6  * of Tennessee Research Foundation. All rights
7  * reserved.
8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9  * University of Stuttgart. All rights reserved.
10  * Copyright (c) 2004-2005 The Regents of the University of California.
11  * All rights reserved.
12  * $COPYRIGHT$
13  *
14  * Additional copyrights may follow
15  *
16  * $HEADER$
17  */
18 
19 #ifndef MCA_BTL_SCTP_FRAG_H
20 #define MCA_BTL_SCTP_FRAG_H
21 
22 
23 #define MCA_BTL_SCTP_FRAG_ALIGN (8)
24 #include "ompi_config.h"
25 
26 #ifdef HAVE_SYS_TYPES_H
27 #include <sys/types.h>
28 #endif
29 #ifdef HAVE_SYS_UIO_H
30 #include <sys/uio.h>
31 #endif
32 
33 #include "btl_sctp.h"
34 #include "btl_sctp_hdr.h"
35 
36 BEGIN_C_DECLS
37 
38 #define MCA_BTL_SCTP_FRAG_IOVEC_NUMBER 4
39 
40 /**
41  * SCTP fragment derived type.
42  */
45  mca_btl_base_segment_t segments[2];
46  struct mca_btl_base_endpoint_t *endpoint;
47  struct mca_btl_sctp_module_t* btl;
49  struct iovec iov[MCA_BTL_SCTP_FRAG_IOVEC_NUMBER + 1];
50  struct iovec *iov_ptr;
51  size_t iov_cnt;
52  size_t iov_idx;
53  size_t size;
54  int rc;
55  ompi_free_list_t* my_list;
56 };
59 
61 
63 
65 
67 
69 
71 
72 
73 /*
74  * Macros to allocate/return descriptors from module specific
75  * free list(s).
76  */
77 
78 #define MCA_BTL_SCTP_FRAG_ALLOC_EAGER(frag, rc) \
79 { \
80  \
81  ompi_free_list_item_t *item; \
82  OMPI_FREE_LIST_GET(&mca_btl_sctp_component.sctp_frag_eager, item, rc); \
83  frag = (mca_btl_sctp_frag_t*) item; \
84 }
85 
86 #define MCA_BTL_SCTP_FRAG_ALLOC_MAX(frag, rc) \
87 { \
88  \
89  ompi_free_list_item_t *item; \
90  OMPI_FREE_LIST_GET(&mca_btl_sctp_component.sctp_frag_max, item, rc); \
91  frag = (mca_btl_sctp_frag_t*) item; \
92 }
93 
94 #define MCA_BTL_SCTP_FRAG_ALLOC_USER(frag, rc) \
95 { \
96  ompi_free_list_item_t *item; \
97  OMPI_FREE_LIST_GET(&mca_btl_sctp_component.sctp_frag_user, item, rc); \
98  frag = (mca_btl_sctp_frag_t*) item; \
99 }
100 
101 #define MCA_BTL_SCTP_FRAG_RETURN(frag) \
102 { \
103  OMPI_FREE_LIST_RETURN(frag->my_list, (ompi_free_list_item_t*)(frag)); \
104 }
105 
106 #define MCA_BTL_SCTP_FRAG_INIT_DST(frag,ep) \
107 do { \
108  frag->rc = 0; \
109  frag->btl = ep->endpoint_btl; \
110  frag->endpoint = ep; \
111  frag->iov[0].iov_len = sizeof(frag->hdr); \
112  frag->iov[0].iov_base = (IOVBASE_TYPE*)&frag->hdr; \
113  frag->iov_cnt = 1; \
114  frag->iov_idx = 0; \
115  frag->iov_ptr = frag->iov; \
116  frag->base.des_src = NULL; \
117  frag->base.des_dst_cnt = 0; \
118  frag->base.des_dst = frag->segments; \
119  frag->base.des_dst_cnt = 1; \
120 } while(0)
121 
122 
123 #define MCA_BTL_SCTP_MAX_FRAG_SIZE 65536
124 bool mca_btl_sctp_frag_large_send(mca_btl_sctp_frag_t*, int sd, int iov_fragment, int *amt_sent);
125 int mca_btl_sctp_frag_get_msg_size(mca_btl_sctp_frag_t *frag);
126 int mca_btl_sctp_frag_get_msg_tag(mca_btl_sctp_frag_t *frag);
127 
128 bool mca_btl_sctp_frag_send(mca_btl_sctp_frag_t*, int sd);
129 bool mca_btl_sctp_frag_recv(mca_btl_sctp_frag_t*, int sd, char *buf, int len);
130 
131 
132 END_C_DECLS
133 #endif
A descriptor that holds the parameters to a send/put/get operation along w/ a callback routine that i...
Definition: btl.h:275
SCTP fragment derived type.
Definition: btl_sctp_frag.h:43
Definition: btl_sctp_hdr.h:39
Definition: ompi_free_list.h:39
Definition: ompi_uio.h:29
State of ELAN endpoint connection.
Definition: btl_elan_endpoint.h:33
BTL Module Interface.
Definition: btl_sctp.h:103
Describes a region/segment of memory that is addressable by an BTL.
Definition: btl.h:236
#define OBJ_CLASS_DECLARATION(NAME)
Declaration for class descriptor.
Definition: opal_object.h:236