Thread (60 messages) 60 messages, 8 authors, 2021-08-10
STALE1787d

[PATCH v5 net-next 35/36] net/mlx5e: NVMEoTCP DDGST TX offload optimization

From: Boris Pismenny <borisp@nvidia.com>
Date: 2021-07-22 12:20:46
Also in: netdev
Subsystem: mellanox ethernet driver (mlx5e), mellanox ethernet innova drivers, mellanox mlx5 core vpi driver, networking drivers, the rest · Maintainers: Saeed Mahameed, Tariq Toukan, Mark Bloch, Leon Romanovsky, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Yoray Zack <redacted>

Stop offloading NVMEoTCP OOO packets which aren't contains the pdu DDGST field.

When the driver indicate an OOO NVMEoTCP packet he check if it contains
NVMEoTCP PDU DDGST field, if so he offloads it, otherwise he isn't.

Signed-off-by: Yoray Zack <redacted>
---
 .../mellanox/mlx5/core/en_accel/nvmeotcp.c    | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/nvmeotcp.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/nvmeotcp.c
index f8cba90679ea..f3ef92167e25 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/nvmeotcp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/nvmeotcp.c
@@ -1393,6 +1393,20 @@ bool mlx5e_nvmeotcp_resync_cap(struct mlx5e_nvmeotcp_queue *queue,
 	return false;
 }
 
+static
+bool mlx5e_nvmeotcp_check_if_need_offload(struct mlx5e_nvmeotcp_queue *queue,
+					  u32  end_seq, u32 start_seq)
+{
+	if (!queue->end_seq_hint)
+		return false;
+
+	/* check if skb end after pdu crc start */
+	if (before(queue->end_seq_hint, end_seq) || before(start_seq, queue->start_pdu_hint))
+		return false;
+
+	return true;
+}
+
 static enum mlx5e_nvmeotcp_resync_retval
 mlx5e_nvmeotcp_handle_ooo_skb(struct mlx5e_nvmeotcp_queue *queue,
 			      struct mlx5e_txqsq *sq, struct sk_buff *skb,
@@ -1400,12 +1414,21 @@ mlx5e_nvmeotcp_handle_ooo_skb(struct mlx5e_nvmeotcp_queue *queue,
 {
 	struct ulp_ddp_pdu_info *pdu_info = NULL;
 
+	if (mlx5e_nvmeotcp_check_if_need_offload(queue, seq + datalen, seq)) {
+		return MLX5E_NVMEOTCP_RESYNC_SKIP;
+
 	/* ask for pdu_info that includes the tcp_seq */
 	pdu_info = ulp_ddp_get_pdu_info(skb->sk, seq);
 
 	if (!pdu_info)
 		return MLX5E_NVMEOTCP_RESYNC_SKIP;
 
+	queue->end_seq_hint = pdu_info->end_seq - 4;
+	queue->start_pdu_hint = pdu_info->start_seq;
+	/* check if this packet contain crc - if so offload else no */
+	if (mlx5e_nvmeotcp_check_if_need_offload(queue, seq + datalen, seq)) {
+		return MLX5E_NVMEOTCP_RESYNC_SKIP;
+
 	/*update NIC about resync - he will rebuild parse machine
 	 *send psv with small fence
 	 */
-- 
2.24.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help