lpfc_bg_scsi...p_dma_buf_s4(9)
π lpfc_bg_scsi_prep_dma_buf_s4 β the kernel API manual, bestie edition π
okay so this is a page from the Kernel API Manual and it's all about lpfc_bg_scsi_prep_dma_buf_s4(9). yes the name is a mouthful, no we're not shortening it, it's iconic in its own chaotic way π
β¨ NAME β¨
lpfc_bg_scsi_prep_dma_buf_s4 β DMA mapping for scsi buffer to SLI4 IF spec π¦
like, that's the whole vibe: you got a scsi buffer, you got SLI4, and this function is the matchmaker doing the DMA mapping between them π
β¨ SYNOPSIS β¨
int lpfc_bg_scsi_prep_dma_buf_s4 (struct lpfc_hba *phba , struct lpfc_io_buf *lpfc_cmd );
that's it, that's the whole call. two args, one int back. clean. minimal. main character energy π
β¨ ARGUMENTS β¨
phbaβ the Hba for which this call is being executed. like, the actual host bus adapter that's about to be out here doin stuff π«Άlpfc_cmdβ the scsi buffer which is going to be mapped. this one's the little guy getting yeeted into the mapping process πΈ
β¨ DESCRIPTION β¨
okay so real talk: this is the protection/DIF aware version of lpfc_scsi_prep_dma_buf. yes, the DIF-aware one. she knows about protection info. she's built different β¨
the page literally says it may be a good idea to combine the two functions eventually β but for now, it's here. so like, future refactor tea, but not today bestie π
and now the part you cannot skip, the return codes, no cap:
- 2 β Error β Do not retry π
- 1 β Error β Retry π
- 0 β Success π
get those right, iykyk. the difference between 2 and 1 is literally "give up" vs "run it back", do not mix them up fr fr π
β¨ SEE ALSO β¨
buckle up, this list is long and she ate π the kernel file itself first:
- Kernel file
./drivers/scsi/lpfc/lpfc_scsi.c
and then the whole friend group:
lpfc_sli4_set_rsp_sgl_last(9)lpfc_rampdown_queue_depth(9)lpfc_ramp_down_queue_handler(9)lpfc_scsi_dev_block(9)lpfc_new_scsi_buf_s3(9)lpfc_sli4_vport_delete_fcp_xri_aborted(9)lpfc_sli4_io_xri_aborted(9)lpfc_get_scsi_buf_s3(9)lpfc_get_scsi_buf_s4(9)lpfc_get_scsi_buf(9)lpfc_release_scsi_buf_s3(9)lpfc_release_scsi_buf_s4(9)lpfc_release_scsi_buf(9)lpfc_fcpcmd_to_iocb(9)lpfc_scsi_prep_dma_buf_s3(9)lpfc_bg_err_inject(9)lpfc_sc_to_bg_opcodes(9)lpfc_bg_err_opcodes(9)lpfc_bg_setup_bpl(9)lpfc_bg_setup_bpl_prot(9)lpfc_bg_setup_sgl(9)lpfc_bg_setup_sgl_prot(9)lpfc_prot_group_type(9)lpfc_bg_scsi_adjust_dl(9)lpfc_bg_scsi_prep_dma_buf_s3(9)lpfc_scsi_prep_dma_buf_s4(9)lpfc_scsi_prep_dma_buf(9)lpfc_bg_scsi_prep_dma_buf(9)lpfc_scsi_prep_cmnd_buf(9)lpfc_send_scsi_error_event(9)lpfc_scsi_unprep_dma_buf(9)lpfc_unblock_requests(9)lpfc_block_requests(9)lpfc_update_cmf_cmpl(9)lpfc_update_cmf_cmd(9)lpfc_handle_fcp_err(9)lpfc_fcp_io_cmd_wqe_cmpl(9)lpfc_scsi_cmd_iocb_cmpl(9)lpfc_scsi_prep_cmnd_buf_s3(9)lpfc_scsi_prep_cmnd_buf_s4(9)lpfc_scsi_prep_cmnd(9)lpfc_scsi_prep_task_mgmt_cmd_s3(9)lpfc_scsi_prep_task_mgmt_cmd_s4(9)lpfc_scsi_api_table_setup(9)lpfc_tskmgmt_def_cmpl(9)lpfc_check_pci_resettable(9)lpfc_info(9)lpfc_poll_rearm_timer(9)lpfc_poll_start_timer(9)lpfc_poll_timeout(9)lpfc_queuecommand(9)lpfc_abort_handler(9)lpfc_check_fcp_rsp(9)lpfc_send_taskmgmt(9)lpfc_chk_tgt_mapped(9)lpfc_reset_flush_io_context(9)lpfc_device_reset_handler(9)lpfc_target_reset_handler(9)lpfc_host_reset_handler(9)lpfc_sdev_init(9)lpfc_sdev_configure(9)lpfc_sdev_destroy(9)lpfc_create_device_data(9)lpfc_delete_device_data(9)__lpfc_get_device_data(9)lpfc_find_next_oas_lun(9)lpfc_enable_oas_lun(9)lpfc_disable_oas_lun(9)
like i said. she ate. every single one is here, not a crumb left behind π
ngl bestie, if you're touching DIF/protection stuff in the lpfc scsi layer, read the return codes twice. 2 means do not retry, and the kernel does not care about your feelings π
and that's the page!! π source path ./drivers/scsi/lpfc, dated October 2026, and the page is literally just lpfc_bg_scsi...p_dma_buf_s4(9) β yes the title in the footer is abbreviated with dots, no that's not a typo, that's just how she's filed π bye bestie, go map some buffers slay π
π
π¦ 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