Lines Matching refs:tls_ctx
149 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_icsk_clean_acked() local
155 if (!tls_ctx) in tls_icsk_clean_acked()
158 ctx = tls_offload_ctx_tx(tls_ctx); in tls_icsk_clean_acked()
184 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_sk_destruct() local
185 struct tls_offload_context_tx *ctx = tls_offload_ctx_tx(tls_ctx); in tls_device_sk_destruct()
187 tls_ctx->sk_destruct(sk); in tls_device_sk_destruct()
189 if (tls_ctx->tx_conf == TLS_HW) { in tls_device_sk_destruct()
197 if (refcount_dec_and_test(&tls_ctx->refcount)) in tls_device_sk_destruct()
198 tls_device_queue_ctx_destruction(tls_ctx); in tls_device_sk_destruct()
204 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_free_resources_tx() local
206 tls_free_partial_record(sk, tls_ctx); in tls_device_free_resources_tx()
211 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_offload_tx_resync_request() local
214 WARN_ON(test_and_set_bit(TLS_TX_SYNC_SCHED, &tls_ctx->flags)); in tls_offload_tx_resync_request()
218 static void tls_device_resync_tx(struct sock *sk, struct tls_context *tls_ctx, in tls_device_resync_tx() argument
230 rcd_sn = tls_ctx->tx.rec_seq; in tls_device_resync_tx()
234 netdev = tls_ctx->netdev; in tls_device_resync_tx()
243 clear_bit_unlock(TLS_TX_SYNC_SCHED, &tls_ctx->flags); in tls_device_resync_tx()
419 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_push_data() local
420 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_push_data()
421 struct tls_offload_context_tx *ctx = tls_offload_ctx_tx(tls_ctx); in tls_push_data()
443 if (tls_is_partially_sent_record(tls_ctx)) { in tls_push_data()
444 rc = tls_push_partial_record(sk, tls_ctx, flags); in tls_push_data()
506 rc = tls_device_record_close(sk, tls_ctx, record, in tls_push_data()
520 tls_ctx, in tls_push_data()
529 tls_ctx->pending_open_record_frags = more; in tls_push_data()
540 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_sendmsg() local
543 mutex_lock(&tls_ctx->tx_lock); in tls_device_sendmsg()
557 mutex_unlock(&tls_ctx->tx_lock); in tls_device_sendmsg()
564 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_sendpage() local
573 mutex_lock(&tls_ctx->tx_lock); in tls_device_sendpage()
591 mutex_unlock(&tls_ctx->tx_lock); in tls_device_sendpage()
678 static void tls_device_resync_rx(struct tls_context *tls_ctx, in tls_device_resync_rx() argument
681 struct tls_offload_context_rx *rx_ctx = tls_offload_ctx_rx(tls_ctx); in tls_device_resync_rx()
686 netdev = READ_ONCE(tls_ctx->netdev); in tls_device_resync_rx()
752 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_rx_resync_new_rec() local
761 if (tls_ctx->rx_conf != TLS_HW) in tls_device_rx_resync_new_rec()
763 if (unlikely(test_bit(TLS_RX_DEV_DEGRADED, &tls_ctx->flags))) in tls_device_rx_resync_new_rec()
766 prot = &tls_ctx->prot_info; in tls_device_rx_resync_new_rec()
767 rx_ctx = tls_offload_ctx_rx(tls_ctx); in tls_device_rx_resync_new_rec()
768 memcpy(rcd_sn, tls_ctx->rx.rec_seq, prot->rec_seq_size); in tls_device_rx_resync_new_rec()
812 tls_device_resync_rx(tls_ctx, sk, seq, rcd_sn); in tls_device_rx_resync_new_rec()
815 static void tls_device_core_ctrl_rx_resync(struct tls_context *tls_ctx, in tls_device_core_ctrl_rx_resync() argument
851 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_device_core_ctrl_rx_resync()
854 memcpy(rcd_sn, tls_ctx->rx.rec_seq, prot->rec_seq_size); in tls_device_core_ctrl_rx_resync()
857 tls_device_resync_rx(tls_ctx, sk, tcp_sk(sk)->copied_seq, in tls_device_core_ctrl_rx_resync()
947 int tls_device_decrypted(struct sock *sk, struct tls_context *tls_ctx, in tls_device_decrypted() argument
950 struct tls_offload_context_rx *ctx = tls_offload_ctx_rx(tls_ctx); in tls_device_decrypted()
962 tls_ctx->rx.rec_seq, rxm->full_len, in tls_device_decrypted()
967 if (unlikely(test_bit(TLS_RX_DEV_DEGRADED, &tls_ctx->flags))) { in tls_device_decrypted()
987 tls_device_core_ctrl_rx_resync(tls_ctx, ctx, sk, skb); in tls_device_decrypted()
1014 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_set_device_offload() local
1015 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_set_device_offload()
1265 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_offload_cleanup_rx() local
1269 netdev = tls_ctx->netdev; in tls_device_offload_cleanup_rx()
1273 netdev->tlsdev_ops->tls_dev_del(netdev, tls_ctx, in tls_device_offload_cleanup_rx()
1276 if (tls_ctx->tx_conf != TLS_HW) { in tls_device_offload_cleanup_rx()
1278 tls_ctx->netdev = NULL; in tls_device_offload_cleanup_rx()
1280 set_bit(TLS_RX_DEV_CLOSED, &tls_ctx->flags); in tls_device_offload_cleanup_rx()