STRUCT SEC_REQUEST(9)
β¨ NAME β¨
Okay so struct sec_request(9) is from the Kernel API Manual, and it's literally struct sec_request - data associate with a single crypto request. That's the whole vibe bestie, no cap. π
π SYNOPSIS π
Here's the struct in all its glory β every field, fr fr:
struct sec_request {
struct list_head elements;
int num_elements;
struct mutex lock;
struct sec_alg_tfm_ctx *tfm_ctx;
int len_in;
int len_out;
dma_addr_t dma_iv;
int err;
struct crypto_async_request *req_base;
void (*cb)(struct sec_bd_info *resp, struct crypto_async_request
*req);
struct list_head backlog_head;
};
π MEMBERS π
elementsβ List of subparts of this request (hardware size restriction). It's giving "we had to chop it up."num_elementsβ The number of subparts (used as an optimization). Lowkey handy.lockβ Protect elements of this structure against concurrent change. Do not skip this one, bestie.tfm_ctxβ hardware specific context. Iconic little context holder.len_inβ length of in sgl from upper layers. Length check, periodt.len_outβ length of out sgl from upper layers. Outgoing sgl tea.dma_ivβ initialization vector - phsyical address. Yes, that spelling is exactly what the page says β keep it moving.errβ store used to track errors across subelements of this request. Error tracking main character energy.req_baseβ pointer to base element of associate crypto context. This is needed to allow shared handling skcipher, ahash etc. Shared handling slay.cbβ completion callback. Callback cutie.backlog_headβ list head to allow backlog maintenance. Backlog maintenance vibes.
π¦ DESCRIPTION π¦
The hardware is limited in the maximum size of data that it can process from a single BD. Typically this is fairly large (32MB) but still requires the complexity of splitting the incoming skreq up into a number of elements complete with appropriate iv chaining.
TL;DR bestie: big-ish limit, but the split-into-elements + iv chaining drama is very real. πΈ
π₯ SEE ALSO π₯
Kernel file ./drivers/crypto/hisilicon/sec/sec_drv.h β go read it, and also check out these icons:
struct sec_queue_ring_cmd(9)struct sec_alg_tfm_ctx(9)struct sec_request_el(9)struct sec_queue(9)struct sec_hw_sge(9)struct sec_hw_sgl(9)struct sec_dev_info(9)
mwah π β this page is from ./drivers/crypto/hisilicon/sec, dated October 2026. π«Ά Obsessed with this kernel crypto lore, ngl.
π¦ 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