Lines Matching refs:tls_ctx

162 	struct tls_context *tls_ctx = tls_get_ctx(sk);  in tls_icsk_clean_acked()  local
168 if (!tls_ctx) in tls_icsk_clean_acked()
171 ctx = tls_offload_ctx_tx(tls_ctx); in tls_icsk_clean_acked()
197 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_sk_destruct() local
198 struct tls_offload_context_tx *ctx = tls_offload_ctx_tx(tls_ctx); in tls_device_sk_destruct()
200 tls_ctx->sk_destruct(sk); in tls_device_sk_destruct()
202 if (tls_ctx->tx_conf == TLS_HW) { in tls_device_sk_destruct()
210 tls_device_queue_ctx_destruction(tls_ctx); in tls_device_sk_destruct()
216 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_free_resources_tx() local
218 tls_free_partial_record(sk, tls_ctx); in tls_device_free_resources_tx()
223 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_offload_tx_resync_request() local
226 WARN_ON(test_and_set_bit(TLS_TX_SYNC_SCHED, &tls_ctx->flags)); in tls_offload_tx_resync_request()
230 static void tls_device_resync_tx(struct sock *sk, struct tls_context *tls_ctx, in tls_device_resync_tx() argument
242 rcd_sn = tls_ctx->tx.rec_seq; in tls_device_resync_tx()
246 netdev = rcu_dereference_protected(tls_ctx->netdev, in tls_device_resync_tx()
256 clear_bit_unlock(TLS_TX_SYNC_SCHED, &tls_ctx->flags); in tls_device_resync_tx()
438 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_push_data() local
439 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_push_data()
440 struct tls_offload_context_tx *ctx = tls_offload_ctx_tx(tls_ctx); in tls_push_data()
462 if (tls_is_partially_sent_record(tls_ctx)) { in tls_push_data()
463 rc = tls_push_partial_record(sk, tls_ctx, flags); in tls_push_data()
536 rc = tls_device_record_close(sk, tls_ctx, record, in tls_push_data()
550 tls_ctx, in tls_push_data()
559 tls_ctx->pending_open_record_frags = more; in tls_push_data()
570 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_sendmsg() local
574 mutex_lock(&tls_ctx->tx_lock); in tls_device_sendmsg()
588 mutex_unlock(&tls_ctx->tx_lock); in tls_device_sendmsg()
595 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_sendpage() local
605 mutex_lock(&tls_ctx->tx_lock); in tls_device_sendpage()
613 if (tls_ctx->zerocopy_sendfile) { in tls_device_sendpage()
631 mutex_unlock(&tls_ctx->tx_lock); in tls_device_sendpage()
720 static void tls_device_resync_rx(struct tls_context *tls_ctx, in tls_device_resync_rx() argument
723 struct tls_offload_context_rx *rx_ctx = tls_offload_ctx_rx(tls_ctx); in tls_device_resync_rx()
728 netdev = rcu_dereference(tls_ctx->netdev); in tls_device_resync_rx()
794 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_rx_resync_new_rec() local
803 if (tls_ctx->rx_conf != TLS_HW) in tls_device_rx_resync_new_rec()
805 if (unlikely(test_bit(TLS_RX_DEV_DEGRADED, &tls_ctx->flags))) in tls_device_rx_resync_new_rec()
808 prot = &tls_ctx->prot_info; in tls_device_rx_resync_new_rec()
809 rx_ctx = tls_offload_ctx_rx(tls_ctx); in tls_device_rx_resync_new_rec()
810 memcpy(rcd_sn, tls_ctx->rx.rec_seq, prot->rec_seq_size); in tls_device_rx_resync_new_rec()
854 tls_device_resync_rx(tls_ctx, sk, seq, rcd_sn); in tls_device_rx_resync_new_rec()
857 static void tls_device_core_ctrl_rx_resync(struct tls_context *tls_ctx, in tls_device_core_ctrl_rx_resync() argument
893 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_device_core_ctrl_rx_resync()
896 memcpy(rcd_sn, tls_ctx->rx.rec_seq, prot->rec_seq_size); in tls_device_core_ctrl_rx_resync()
899 tls_device_resync_rx(tls_ctx, sk, tcp_sk(sk)->copied_seq, in tls_device_core_ctrl_rx_resync()
905 tls_device_reencrypt(struct sock *sk, struct tls_context *tls_ctx) in tls_device_reencrypt() argument
907 struct tls_sw_context_rx *sw_ctx = tls_sw_ctx_rx(tls_ctx); in tls_device_reencrypt()
915 switch (tls_ctx->crypto_recv.info.cipher_type) { in tls_device_reencrypt()
922 cipher_sz = &tls_cipher_size_desc[tls_ctx->crypto_recv.info.cipher_type]; in tls_device_reencrypt()
1002 int tls_device_decrypted(struct sock *sk, struct tls_context *tls_ctx) in tls_device_decrypted() argument
1004 struct tls_offload_context_rx *ctx = tls_offload_ctx_rx(tls_ctx); in tls_device_decrypted()
1005 struct tls_sw_context_rx *sw_ctx = tls_sw_ctx_rx(tls_ctx); in tls_device_decrypted()
1025 tls_ctx->rx.rec_seq, rxm->full_len, in tls_device_decrypted()
1028 if (unlikely(test_bit(TLS_RX_DEV_DEGRADED, &tls_ctx->flags))) { in tls_device_decrypted()
1036 return tls_device_reencrypt(sk, tls_ctx); in tls_device_decrypted()
1048 tls_device_core_ctrl_rx_resync(tls_ctx, ctx, sk, skb); in tls_device_decrypted()
1053 return tls_device_reencrypt(sk, tls_ctx); in tls_device_decrypted()
1074 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_set_device_offload() local
1075 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_set_device_offload()
1329 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_offload_cleanup_rx() local
1333 netdev = rcu_dereference_protected(tls_ctx->netdev, in tls_device_offload_cleanup_rx()
1338 netdev->tlsdev_ops->tls_dev_del(netdev, tls_ctx, in tls_device_offload_cleanup_rx()
1341 if (tls_ctx->tx_conf != TLS_HW) { in tls_device_offload_cleanup_rx()
1343 rcu_assign_pointer(tls_ctx->netdev, NULL); in tls_device_offload_cleanup_rx()
1345 set_bit(TLS_RX_DEV_CLOSED, &tls_ctx->flags); in tls_device_offload_cleanup_rx()