net: generalize sk_alloc_sg to work with scatterlist rings
The current implementation of sk_alloc_sg expects scatterlist to always start at entry 0 and complete at entry MAX_SKB_FRAGS. Future patches will want to support starting at arbitrary offset into scatterlist so add an additional sg_start parameters and then default to the current values in TLS code paths. Signed-off-by: John Fastabend <john.fastabend@gmail.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:

committed by
Daniel Borkmann

szülő
312fc2b4c8
commit
8c05dbf04b
@@ -94,7 +94,7 @@ static int alloc_encrypted_sg(struct sock *sk, int len)
|
||||
int rc = 0;
|
||||
|
||||
rc = sk_alloc_sg(sk, len,
|
||||
ctx->sg_encrypted_data,
|
||||
ctx->sg_encrypted_data, 0,
|
||||
&ctx->sg_encrypted_num_elem,
|
||||
&ctx->sg_encrypted_size, 0);
|
||||
|
||||
@@ -107,7 +107,7 @@ static int alloc_plaintext_sg(struct sock *sk, int len)
|
||||
struct tls_sw_context *ctx = tls_sw_ctx(tls_ctx);
|
||||
int rc = 0;
|
||||
|
||||
rc = sk_alloc_sg(sk, len, ctx->sg_plaintext_data,
|
||||
rc = sk_alloc_sg(sk, len, ctx->sg_plaintext_data, 0,
|
||||
&ctx->sg_plaintext_num_elem, &ctx->sg_plaintext_size,
|
||||
tls_ctx->pending_open_record_frags);
|
||||
|
||||
|
Reference in New Issue
Block a user