@@ -52,9 +52,8 @@ static DEFINE_SPINLOCK(tls_device_lock);
52
52
53
53
static void tls_device_free_ctx (struct tls_context * ctx )
54
54
{
55
- struct tls_offload_context * offload_ctx = tls_offload_ctx ( ctx );
55
+ kfree ( tls_offload_ctx_tx ( ctx ) );
56
56
57
- kfree (offload_ctx );
58
57
kfree (ctx );
59
58
}
60
59
@@ -125,7 +124,7 @@ static void destroy_record(struct tls_record_info *record)
125
124
kfree (record );
126
125
}
127
126
128
- static void delete_all_records (struct tls_offload_context * offload_ctx )
127
+ static void delete_all_records (struct tls_offload_context_tx * offload_ctx )
129
128
{
130
129
struct tls_record_info * info , * temp ;
131
130
@@ -141,14 +140,14 @@ static void tls_icsk_clean_acked(struct sock *sk, u32 acked_seq)
141
140
{
142
141
struct tls_context * tls_ctx = tls_get_ctx (sk );
143
142
struct tls_record_info * info , * temp ;
144
- struct tls_offload_context * ctx ;
143
+ struct tls_offload_context_tx * ctx ;
145
144
u64 deleted_records = 0 ;
146
145
unsigned long flags ;
147
146
148
147
if (!tls_ctx )
149
148
return ;
150
149
151
- ctx = tls_offload_ctx (tls_ctx );
150
+ ctx = tls_offload_ctx_tx (tls_ctx );
152
151
153
152
spin_lock_irqsave (& ctx -> lock , flags );
154
153
info = ctx -> retransmit_hint ;
@@ -179,7 +178,7 @@ static void tls_icsk_clean_acked(struct sock *sk, u32 acked_seq)
179
178
void tls_device_sk_destruct (struct sock * sk )
180
179
{
181
180
struct tls_context * tls_ctx = tls_get_ctx (sk );
182
- struct tls_offload_context * ctx = tls_offload_ctx (tls_ctx );
181
+ struct tls_offload_context_tx * ctx = tls_offload_ctx_tx (tls_ctx );
183
182
184
183
if (ctx -> open_record )
185
184
destroy_record (ctx -> open_record );
@@ -219,7 +218,7 @@ static void tls_append_frag(struct tls_record_info *record,
219
218
220
219
static int tls_push_record (struct sock * sk ,
221
220
struct tls_context * ctx ,
222
- struct tls_offload_context * offload_ctx ,
221
+ struct tls_offload_context_tx * offload_ctx ,
223
222
struct tls_record_info * record ,
224
223
struct page_frag * pfrag ,
225
224
int flags ,
@@ -264,7 +263,7 @@ static int tls_push_record(struct sock *sk,
264
263
return tls_push_sg (sk , ctx , offload_ctx -> sg_tx_data , 0 , flags );
265
264
}
266
265
267
- static int tls_create_new_record (struct tls_offload_context * offload_ctx ,
266
+ static int tls_create_new_record (struct tls_offload_context_tx * offload_ctx ,
268
267
struct page_frag * pfrag ,
269
268
size_t prepend_size )
270
269
{
@@ -290,7 +289,7 @@ static int tls_create_new_record(struct tls_offload_context *offload_ctx,
290
289
}
291
290
292
291
static int tls_do_allocation (struct sock * sk ,
293
- struct tls_offload_context * offload_ctx ,
292
+ struct tls_offload_context_tx * offload_ctx ,
294
293
struct page_frag * pfrag ,
295
294
size_t prepend_size )
296
295
{
@@ -324,7 +323,7 @@ static int tls_push_data(struct sock *sk,
324
323
unsigned char record_type )
325
324
{
326
325
struct tls_context * tls_ctx = tls_get_ctx (sk );
327
- struct tls_offload_context * ctx = tls_offload_ctx (tls_ctx );
326
+ struct tls_offload_context_tx * ctx = tls_offload_ctx_tx (tls_ctx );
328
327
int tls_push_record_flags = flags | MSG_SENDPAGE_NOTLAST ;
329
328
int more = flags & (MSG_SENDPAGE_NOTLAST | MSG_MORE );
330
329
struct tls_record_info * record = ctx -> open_record ;
@@ -477,7 +476,7 @@ int tls_device_sendpage(struct sock *sk, struct page *page,
477
476
return rc ;
478
477
}
479
478
480
- struct tls_record_info * tls_get_record (struct tls_offload_context * context ,
479
+ struct tls_record_info * tls_get_record (struct tls_offload_context_tx * context ,
481
480
u32 seq , u64 * p_record_sn )
482
481
{
483
482
u64 record_sn = context -> hint_record_sn ;
@@ -524,7 +523,7 @@ int tls_set_device_offload(struct sock *sk, struct tls_context *ctx)
524
523
{
525
524
u16 nonce_size , tag_size , iv_size , rec_seq_size ;
526
525
struct tls_record_info * start_marker_record ;
527
- struct tls_offload_context * offload_ctx ;
526
+ struct tls_offload_context_tx * offload_ctx ;
528
527
struct tls_crypto_info * crypto_info ;
529
528
struct net_device * netdev ;
530
529
char * iv , * rec_seq ;
@@ -546,7 +545,7 @@ int tls_set_device_offload(struct sock *sk, struct tls_context *ctx)
546
545
goto out ;
547
546
}
548
547
549
- offload_ctx = kzalloc (TLS_OFFLOAD_CONTEXT_SIZE , GFP_KERNEL );
548
+ offload_ctx = kzalloc (TLS_OFFLOAD_CONTEXT_SIZE_TX , GFP_KERNEL );
550
549
if (!offload_ctx ) {
551
550
rc = - ENOMEM ;
552
551
goto free_marker_record ;
0 commit comments