@@ -41,6 +41,9 @@ enum ocf_io_if_type {
4141 OCF_IO_FAST_IF ,
4242 OCF_IO_FLUSH_IF ,
4343 OCF_IO_DISCARD_IF ,
44+ OCF_IO_REFRESH_IF ,
45+ OCF_IO_INVALIDATE_IF ,
46+ OCF_IO_RD_IF ,
4447 OCF_IO_PRIV_MAX_IF ,
4548};
4649
@@ -108,6 +111,18 @@ static const struct ocf_io_if IO_IFS[OCF_IO_PRIV_MAX_IF] = {
108111 },
109112 .name = "Discard" ,
110113 },
114+ [OCF_IO_REFRESH_IF ] = {
115+ .cbs = { },
116+ .name = "Refresh" ,
117+ },
118+ [OCF_IO_INVALIDATE_IF ] = {
119+ .cbs = { },
120+ .name = "Invalidate" ,
121+ },
122+ [OCF_IO_RD_IF ] = {
123+ .cbs = { },
124+ .name = "Read generic" ,
125+ },
111126};
112127
113128static const struct ocf_io_if * cache_mode_io_if_map [ocf_req_cache_mode_max ] = {
@@ -118,8 +133,29 @@ static const struct ocf_io_if *cache_mode_io_if_map[ocf_req_cache_mode_max] = {
118133 [ocf_req_cache_mode_wo ] = & IO_IFS [OCF_IO_WO_IF ],
119134 [ocf_req_cache_mode_pt ] = & IO_IFS [OCF_IO_PT_IF ],
120135 [ocf_req_cache_mode_fast ] = & IO_IFS [OCF_IO_FAST_IF ],
136+ [ocf_req_refresh ] = & IO_IFS [OCF_IO_REFRESH_IF ],
137+ [ocf_req_cache_mode_discard ] = & IO_IFS [OCF_IO_DISCARD_IF ],
138+ [ocf_req_cache_mode_invalidate ] = & IO_IFS [OCF_IO_INVALIDATE_IF ],
139+ [ocf_req_cache_mode_rd ] = & IO_IFS [OCF_IO_RD_IF ],
121140};
122141
142+ void ocf_debug_request_trace (struct ocf_request * req ,
143+ ocf_req_cache_mode_t engine , uint8_t origin )
144+ {
145+ ENV_WARN_ONCE (origin & ~0xf , "Invalid req origin origin\n" );
146+ ENV_WARN_ONCE (engine & ~0xe , "Invalid req engine\n" );
147+
148+ ENV_WARN_ONCE (req -> engine_trace & 0xff00000000000000 ,
149+ "Request trace too long\n" );
150+
151+ req -> engine_trace <<= 4 ;
152+ // +1 to make sure that WT has a different value than zero
153+ req -> engine_trace |= (engine + 1 );
154+
155+ req -> engine_trace <<= 4 ;
156+ req -> engine_trace |= origin ;
157+ }
158+
123159const char * ocf_get_io_iface_name (ocf_req_cache_mode_t cache_mode )
124160{
125161 if (cache_mode == ocf_req_cache_mode_max )
@@ -211,6 +247,7 @@ int ocf_engine_hndl_req(struct ocf_request *req)
211247 * to into OCF workers
212248 */
213249
250+ ocf_debug_request_trace (req , req -> cache_mode , 0xf );
214251 ocf_queue_push_req (req , OCF_QUEUE_ALLOW_SYNC );
215252
216253 return 0 ;
@@ -227,6 +264,7 @@ int ocf_engine_hndl_fast_req(struct ocf_request *req)
227264
228265 ocf_req_get (req );
229266
267+ ocf_debug_request_trace (req , req -> cache_mode , 0xe );
230268 ret = engine_cb (req );
231269
232270 if (ret == OCF_FAST_PATH_NO )
@@ -239,13 +277,15 @@ void ocf_engine_hndl_discard_req(struct ocf_request *req)
239277{
240278 ocf_req_get (req );
241279
280+ ocf_debug_request_trace (req , ocf_req_cache_mode_discard , 0 );
242281 IO_IFS [OCF_IO_DISCARD_IF ].cbs [req -> rw ](req );
243282}
244283
245284void ocf_engine_hndl_flush_req (struct ocf_request * req )
246285{
247286 ocf_req_get (req );
248287
288+ ocf_debug_request_trace (req , ocf_req_cache_mode_flush , 0 );
249289 req -> engine_handler = IO_IFS [OCF_IO_FLUSH_IF ].cbs [req -> rw ];
250290
251291 ocf_queue_push_req (req , OCF_QUEUE_ALLOW_SYNC );
0 commit comments