lpfc_bg_setup_sgl_prot(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– lpfc_bg_setup_sgl_prot(9) πŸ’–

okay so real talk, this one lives in the Kernel API Manual and it's giving "deep in the SCSI layer, but make it fashion." stay with me bestie, it's actually so good once you see it.


✨ NAME ✨

lpfc_bg_setup_sgl_prot β€” sets up the BlockGuard SGL with protection data. like, it's assembling the scatter/gather list and it's bringing the protection data along too. slay.


🌸 SYNOPSIS 🌸

uint32_t lpfc_bg_setup_sgl_prot (struct lpfc_hba *phba , struct
       scsi_cmnd *sc , struct sli4_sge *sgl , int datacnt , int protcnt ,
       struct lpfc_io_buf *lpfc_cmd );

πŸŽ€ ARGUMENTS πŸŽ€

  • phba β€” the Hba that this call is being executed for. yes, that one. πŸ’…
  • sc β€” pointer to the scsi command we're working on. the main character of this operation, fr.
  • sgl β€” pointer to the buffer list for the protection groups.
  • datacnt β€” the number of segments of data that have been dma mapped.
  • protcnt β€” the number of segments of protection data that have been dma mapped. (yes, it's spelled "segment" singular in the original, and honestly? iconic.)
  • lpfc_cmd β€” the lpfc scsi command object pointer.

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function sets up the SGL buffer list for protection groups of type LPFC_PG_TYPE_DIF. that's the whole vibe.

it's usually used when DIFs are in their own buffers, separate from the data. then the HBA can be instructed to place the DIFs in the outgoing stream. and for read operations? The HBA could extract the DIFs and place them in DIF buffers. lowkey multitasking queen behavior. πŸ‘‘

the buffer list for this type consists of one or more of the protection groups described below:

       start of first prot group  -->   |         DISEED          |

       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚     DIF (Prot SGE)            β”‚
       β”‚     Data SGE                  β”‚
       β”‚     more Data SGE's ... (opt) β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

       start of new  prot group  -->    |         DISEED          |

       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β”‚     ... β”‚
       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

like, one DIF then one data SGE then optionally more data SGEs, rinse and repeat. it's giving pattern. it's giving structure. we love a consistent layout. 🌈


⭐ NOTE ⭐

ngl this part matters: it is assumed that both data and protection s/g buffers have been mapped for DMA. don't come at this function with unmapped buffers, bestie, it's not that kind of party. πŸ™ˆ

Returns the number of SGEs added to the SGL. that's your little receipt. πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

like yes that's a lot of friends, but that's the friend group, okay? every single one of them. no cap. 🫢


okay that's the whole thing!! it comes from ./drivers/scsi/lpfc and it's dated October 2026 β€” mark your calendars bestie, and that's the whole lpfc_bg_setup_sgl_prot(9) situation. mwah. πŸ’‹πŸŽ€βœ¨

πŸ“¦ where this page comes from