Commit b8b22533fed12dbb9e5a63d414cb1c768d1c28dd
Committed by
Nicholas Bellinger
1 parent
43381ce8bb
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
tcm_fc: Offload WRITE I/O backend submission to tpg workqueue
Defer the write processing to the internal to be able to use target_execute_cmd. I'm not even entirely sure the calling code requires this due to the convoluted structure in libfc, but let's be safe for now. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Mark Rustad <mark.d.rustad@intel.com> Cc: Kiran Patil <Kiran.patil@intel.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Showing 1 changed file with 11 additions and 2 deletions Side-by-side Diff
drivers/target/tcm_fc/tfc_io.c
... | ... | @@ -183,6 +183,13 @@ |
183 | 183 | return ft_queue_status(se_cmd); |
184 | 184 | } |
185 | 185 | |
186 | +static void ft_execute_work(struct work_struct *work) | |
187 | +{ | |
188 | + struct ft_cmd *cmd = container_of(work, struct ft_cmd, work); | |
189 | + | |
190 | + target_execute_cmd(&cmd->se_cmd); | |
191 | +} | |
192 | + | |
186 | 193 | /* |
187 | 194 | * Receive write data frame. |
188 | 195 | */ |
... | ... | @@ -307,8 +314,10 @@ |
307 | 314 | cmd->write_data_len += tlen; |
308 | 315 | } |
309 | 316 | last_frame: |
310 | - if (cmd->write_data_len == se_cmd->data_length) | |
311 | - transport_generic_handle_data(se_cmd); | |
317 | + if (cmd->write_data_len == se_cmd->data_length) { | |
318 | + INIT_WORK(&cmd->work, ft_execute_work); | |
319 | + queue_work(cmd->sess->tport->tpg->workqueue, &cmd->work); | |
320 | + } | |
312 | 321 | drop: |
313 | 322 | fc_frame_free(fp); |
314 | 323 | } |