net/tls: pass context to tls_device_decrypted()
Avoid unnecessary pointer chasing and calculations, callers already have most of the state tls_device_decrypted() needs. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
34ef1ed198
commit
4de30a8d58
@@ -846,11 +846,10 @@ free_buf:
|
||||
return err;
|
||||
}
|
||||
|
||||
int tls_device_decrypted(struct sock *sk, struct sk_buff *skb)
|
||||
int tls_device_decrypted(struct sock *sk, struct tls_context *tls_ctx,
|
||||
struct sk_buff *skb, struct strp_msg *rxm)
|
||||
{
|
||||
struct tls_context *tls_ctx = tls_get_ctx(sk);
|
||||
struct tls_offload_context_rx *ctx = tls_offload_ctx_rx(tls_ctx);
|
||||
struct strp_msg *rxm = strp_msg(skb);
|
||||
int is_decrypted = skb->decrypted;
|
||||
int is_encrypted = !is_decrypted;
|
||||
struct sk_buff *skb_iter;
|
||||
|
@@ -1495,7 +1495,7 @@ static int decrypt_skb_update(struct sock *sk, struct sk_buff *skb,
|
||||
|
||||
if (!ctx->decrypted) {
|
||||
if (tls_ctx->rx_conf == TLS_HW) {
|
||||
err = tls_device_decrypted(sk, skb);
|
||||
err = tls_device_decrypted(sk, tls_ctx, skb, rxm);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user