Skip to content

Commit 732a71a

Browse files
Shahar Shitritgregkh
authored andcommitted
net: tls: Change async resync helpers argument
[ Upstream commit 34892cfec0c2d96787c4be7bda0d5f18d7dacf85 ] Update tls_offload_rx_resync_async_request_start() and tls_offload_rx_resync_async_request_end() to get a struct tls_offload_resync_async parameter directly, rather than extracting it from struct sock. This change aligns the function signatures with the upcoming tls_offload_rx_resync_async_request_cancel() helper, which will be introduced in a subsequent patch. Signed-off-by: Shahar Shitrit <[email protected]> Reviewed-by: Sabrina Dubroca <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent baeb52c commit 732a71a

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core/en_accel
  • include/net

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_rx.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,12 +425,14 @@ void mlx5e_ktls_handle_get_psv_completion(struct mlx5e_icosq_wqe_info *wi,
425425
{
426426
struct mlx5e_ktls_rx_resync_buf *buf = wi->tls_get_params.buf;
427427
struct mlx5e_ktls_offload_context_rx *priv_rx;
428+
struct tls_offload_context_rx *rx_ctx;
428429
u8 tracker_state, auth_state, *ctx;
429430
struct device *dev;
430431
u32 hw_seq;
431432

432433
priv_rx = buf->priv_rx;
433434
dev = mlx5_core_dma_dev(sq->channel->mdev);
435+
rx_ctx = tls_offload_ctx_rx(tls_get_ctx(priv_rx->sk));
434436
if (unlikely(test_bit(MLX5E_PRIV_RX_FLAG_DELETING, priv_rx->flags)))
435437
goto out;
436438

@@ -447,7 +449,8 @@ void mlx5e_ktls_handle_get_psv_completion(struct mlx5e_icosq_wqe_info *wi,
447449
}
448450

449451
hw_seq = MLX5_GET(tls_progress_params, ctx, hw_resync_tcp_sn);
450-
tls_offload_rx_resync_async_request_end(priv_rx->sk, cpu_to_be32(hw_seq));
452+
tls_offload_rx_resync_async_request_end(rx_ctx->resync_async,
453+
cpu_to_be32(hw_seq));
451454
priv_rx->rq_stats->tls_resync_req_end++;
452455
out:
453456
mlx5e_ktls_priv_rx_put(priv_rx);
@@ -482,6 +485,7 @@ static bool resync_queue_get_psv(struct sock *sk)
482485
static void resync_update_sn(struct mlx5e_rq *rq, struct sk_buff *skb)
483486
{
484487
struct ethhdr *eth = (struct ethhdr *)(skb->data);
488+
struct tls_offload_resync_async *resync_async;
485489
struct net_device *netdev = rq->netdev;
486490
struct net *net = dev_net(netdev);
487491
struct sock *sk = NULL;
@@ -528,7 +532,8 @@ static void resync_update_sn(struct mlx5e_rq *rq, struct sk_buff *skb)
528532

529533
seq = th->seq;
530534
datalen = skb->len - depth;
531-
tls_offload_rx_resync_async_request_start(sk, seq, datalen);
535+
resync_async = tls_offload_ctx_rx(tls_get_ctx(sk))->resync_async;
536+
tls_offload_rx_resync_async_request_start(resync_async, seq, datalen);
532537
rq->stats->tls_resync_req_start++;
533538

534539
unref:

include/net/tls.h

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -451,25 +451,20 @@ static inline void tls_offload_rx_resync_request(struct sock *sk, __be32 seq)
451451

452452
/* Log all TLS record header TCP sequences in [seq, seq+len] */
453453
static inline void
454-
tls_offload_rx_resync_async_request_start(struct sock *sk, __be32 seq, u16 len)
454+
tls_offload_rx_resync_async_request_start(struct tls_offload_resync_async *resync_async,
455+
__be32 seq, u16 len)
455456
{
456-
struct tls_context *tls_ctx = tls_get_ctx(sk);
457-
struct tls_offload_context_rx *rx_ctx = tls_offload_ctx_rx(tls_ctx);
458-
459-
atomic64_set(&rx_ctx->resync_async->req, ((u64)ntohl(seq) << 32) |
457+
atomic64_set(&resync_async->req, ((u64)ntohl(seq) << 32) |
460458
((u64)len << 16) | RESYNC_REQ | RESYNC_REQ_ASYNC);
461-
rx_ctx->resync_async->loglen = 0;
462-
rx_ctx->resync_async->rcd_delta = 0;
459+
resync_async->loglen = 0;
460+
resync_async->rcd_delta = 0;
463461
}
464462

465463
static inline void
466-
tls_offload_rx_resync_async_request_end(struct sock *sk, __be32 seq)
464+
tls_offload_rx_resync_async_request_end(struct tls_offload_resync_async *resync_async,
465+
__be32 seq)
467466
{
468-
struct tls_context *tls_ctx = tls_get_ctx(sk);
469-
struct tls_offload_context_rx *rx_ctx = tls_offload_ctx_rx(tls_ctx);
470-
471-
atomic64_set(&rx_ctx->resync_async->req,
472-
((u64)ntohl(seq) << 32) | RESYNC_REQ);
467+
atomic64_set(&resync_async->req, ((u64)ntohl(seq) << 32) | RESYNC_REQ);
473468
}
474469

475470
static inline void

0 commit comments

Comments
 (0)