There are needed multiple setsockopt(2) calls for passing key material to kernel. It would be nice to consider to introduce one setsockopt(2) call, which would pass needed key material at once to reduce number of context switches.
E.g.:
struct ktls_conf cnf;
// session_* is obtained material from GnuTLS/OpenSSL
cnf.salt_send = session_salt_send;
cnf.salt_recv = session_salt_recv;
cnf.key_send = session_key_send;
cnf.key_recv = session_key_recv;
cnf.iv_send = session_iv_send;
cnf.iv_recv = session_iv_recv;
setsockopt(ksd, AF_KTLS, KTLS_SET_CONF, &cnf, sizeof(cnf));
EDIT: ... and skip NULL fields in struct ktls_conf in kernel.
There are needed multiple
setsockopt(2)calls for passing key material to kernel. It would be nice to consider to introduce onesetsockopt(2)call, which would pass needed key material at once to reduce number of context switches.E.g.:
EDIT: ... and skip NULL fields in
struct ktls_confin kernel.