mbox series

[v1,0/1,SRU,J:linux-bluefield] platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full

Message ID cover.1706725638.git.limings@nvidia.com
Headers show
Series platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full | expand

Message

Liming Sun Jan. 31, 2024, 6:32 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2051871

SRU Justification:

[Impact]
This is a cherry-pick fix from upstream to drop Tx network packet
when Tx TmFIFO is full.

[Fix]
Starting from Linux 5.16 kernel, Tx timeout mechanism was added
in the virtio_net driver which prints the "Tx timeout" warning
message when a packet stays in Tx queue for too long. Below is an
example of the reported message:

"[494105.316739] virtio_net virtio1 tmfifo_net0: TX timeout on
queue: 0, sq: output.0, vq: 0×1, name: output.0, usecs since
last trans: 3079892256".

This issue could happen when external host driver which drains the
FIFO is restared, stopped or upgraded. To avoid such confusing
"Tx timeout" messages, this commit adds logic to drop the outstanding
Tx packet if it's not able to transmit in two seconds due to Tx FIFO
full, which can be considered as congestion or out-of-resource drop.

This commit also handles the special case that the packet is half-
transmitted into the Tx FIFO. In such case, the packet is discarded
with remaining length stored in vring->rem_padding. So paddings with
zeros can be sent out when Tx space is available to maintain the
integrity of the packet format. The padded packet will be dropped on
the receiving side.

[Test Case]
Same functionality and testing as on BlueField-1/2/3. No functionality
change.

[Regression Potential]
Same behavior from user perspective.

[Other]
n/a


Liming Sun (1):
  [SRU][J:linux-bluefield] platform/mellanox: mlxbf-tmfifo: Drop Tx
    network packet when Tx TmFIFO is full

 drivers/platform/mellanox/mlxbf-tmfifo.c | 67 ++++++++++++++++++++++++
 1 file changed, 67 insertions(+)

Comments

Thibault Ferrante Feb. 2, 2024, 11:08 a.m. UTC | #1
On 31-01-2024 19:32, Liming Sun wrote:
> BugLink: https://bugs.launchpad.net/bugs/2051871
> 
> SRU Justification:
> 
> [Impact]
> This is a cherry-pick fix from upstream to drop Tx network packet
> when Tx TmFIFO is full.
> 
> [Fix]
> Starting from Linux 5.16 kernel, Tx timeout mechanism was added
> in the virtio_net driver which prints the "Tx timeout" warning
> message when a packet stays in Tx queue for too long. Below is an
> example of the reported message:
> 
> "[494105.316739] virtio_net virtio1 tmfifo_net0: TX timeout on
> queue: 0, sq: output.0, vq: 0×1, name: output.0, usecs since
> last trans: 3079892256".
> 
> This issue could happen when external host driver which drains the
> FIFO is restared, stopped or upgraded. To avoid such confusing
> "Tx timeout" messages, this commit adds logic to drop the outstanding
> Tx packet if it's not able to transmit in two seconds due to Tx FIFO
> full, which can be considered as congestion or out-of-resource drop.
> 
> This commit also handles the special case that the packet is half-
> transmitted into the Tx FIFO. In such case, the packet is discarded
> with remaining length stored in vring->rem_padding. So paddings with
> zeros can be sent out when Tx space is available to maintain the
> integrity of the packet format. The padded packet will be dropped on
> the receiving side.
> 
> [Test Case]
> Same functionality and testing as on BlueField-1/2/3. No functionality
> change.
> 
> [Regression Potential]
> Same behavior from user perspective.
> 
> [Other]
> n/a
> 
> 
> Liming Sun (1):
>    [SRU][J:linux-bluefield] platform/mellanox: mlxbf-tmfifo: Drop Tx
>      network packet when Tx TmFIFO is full
> 
>   drivers/platform/mellanox/mlxbf-tmfifo.c | 67 ++++++++++++++++++++++++
>   1 file changed, 67 insertions(+)
> 

Acked-by: Thibault Ferrante <thibault.ferrante@canonical.com>

--
Thibault
Bartlomiej Zolnierkiewicz Feb. 2, 2024, 2:26 p.m. UTC | #2
Acked-by: Bartlomiej Zolnierkiewicz <bartlomiej.zolnierkiewicz@canonical.com>

On Wed, Jan 31, 2024 at 7:33 PM Liming Sun <limings@nvidia.com> wrote:
>
> BugLink: https://bugs.launchpad.net/bugs/2051871
>
> SRU Justification:
>
> [Impact]
> This is a cherry-pick fix from upstream to drop Tx network packet
> when Tx TmFIFO is full.
>
> [Fix]
> Starting from Linux 5.16 kernel, Tx timeout mechanism was added
> in the virtio_net driver which prints the "Tx timeout" warning
> message when a packet stays in Tx queue for too long. Below is an
> example of the reported message:
>
> "[494105.316739] virtio_net virtio1 tmfifo_net0: TX timeout on
> queue: 0, sq: output.0, vq: 0×1, name: output.0, usecs since
> last trans: 3079892256".
>
> This issue could happen when external host driver which drains the
> FIFO is restared, stopped or upgraded. To avoid such confusing
> "Tx timeout" messages, this commit adds logic to drop the outstanding
> Tx packet if it's not able to transmit in two seconds due to Tx FIFO
> full, which can be considered as congestion or out-of-resource drop.
>
> This commit also handles the special case that the packet is half-
> transmitted into the Tx FIFO. In such case, the packet is discarded
> with remaining length stored in vring->rem_padding. So paddings with
> zeros can be sent out when Tx space is available to maintain the
> integrity of the packet format. The padded packet will be dropped on
> the receiving side.
>
> [Test Case]
> Same functionality and testing as on BlueField-1/2/3. No functionality
> change.
>
> [Regression Potential]
> Same behavior from user perspective.
>
> [Other]
> n/a
>
>
> Liming Sun (1):
>   [SRU][J:linux-bluefield] platform/mellanox: mlxbf-tmfifo: Drop Tx
>     network packet when Tx TmFIFO is full
>
>  drivers/platform/mellanox/mlxbf-tmfifo.c | 67 ++++++++++++++++++++++++
>  1 file changed, 67 insertions(+)
>
Andrei Gherzan Feb. 5, 2024, 11:27 a.m. UTC | #3
On 24/01/31 01:32PM, Liming Sun wrote:
> BugLink: https://bugs.launchpad.net/bugs/2051871
> 
> SRU Justification:
> 
> [Impact]
> This is a cherry-pick fix from upstream to drop Tx network packet
> when Tx TmFIFO is full.
> 
> [Fix]
> Starting from Linux 5.16 kernel, Tx timeout mechanism was added
> in the virtio_net driver which prints the "Tx timeout" warning
> message when a packet stays in Tx queue for too long. Below is an
> example of the reported message:
> 
> "[494105.316739] virtio_net virtio1 tmfifo_net0: TX timeout on
> queue: 0, sq: output.0, vq: 0×1, name: output.0, usecs since
> last trans: 3079892256".
> 
> This issue could happen when external host driver which drains the
> FIFO is restared, stopped or upgraded. To avoid such confusing
> "Tx timeout" messages, this commit adds logic to drop the outstanding
> Tx packet if it's not able to transmit in two seconds due to Tx FIFO
> full, which can be considered as congestion or out-of-resource drop.
> 
> This commit also handles the special case that the packet is half-
> transmitted into the Tx FIFO. In such case, the packet is discarded
> with remaining length stored in vring->rem_padding. So paddings with
> zeros can be sent out when Tx space is available to maintain the
> integrity of the packet format. The padded packet will be dropped on
> the receiving side.
> 
> [Test Case]
> Same functionality and testing as on BlueField-1/2/3. No functionality
> change.
> 
> [Regression Potential]
> Same behavior from user perspective.
> 
> [Other]
> n/a
> 
> 
> Liming Sun (1):
>   [SRU][J:linux-bluefield] platform/mellanox: mlxbf-tmfifo: Drop Tx
>     network packet when Tx TmFIFO is full
> 
>  drivers/platform/mellanox/mlxbf-tmfifo.c | 67 ++++++++++++++++++++++++
>  1 file changed, 67 insertions(+)

Acked-by: Andrei Gherzan <andrei.gherzan@canonical.com>
Bartlomiej Zolnierkiewicz Feb. 15, 2024, 2:16 p.m. UTC | #4
Applied to jammy:linux-bluefield/master-next. Thanks.

--
Best regards,
Bartlomiej

On Wed, Jan 31, 2024 at 7:33 PM Liming Sun <limings@nvidia.com> wrote:
>
> BugLink: https://bugs.launchpad.net/bugs/2051871
>
> SRU Justification:
>
> [Impact]
> This is a cherry-pick fix from upstream to drop Tx network packet
> when Tx TmFIFO is full.
>
> [Fix]
> Starting from Linux 5.16 kernel, Tx timeout mechanism was added
> in the virtio_net driver which prints the "Tx timeout" warning
> message when a packet stays in Tx queue for too long. Below is an
> example of the reported message:
>
> "[494105.316739] virtio_net virtio1 tmfifo_net0: TX timeout on
> queue: 0, sq: output.0, vq: 0×1, name: output.0, usecs since
> last trans: 3079892256".
>
> This issue could happen when external host driver which drains the
> FIFO is restared, stopped or upgraded. To avoid such confusing
> "Tx timeout" messages, this commit adds logic to drop the outstanding
> Tx packet if it's not able to transmit in two seconds due to Tx FIFO
> full, which can be considered as congestion or out-of-resource drop.
>
> This commit also handles the special case that the packet is half-
> transmitted into the Tx FIFO. In such case, the packet is discarded
> with remaining length stored in vring->rem_padding. So paddings with
> zeros can be sent out when Tx space is available to maintain the
> integrity of the packet format. The padded packet will be dropped on
> the receiving side.
>
> [Test Case]
> Same functionality and testing as on BlueField-1/2/3. No functionality
> change.
>
> [Regression Potential]
> Same behavior from user perspective.
>
> [Other]
> n/a
>
>
> Liming Sun (1):
>   [SRU][J:linux-bluefield] platform/mellanox: mlxbf-tmfifo: Drop Tx
>     network packet when Tx TmFIFO is full
>
>  drivers/platform/mellanox/mlxbf-tmfifo.c | 67 ++++++++++++++++++++++++
>  1 file changed, 67 insertions(+)
>