Skip to content

Commit 9e5ffed

Browse files
Jakub Kicinskidavem330
authored andcommitted
net/tls: remove the dead inplace_crypto code
Looks like when BPF support was added by commit d3b18ad ("tls: add bpf support to sk_msg handling") and commit d829e9c ("tls: convert to generic sk_msg interface") it broke/removed the support for in-place crypto as added by commit 4e6d472 ("tls: Add support for inplace records encryption"). The inplace_crypto member of struct tls_rec is dead, inited to zero, and sometimes set to zero again. It used to be set to 1 when record was allocated, but the skmsg code doesn't seem to have been written with the idea of in-place crypto in mind. Since non trivial effort is required to bring the feature back and we don't really have the HW to measure the benefit just remove the left over support for now to avoid confusing readers. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 65190f7 commit 9e5ffed

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

‎include/net/tls.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ struct tls_rec {
100100
struct list_head list;
101101
int tx_ready;
102102
int tx_flags;
103-
int inplace_crypto;
104103

105104
struct sk_msg msg_plaintext;
106105
struct sk_msg msg_encrypted;

‎net/tls/tls_sw.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,7 @@ static int tls_push_record(struct sock *sk, int flags,
710710
}
711711

712712
i = msg_pl->sg.start;
713-
sg_chain(rec->sg_aead_in, 2, rec->inplace_crypto ?
714-
&msg_en->sg.data[i] : &msg_pl->sg.data[i]);
713+
sg_chain(rec->sg_aead_in, 2, &msg_pl->sg.data[i]);
715714

716715
i = msg_en->sg.end;
717716
sk_msg_iter_var_prev(i);
@@ -976,8 +975,6 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
976975
if (ret)
977976
goto fallback_to_reg_send;
978977

979-
rec->inplace_crypto = 0;
980-
981978
num_zc++;
982979
copied += try_to_copy;
983980

@@ -1176,7 +1173,6 @@ static int tls_sw_do_sendpage(struct sock *sk, struct page *page,
11761173

11771174
tls_ctx->pending_open_record_frags = true;
11781175
if (full_record || eor || sk_msg_full(msg_pl)) {
1179-
rec->inplace_crypto = 0;
11801176
ret = bpf_exec_tx_verdict(msg_pl, sk, full_record,
11811177
record_type, &copied, flags);
11821178
if (ret) {

0 commit comments

Comments
 (0)