Date: Wed, 17 Jun 2020 11:14:54 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362272 - head/sys/dev/mlx5/mlx5_en Message-ID: <202006171114.05HBEsKD005480@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed Jun 17 11:14:54 2020 New Revision: 362272 URL: https://svnweb.freebsd.org/changeset/base/362272 Log: Fix HW TLS offload regression issue after r359919, in mlx5en(4). Changes in the mbuf layout regarding HW TLS, resulted in wrong detection of starting mbuf. Use a boolean variable to handle this and pass m_adj() the top mbuf, so that the packet header is adjusted correctly. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Wed Jun 17 11:12:10 2020 (r362271) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c Wed Jun 17 11:14:54 2020 (r362272) @@ -610,7 +610,7 @@ mlx5e_tls_send_nop(struct mlx5e_sq *sq, struct mlx5e_t #define SBTLS_MBUF_NO_DATA ((struct mbuf *)1) static struct mbuf * -sbtls_recover_record(struct mbuf *mb, int wait, uint32_t tcp_old, uint32_t *ptcp_seq) +sbtls_recover_record(struct mbuf *mb, int wait, uint32_t tcp_old, uint32_t *ptcp_seq, bool *pis_start) { struct mbuf *mr, *top; uint32_t offset; @@ -629,6 +629,7 @@ sbtls_recover_record(struct mbuf *mb, int wait, uint32 /* check if we don't need to re-transmit anything */ if (offset == 0) { top = SBTLS_MBUF_NO_DATA; + *pis_start = true; goto done; } @@ -653,13 +654,19 @@ sbtls_recover_record(struct mbuf *mb, int wait, uint32 /* setup packet header length */ top->m_pkthdr.len = mr->m_len = offset; + top->m_len = 0; /* check for partial re-transmit */ delta = *ptcp_seq - tcp_old; if (delta < offset) { - m_adj(mr, offset - delta); + m_adj(top, offset - delta); offset = delta; + + /* continue where we left off */ + *pis_start = false; + } else { + *pis_start = true; } /* @@ -745,10 +752,11 @@ mlx5e_sq_tls_xmit(struct mlx5e_sq *sq, struct mlx5e_xm } if (unlikely(ptls_tag->expected_seq != mb_seq)) { + bool is_start; struct mbuf *r_mb; uint32_t tcp_seq = mb_seq; - r_mb = sbtls_recover_record(mb, M_NOWAIT, ptls_tag->expected_seq, &tcp_seq); + r_mb = sbtls_recover_record(mb, M_NOWAIT, ptls_tag->expected_seq, &tcp_seq, &is_start); if (r_mb == NULL) { MLX5E_TLS_STAT_INC(ptls_tag, tx_error, 1); return (MLX5E_TLS_FAILURE); @@ -757,7 +765,7 @@ mlx5e_sq_tls_xmit(struct mlx5e_sq *sq, struct mlx5e_xm MLX5E_TLS_STAT_INC(ptls_tag, tx_packets_ooo, 1); /* check if this is the first fragment of a TLS record */ - if (r_mb == SBTLS_MBUF_NO_DATA || r_mb->m_data == NULL) { + if (is_start) { /* setup TLS static parameters */ MLX5_SET64(sw_tls_cntx, ptls_tag->crypto_params, param.initial_record_number, rcd_sn);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006171114.05HBEsKD005480>