Lines Matching refs:tls_ctx

148 	struct tls_context *tls_ctx = tls_get_ctx(sk);  in tls_icsk_clean_acked()  local
154 if (!tls_ctx) in tls_icsk_clean_acked()
157 ctx = tls_offload_ctx_tx(tls_ctx); in tls_icsk_clean_acked()
183 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_sk_destruct() local
184 struct tls_offload_context_tx *ctx = tls_offload_ctx_tx(tls_ctx); in tls_device_sk_destruct()
186 tls_ctx->sk_destruct(sk); in tls_device_sk_destruct()
188 if (tls_ctx->tx_conf == TLS_HW) { in tls_device_sk_destruct()
196 if (refcount_dec_and_test(&tls_ctx->refcount)) in tls_device_sk_destruct()
197 tls_device_queue_ctx_destruction(tls_ctx); in tls_device_sk_destruct()
203 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_free_resources_tx() local
205 tls_free_partial_record(sk, tls_ctx); in tls_device_free_resources_tx()
210 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_offload_tx_resync_request() local
213 WARN_ON(test_and_set_bit(TLS_TX_SYNC_SCHED, &tls_ctx->flags)); in tls_offload_tx_resync_request()
217 static void tls_device_resync_tx(struct sock *sk, struct tls_context *tls_ctx, in tls_device_resync_tx() argument
229 rcd_sn = tls_ctx->tx.rec_seq; in tls_device_resync_tx()
233 netdev = tls_ctx->netdev; in tls_device_resync_tx()
242 clear_bit_unlock(TLS_TX_SYNC_SCHED, &tls_ctx->flags); in tls_device_resync_tx()
418 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_push_data() local
419 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_push_data()
420 struct tls_offload_context_tx *ctx = tls_offload_ctx_tx(tls_ctx); in tls_push_data()
442 if (tls_is_partially_sent_record(tls_ctx)) { in tls_push_data()
443 rc = tls_push_partial_record(sk, tls_ctx, flags); in tls_push_data()
505 rc = tls_device_record_close(sk, tls_ctx, record, in tls_push_data()
519 tls_ctx, in tls_push_data()
528 tls_ctx->pending_open_record_frags = more; in tls_push_data()
539 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_sendmsg() local
542 mutex_lock(&tls_ctx->tx_lock); in tls_device_sendmsg()
556 mutex_unlock(&tls_ctx->tx_lock); in tls_device_sendmsg()
563 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_sendpage() local
572 mutex_lock(&tls_ctx->tx_lock); in tls_device_sendpage()
590 mutex_unlock(&tls_ctx->tx_lock); in tls_device_sendpage()
677 static void tls_device_resync_rx(struct tls_context *tls_ctx, in tls_device_resync_rx() argument
680 struct tls_offload_context_rx *rx_ctx = tls_offload_ctx_rx(tls_ctx); in tls_device_resync_rx()
683 if (WARN_ON(test_and_set_bit(TLS_RX_SYNC_RUNNING, &tls_ctx->flags))) in tls_device_resync_rx()
687 netdev = READ_ONCE(tls_ctx->netdev); in tls_device_resync_rx()
691 clear_bit_unlock(TLS_RX_SYNC_RUNNING, &tls_ctx->flags); in tls_device_resync_rx()
753 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_rx_resync_new_rec() local
762 if (tls_ctx->rx_conf != TLS_HW) in tls_device_rx_resync_new_rec()
765 prot = &tls_ctx->prot_info; in tls_device_rx_resync_new_rec()
766 rx_ctx = tls_offload_ctx_rx(tls_ctx); in tls_device_rx_resync_new_rec()
767 memcpy(rcd_sn, tls_ctx->rx.rec_seq, prot->rec_seq_size); in tls_device_rx_resync_new_rec()
811 tls_device_resync_rx(tls_ctx, sk, seq, rcd_sn); in tls_device_rx_resync_new_rec()
814 static void tls_device_core_ctrl_rx_resync(struct tls_context *tls_ctx, in tls_device_core_ctrl_rx_resync() argument
850 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_device_core_ctrl_rx_resync()
853 memcpy(rcd_sn, tls_ctx->rx.rec_seq, prot->rec_seq_size); in tls_device_core_ctrl_rx_resync()
856 tls_device_resync_rx(tls_ctx, sk, tcp_sk(sk)->copied_seq, in tls_device_core_ctrl_rx_resync()
946 int tls_device_decrypted(struct sock *sk, struct tls_context *tls_ctx, in tls_device_decrypted() argument
949 struct tls_offload_context_rx *ctx = tls_offload_ctx_rx(tls_ctx); in tls_device_decrypted()
961 tls_ctx->rx.rec_seq, rxm->full_len, in tls_device_decrypted()
975 tls_device_core_ctrl_rx_resync(tls_ctx, ctx, sk, skb); in tls_device_decrypted()
1002 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_set_device_offload() local
1003 struct tls_prot_info *prot = &tls_ctx->prot_info; in tls_set_device_offload()
1251 struct tls_context *tls_ctx = tls_get_ctx(sk); in tls_device_offload_cleanup_rx() local
1255 netdev = tls_ctx->netdev; in tls_device_offload_cleanup_rx()
1259 netdev->tlsdev_ops->tls_dev_del(netdev, tls_ctx, in tls_device_offload_cleanup_rx()
1262 if (tls_ctx->tx_conf != TLS_HW) { in tls_device_offload_cleanup_rx()
1264 tls_ctx->netdev = NULL; in tls_device_offload_cleanup_rx()
1266 set_bit(TLS_RX_DEV_CLOSED, &tls_ctx->flags); in tls_device_offload_cleanup_rx()