vdpa/mlx5: fix TSO offload without CSUM
Subsystems (2)
PATCH 1/1 vdpa/mlx5: fix TSO offload without CSUM
Packet was corrupted when TSO requested without CSUM update.
Enables CSUM automatically if only TSO requested.
--- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +7 -0
@@ -442,6 +442,13 @@ mlx5_vdpa_virtqs_prepare(struct mlx5_vdpa_priv *priv)DRV_LOG (ERR ,"Failed to configure negotiated features." );return -1 ; } +if ((priv->features & (1ULL <<VIRTIO_NET_F_CSUM )) ==0 && + ((priv->features & (1ULL <<VIRTIO_NET_F_HOST_TSO4 )) >0 || + (priv->features & (1ULL <<VIRTIO_NET_F_HOST_TSO6 )) >0 )) { +/* Packet may be corrupted if TSO is enabled without CSUM. */ +DRV_LOG (INFO ,"TSO is enabled without CSUM, force CSUM." ); + priv->features |= (1ULL <<VIRTIO_NET_F_CSUM ); + }if (nr_vring > priv->caps.max_num_virtio_queues *2 ) { DRV_LOG(ERR, "Do not support more than %d virtqs(%d).", (int)priv->caps.max_num_virtio_queues * 2,
Signature · 1 line
2.25.1
Quoted 41 lines
-----Original Message-----
From: stable <[email protected]> On Behalf Of Xueming Li
Sent: Sunday, June 13, 2021 8:52 PM
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Viacheslav Ovsiienko <[email protected]>; Maxime Coquelin <[email protected]>
Subject: [dpdk-stable] [PATCH] vdpa/mlx5: fix TSO offload without CSUMPacket was corrupted when TSO requested without CSUM update.
Enables CSUM automatically if only TSO requested.
Fixes 2aa8444b0084 ("vdpa/mlx5: support stateless offloads")Signed-off-by Xueming Li <[email protected]>--- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +7
-1@@ -442,6 +442,13 @@ mlx5_vdpa_virtqs_prepare(struct mlx5_vdpa_priv *priv)DRV_LOG (ERR ,"Failed to configure negotiated features." );return -1 ; } +if ((priv->features & (1ULL <<VIRTIO_NET_F_CSUM )) ==0 && + ((priv->features & (1ULL <<VIRTIO_NET_F_HOST_TSO4 )) >0 || + (priv->features & (1ULL <<VIRTIO_NET_F_HOST_TSO6 )) >0 )) { +/* Packet may be corrupted if TSO is enabled without CSUM. */ +DRV_LOG (INFO ,"TSO is enabled without CSUM, force CSUM." ); + priv->features |= (1ULL <<VIRTIO_NET_F_CSUM ); + }if (nr_vring > priv->caps.max_num_virtio_queues *2 ) { DRV_LOG(ERR, "Do not support more than %d virtqs(%d).", (int)priv->caps.max_num_virtio_queues * 2, --
Quoted 1 line
2.25.1
Xia, Chenbo
AppliedQuoted 41 lines
-----Original Message-----
From: stable <[email protected]> On Behalf Of Xueming Li
Sent: Sunday, June 13, 2021 8:52 PM
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Viacheslav Ovsiienko <[email protected]>; Maxime Coquelin <[email protected]>
Subject: [dpdk-stable] [PATCH] vdpa/mlx5: fix TSO offload without CSUMPacket was corrupted when TSO requested without CSUM update.
Enables CSUM automatically if only TSO requested.
Fixes 2aa8444b0084 ("vdpa/mlx5: support stateless offloads")Signed-off-by Xueming Li <[email protected]>--- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +7
-1@@ -442,6 +442,13 @@ mlx5_vdpa_virtqs_prepare(struct mlx5_vdpa_priv *priv)DRV_LOG (ERR ,"Failed to configure negotiated features." );return -1 ; } +if ((priv->features & (1ULL <<VIRTIO_NET_F_CSUM )) ==0 && + ((priv->features & (1ULL <<VIRTIO_NET_F_HOST_TSO4 )) >0 || + (priv->features & (1ULL <<VIRTIO_NET_F_HOST_TSO6 )) >0 )) { +/* Packet may be corrupted if TSO is enabled without CSUM. */ +DRV_LOG (INFO ,"TSO is enabled without CSUM, force CSUM." ); + priv->features |= (1ULL <<VIRTIO_NET_F_CSUM ); + }if (nr_vring > priv->caps.max_num_virtio_queues *2 ) { DRV_LOG(ERR, "Do not support more than %d virtqs(%d).", (int)priv->caps.max_num_virtio_queues * 2, --
Quoted 1 line
2.25.1
Applied to next-virtio/main, thanks!