target_submit_cmd(9)
π target_submit_cmd β NAME π
okay so bestie, welcome to the Kernel API Manual β¨ this one is all about target_submit_cmd β it looks up an unpacked LUN and submits an uninitialized se_cmd. that's the whole vibe π
π¦ SYNOPSIS π¦
void target_submit_cmd (struct se_cmd *se_cmd , struct se_session *se_sess , unsigned char *cdb , unsigned char *sense , u64 unpacked_lun , u32 data_length , int task_attr , int data_dir , int flags );
like, yes, that is a lot of arguments. she's an icon, she's high-maintenance, we love her π
πΈ ARGUMENTS πΈ
se_cmdβ the command descriptor you're submitting. the main character of this whole situation πse_sessβ the associatedse_sessfor the endpoint. her plus-one π«Άcdbβ pointer to the SCSI CDBsenseβ pointer to the SCSI sense bufferunpacked_lunβ the unpacked LUN to reference forstruct se_lundata_lengthβ the fabric's expected data transfer lengthtask_attrβ the SAM task attributedata_dirβ the DMA data directionflagsβ flags for command submission, straight fromtarget_sc_flags_tables
ngl that's a full roster but every single one is doing her job okay π
β¨ DESCRIPTION β¨
Task tags are supported β but only if the caller has set se_cmd->tag. no tag, no tag support, that's the rule π
This may only be called from process context, and it also currently assumes internal allocation of the fabric payload buffer by target-core. so like, don't come at her from interrupt context, she's not built for that energy π
It also assumes internal target core SGL memory allocation.
β οΈ okay this next part is important, so listen up bestie: this function must only be used by drivers that do their own sync during shutdown and that do not usetarget_stop_session. and if there's a failure? this function will call into the fabric driver'squeue_statuswith aCHECK_CONDITION. literally it will snitch toqueue_status, that's the whole move π
π SEE ALSO π
Kernel file ./drivers/target/target_core_transport.c
transport_init_session(9)transport_alloc_session(9)transport_alloc_session_tags(9)transport_init_session_tags(9)target_cmd_size_check(9)target_init_cmd(9)target_submit_prep(9)target_queue_submission(9)target_submit(9)target_submit_tmr(9)target_get_sess_cmd(9)target_put_sess_cmd(9)target_stop_cmd_counter(9)target_stop_session(9)target_wait_for_cmds(9)target_wait_for_sess_cmds(9)transport_wait_for_tasks(9)translate_sense_reason(9)target_send_busy(9)
like a whole friend group fr fr π
β¨ and that's the page! β¨ this one lives in ./drivers/target, dated October 2026, and honestly? she ate. go read the kernel source bestie, ily, bye ππ¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms