|
1 | 1 | #include "../../vinyl/fd_vinyl.h" |
2 | 2 | #include "../../disco/topo/fd_topo.h" |
| 3 | +#include "../../flamenco/accdb/fd_vinyl_req_pool.h" |
3 | 4 | #include "../../util/pod/fd_pod_format.h" |
4 | 5 |
|
5 | 6 | #define VAL(name) (__extension__({ \ |
@@ -111,3 +112,87 @@ fd_topo_obj_callbacks_t fd_obj_cb_vinyl_data = { |
111 | 112 | .align = vinyl_data_align, |
112 | 113 | .new = vinyl_data_new, |
113 | 114 | }; |
| 115 | + |
| 116 | +/* vinyl_req_pool: request allocator */ |
| 117 | + |
| 118 | +static ulong |
| 119 | +vinyl_req_pool_align( fd_topo_t const * topo, |
| 120 | + fd_topo_obj_t const * obj ) { |
| 121 | + (void)topo; (void)obj; |
| 122 | + return fd_vinyl_req_pool_align(); |
| 123 | +} |
| 124 | + |
| 125 | +static ulong |
| 126 | +vinyl_req_pool_footprint( fd_topo_t const * topo, |
| 127 | + fd_topo_obj_t const * obj ) { |
| 128 | + return fd_vinyl_req_pool_footprint( VAL("batch_max"), VAL("batch_key_max") ); |
| 129 | +} |
| 130 | + |
| 131 | +static void |
| 132 | +vinyl_req_pool_new( fd_topo_t const * topo, |
| 133 | + fd_topo_obj_t const * obj ) { |
| 134 | + FD_TEST( fd_vinyl_req_pool_new( fd_topo_obj_laddr( topo, obj->id ), VAL("batch_max"), VAL("batch_key_max") ) ); |
| 135 | +} |
| 136 | + |
| 137 | +fd_topo_obj_callbacks_t fd_obj_cb_vinyl_req_pool = { |
| 138 | + .name = "vinyl_req_pool", |
| 139 | + .footprint = vinyl_req_pool_footprint, |
| 140 | + .align = vinyl_req_pool_align, |
| 141 | + .new = vinyl_req_pool_new, |
| 142 | +}; |
| 143 | + |
| 144 | +/* vinyl_rq: request queue */ |
| 145 | + |
| 146 | +static ulong |
| 147 | +vinyl_rq_align( fd_topo_t const * topo, |
| 148 | + fd_topo_obj_t const * obj ) { |
| 149 | + (void)topo; (void)obj; |
| 150 | + return fd_vinyl_rq_align(); |
| 151 | +} |
| 152 | + |
| 153 | +static ulong |
| 154 | +vinyl_rq_footprint( fd_topo_t const * topo, |
| 155 | + fd_topo_obj_t const * obj ) { |
| 156 | + return fd_vinyl_rq_footprint( VAL("req_cnt") ); |
| 157 | +} |
| 158 | + |
| 159 | +static void |
| 160 | +vinyl_rq_new( fd_topo_t const * topo, |
| 161 | + fd_topo_obj_t const * obj ) { |
| 162 | + FD_TEST( fd_vinyl_rq_new( fd_topo_obj_laddr( topo, obj->id ), VAL("req_cnt") ) ); |
| 163 | +} |
| 164 | + |
| 165 | +fd_topo_obj_callbacks_t fd_obj_cb_vinyl_rq = { |
| 166 | + .name = "vinyl_rq", |
| 167 | + .footprint = vinyl_rq_footprint, |
| 168 | + .align = vinyl_rq_align, |
| 169 | + .new = vinyl_rq_new, |
| 170 | +}; |
| 171 | + |
| 172 | +/* vinyl_cq: completion queue */ |
| 173 | + |
| 174 | +static ulong |
| 175 | +vinyl_cq_align( fd_topo_t const * topo, |
| 176 | + fd_topo_obj_t const * obj ) { |
| 177 | + (void)topo; (void)obj; |
| 178 | + return fd_vinyl_cq_align(); |
| 179 | +} |
| 180 | + |
| 181 | +static ulong |
| 182 | +vinyl_cq_footprint( fd_topo_t const * topo, |
| 183 | + fd_topo_obj_t const * obj ) { |
| 184 | + return fd_vinyl_cq_footprint( VAL("comp_cnt") ); |
| 185 | +} |
| 186 | + |
| 187 | +static void |
| 188 | +vinyl_cq_new( fd_topo_t const * topo, |
| 189 | + fd_topo_obj_t const * obj ) { |
| 190 | + FD_TEST( fd_vinyl_cq_new( fd_topo_obj_laddr( topo, obj->id ), VAL("comp_cnt") ) ); |
| 191 | +} |
| 192 | + |
| 193 | +fd_topo_obj_callbacks_t fd_obj_cb_vinyl_cq = { |
| 194 | + .name = "vinyl_cq", |
| 195 | + .footprint = vinyl_cq_footprint, |
| 196 | + .align = vinyl_cq_align, |
| 197 | + .new = vinyl_cq_new, |
| 198 | +}; |
0 commit comments