Skip to content

Commit acb5a07

Browse files
Boris PismennySaeed Mahameed
authored andcommitted
Revert "net/tls: Add force_resync for driver resync"
This reverts commit b3ae245. Revert the force resync API. Not in use. To be replaced by a better async resync API downstream. Signed-off-by: Boris Pismenny <borisp@mellanox.com> Signed-off-by: Tariq Toukan <tariqt@mellanox.com> Reviewed-by: Maxim Mikityanskiy <maximmi@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
1 parent 1182f36 commit acb5a07

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

include/net/tls.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -607,22 +607,12 @@ tls_driver_ctx(const struct sock *sk, enum tls_offload_ctx_dir direction)
607607
#endif
608608

609609
/* The TLS context is valid until sk_destruct is called */
610-
#define RESYNC_REQ (1 << 0)
611-
#define RESYNC_REQ_FORCE (1 << 1)
612610
static inline void tls_offload_rx_resync_request(struct sock *sk, __be32 seq)
613611
{
614612
struct tls_context *tls_ctx = tls_get_ctx(sk);
615613
struct tls_offload_context_rx *rx_ctx = tls_offload_ctx_rx(tls_ctx);
616614

617-
atomic64_set(&rx_ctx->resync_req, ((u64)ntohl(seq) << 32) | RESYNC_REQ);
618-
}
619-
620-
static inline void tls_offload_rx_force_resync_request(struct sock *sk)
621-
{
622-
struct tls_context *tls_ctx = tls_get_ctx(sk);
623-
struct tls_offload_context_rx *rx_ctx = tls_offload_ctx_rx(tls_ctx);
624-
625-
atomic64_set(&rx_ctx->resync_req, RESYNC_REQ | RESYNC_REQ_FORCE);
615+
atomic64_set(&rx_ctx->resync_req, ((u64)ntohl(seq) << 32) | 1);
626616
}
627617

628618
static inline void

net/tls/tls_device.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -694,11 +694,10 @@ void tls_device_rx_resync_new_rec(struct sock *sk, u32 rcd_len, u32 seq)
694694
{
695695
struct tls_context *tls_ctx = tls_get_ctx(sk);
696696
struct tls_offload_context_rx *rx_ctx;
697-
bool is_req_pending, is_force_resync;
698697
u8 rcd_sn[TLS_MAX_REC_SEQ_SIZE];
698+
u32 sock_data, is_req_pending;
699699
struct tls_prot_info *prot;
700700
s64 resync_req;
701-
u32 sock_data;
702701
u32 req_seq;
703702

704703
if (tls_ctx->rx_conf != TLS_HW)
@@ -713,11 +712,9 @@ void tls_device_rx_resync_new_rec(struct sock *sk, u32 rcd_len, u32 seq)
713712
resync_req = atomic64_read(&rx_ctx->resync_req);
714713
req_seq = resync_req >> 32;
715714
seq += TLS_HEADER_SIZE - 1;
716-
is_req_pending = resync_req & RESYNC_REQ;
717-
is_force_resync = resync_req & RESYNC_REQ_FORCE;
715+
is_req_pending = resync_req;
718716

719-
if (likely(!is_req_pending) ||
720-
(!is_force_resync && req_seq != seq) ||
717+
if (likely(!is_req_pending) || req_seq != seq ||
721718
!atomic64_try_cmpxchg(&rx_ctx->resync_req, &resync_req, 0))
722719
return;
723720
break;

0 commit comments

Comments
 (0)