lpfc_bg_setup_bpl(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« lpfc_bg_setup_bpl πŸ’«

okay bestie, so this is a page from the Kernel API Manual, section 9 β€” like, kernel-internals-land, not your casual "how do I untar a file" territory. we're doing driver guts today and honestly? kinda iconic of you.


πŸŽ€ NAME πŸŽ€

lpfc_bg_setup_bpl β€” sets up a BlockGuard BPL when there's no protection data involved. yes, BlockGuard, not a Nintendo thing. slay.


✨ SYNOPSIS ✨

int lpfc_bg_setup_bpl (struct lpfc_hba *phba , struct scsi_cmnd *sc ,
       struct ulp_bde64 *bpl , int datasegcnt );

like, four args, one int back, no drama πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • phba β€” the HBA you're doing this call for. it's literally the host bus adapter, bestie, the whole point of the operation.
  • sc β€” a pointer to the SCSI command you're currently working on. your main character.
  • bpl β€” a pointer to the buffer list holding the protection groups. this is the thing getting set up, keep your eyes on it πŸ‘€
  • datasegcnt β€” how many segments of data have already been DMA-mapped. count 'em, don't guess.

πŸ’– DESCRIPTION πŸ’–

so this function sets up the BPL β€” that's the buffer list β€” for protection groups of type LPFC_PG_TYPE_NO_DIF. no cap, that's the only type we're doing here.

usually this gets used when the HBA is told to generate DIFs and insert them into the data stream, or to strip DIF out of the incoming data stream. two vibes, one function 🫢

and here's the tea: the buffer list is literally just one protection group. one. that's it. it looks like this:

start of prot group  -->     |          PDE_5          |

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚     PDE_6                     β”‚
β”‚     Data BDE                  β”‚
β”‚     more Data BDE's ... (opt) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

see? PDE_5 up top, then PDE_6 plus a Data BDE plus optionally more Data BDE's. the "(opt)" is doing a lot of work there, respect.


⭐ NOTE ⭐

Data s/g buffers have been dma mapped β€” that's a given, not a request. don't come at this function with unmapped scatter/gather buffers, fr fr. 😭

and it returns the number of BDEs added to the BPL. that's your receipt. 🧾


🌈 SEE ALSO 🌈

first up, the kernel file itself:

  • ./drivers/scsi/lpfc/lpfc_scsi.c

then the whole extended friend group, alphabetically-ish, all of them, no skipping, we don't do that here:

like, that's the whole group chat. every single one. πŸ’œ


that's the whole page, bestie πŸ“ this came out of ./drivers/scsi/lpfc, dated October 2026, and it's lpfc_bg_setup_bpl(9) β€” go forth and set up some BPLs, you've got this πŸ‘‘βœ¨

πŸ“¦ where this page comes from