mbox series

[v4,0/3] net/mlx5: add large packet size support to MPRQ

Message ID 1586471033-17130-1-git-send-email-akozyrev@mellanox.com (mailing list archive)
Headers
Series net/mlx5: add large packet size support to MPRQ |

Message

Alexander Kozyrev April 9, 2020, 10:23 p.m. UTC
  In order to support the 9K MTU the MPRQ feature should be updated
to allow a packet to take more than one stride (single linear buffer).
Receiving a packet into multiple adjacent strides should be implemented.
The reason preventing the packet to be received into multiple strides is
that the data buffer must be preceded with some HEAD_ROOM space.
In the current implementation the HEAD_ROOM space is borrowed by the PMD
from the tail of the preceding stride. If packet takes multiple strides
the tail of stride may be overwritten with a packet data and the memory
can't be borrowed to provide the HEAD_ROOM space for the next packet.
Special care is needed to prevent the HEAD_ROOM corruption as such:
- copy a whole packet into a separate memory buffer if scatter is off
- copy an overlapping data only and craft a multi-segment mbuf otherwise
After multi-stride support for packets receiving is in place it is
possible to reduce the stride size for more efficient memory utilization.
Introduce the mprq_log_stride_size device parameter to configure
a stride size for MPRQ. Default stride size is set to 2048 bytes.

Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
---
v1: https://patchwork.dpdk.org/cover/67558/
v2: https://patchwork.dpdk.org/cover/67670/
merge documentation and implementation in one commit
v3: https://patchwork.dpdk.org/patch/68085/
rollback to simple burst Rx in case the packet size is too big
to fit into the stride and the stride size is not configured
v4: fix typo in code comments

Alexander Kozyrev (3):
  net/mlx5: add a devarg to specify MPRQ stride size
  net/mlx5: enable MPRQ multi-stride operations
  net/mlx5: add multi-segment packets in MPRQ mode

 doc/guides/nics/mlx5.rst               |  17 ++++-
 doc/guides/rel_notes/release_20_05.rst |   1 +
 drivers/net/mlx5/mlx5.c                |  34 ++++++++--
 drivers/net/mlx5/mlx5.h                |   1 +
 drivers/net/mlx5/mlx5_defs.h           |   3 +
 drivers/net/mlx5/mlx5_rxq.c            |  70 +++++++++++---------
 drivers/net/mlx5/mlx5_rxtx.c           | 113 +++++++++++++++++++--------------
 drivers/net/mlx5/mlx5_rxtx.h           |   2 +-
 8 files changed, 154 insertions(+), 87 deletions(-)
  

Comments

Matan Azrad April 10, 2020, 2:01 p.m. UTC | #1
From: Alexander Kozyrev
> In order to support the 9K MTU the MPRQ feature should be updated to
> allow a packet to take more than one stride (single linear buffer).
> Receiving a packet into multiple adjacent strides should be implemented.
> The reason preventing the packet to be received into multiple strides is that
> the data buffer must be preceded with some HEAD_ROOM space.
> In the current implementation the HEAD_ROOM space is borrowed by the
> PMD from the tail of the preceding stride. If packet takes multiple strides the
> tail of stride may be overwritten with a packet data and the memory can't be
> borrowed to provide the HEAD_ROOM space for the next packet.
> Special care is needed to prevent the HEAD_ROOM corruption as such:
> - copy a whole packet into a separate memory buffer if scatter is off
> - copy an overlapping data only and craft a multi-segment mbuf otherwise
> After multi-stride support for packets receiving is in place it is possible to
> reduce the stride size for more efficient memory utilization.
> Introduce the mprq_log_stride_size device parameter to configure a stride
> size for MPRQ. Default stride size is set to 2048 bytes.
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
> ---
> v1:
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.dpdk.org%2Fcover%2F67558%2F&amp;data=02%7C01%7Cmatan%40m
> ellanox.com%7Cf120e0911d1b47dde5a208d7dcd4c8eb%7Ca652971c7d2e4d9
> ba6a4d149256f461b%7C0%7C0%7C637220678801839724&amp;sdata=LUv0%2
> B6RkXIdDYpp5B7n5ZGo1IaSAKV5saVdMjTldUW4%3D&amp;reserved=0
> v2:
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.dpdk.org%2Fcover%2F67670%2F&amp;data=02%7C01%7Cmatan%40m
> ellanox.com%7Cf120e0911d1b47dde5a208d7dcd4c8eb%7Ca652971c7d2e4d9
> ba6a4d149256f461b%7C0%7C0%7C637220678801839724&amp;sdata=t%2FVy
> bs0qmS2NxgEyMsBsD%2BsJebXZ37CQU0opn7Yor%2BI%3D&amp;reserved=
> 0
> merge documentation and implementation in one commit
> v3:
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.dpdk.org%2Fpatch%2F68085%2F&amp;data=02%7C01%7Cmatan%40m
> ellanox.com%7Cf120e0911d1b47dde5a208d7dcd4c8eb%7Ca652971c7d2e4d9
> ba6a4d149256f461b%7C0%7C0%7C637220678801839724&amp;sdata=jXSxCaI
> Fr3V0XF7Cb0C6Xje1qwsf4aDlXAwB9BxGfdk%3D&amp;reserved=0
> rollback to simple burst Rx in case the packet size is too big to fit into the
> stride and the stride size is not configured
> v4: fix typo in code comments

Series-acked-by: Matan Azrad <matan@mellanox.com>
 
> Alexander Kozyrev (3):
>   net/mlx5: add a devarg to specify MPRQ stride size
>   net/mlx5: enable MPRQ multi-stride operations
>   net/mlx5: add multi-segment packets in MPRQ mode
> 
>  doc/guides/nics/mlx5.rst               |  17 ++++-
>  doc/guides/rel_notes/release_20_05.rst |   1 +
>  drivers/net/mlx5/mlx5.c                |  34 ++++++++--
>  drivers/net/mlx5/mlx5.h                |   1 +
>  drivers/net/mlx5/mlx5_defs.h           |   3 +
>  drivers/net/mlx5/mlx5_rxq.c            |  70 +++++++++++---------
>  drivers/net/mlx5/mlx5_rxtx.c           | 113 +++++++++++++++++++-------------
> -
>  drivers/net/mlx5/mlx5_rxtx.h           |   2 +-
>  8 files changed, 154 insertions(+), 87 deletions(-)
> 
> --
> 1.8.3.1
  
Raslan Darawsheh April 13, 2020, 10:57 a.m. UTC | #2
Hi,
> -----Original Message-----
> From: Alexander Kozyrev <akozyrev@mellanox.com>
> Sent: Friday, April 10, 2020 1:24 AM
> To: dev@dpdk.org
> Cc: Raslan Darawsheh <rasland@mellanox.com>; Matan Azrad
> <matan@mellanox.com>; Slava Ovsiienko <viacheslavo@mellanox.com>
> Subject: [PATCH v4 0/3] net/mlx5: add large packet size support to MPRQ
> 
> In order to support the 9K MTU the MPRQ feature should be updated
> to allow a packet to take more than one stride (single linear buffer).
> Receiving a packet into multiple adjacent strides should be implemented.
> The reason preventing the packet to be received into multiple strides is
> that the data buffer must be preceded with some HEAD_ROOM space.
> In the current implementation the HEAD_ROOM space is borrowed by the
> PMD
> from the tail of the preceding stride. If packet takes multiple strides
> the tail of stride may be overwritten with a packet data and the memory
> can't be borrowed to provide the HEAD_ROOM space for the next packet.
> Special care is needed to prevent the HEAD_ROOM corruption as such:
> - copy a whole packet into a separate memory buffer if scatter is off
> - copy an overlapping data only and craft a multi-segment mbuf otherwise
> After multi-stride support for packets receiving is in place it is
> possible to reduce the stride size for more efficient memory utilization.
> Introduce the mprq_log_stride_size device parameter to configure
> a stride size for MPRQ. Default stride size is set to 2048 bytes.
> 
> Signed-off-by: Alexander Kozyrev <akozyrev@mellanox.com>
> ---
> v1:
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.dpdk.org%2Fcover%2F67558%2F&amp;data=02%7C01%7Crasland%40
> mellanox.com%7Cb4e88289699c4d57cba508d7dcd4caf2%7Ca652971c7d2e4d9
> ba6a4d149256f461b%7C0%7C0%7C637220678808646094&amp;sdata=3aiMgH
> dWFEaCMh6Vw%2B3lzU9wr9C8FkZcpQN5jq1%2BWGg%3D&amp;reserved=0
> v2:
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.dpdk.org%2Fcover%2F67670%2F&amp;data=02%7C01%7Crasland%40
> mellanox.com%7Cb4e88289699c4d57cba508d7dcd4caf2%7Ca652971c7d2e4d9
> ba6a4d149256f461b%7C0%7C0%7C637220678808646094&amp;sdata=rw%2FR
> FqaQAY9gnScLNMTc%2Fg2NqKT6yuHal%2FP7vLdTf%2BY%3D&amp;reserved
> =0
> merge documentation and implementation in one commit
> v3:
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.dpdk.org%2Fpatch%2F68085%2F&amp;data=02%7C01%7Crasland%40
> mellanox.com%7Cb4e88289699c4d57cba508d7dcd4caf2%7Ca652971c7d2e4d9
> ba6a4d149256f461b%7C0%7C0%7C637220678808646094&amp;sdata=asYoyH
> y7r0hkU7Vgw%2Fjo1Zp%2B0UKZv%2BRB7iinXg%2B6mMw%3D&amp;reserv
> ed=0
> rollback to simple burst Rx in case the packet size is too big
> to fit into the stride and the stride size is not configured
> v4: fix typo in code comments
> 
> Alexander Kozyrev (3):
>   net/mlx5: add a devarg to specify MPRQ stride size
>   net/mlx5: enable MPRQ multi-stride operations
>   net/mlx5: add multi-segment packets in MPRQ mode
> 
>  doc/guides/nics/mlx5.rst               |  17 ++++-
>  doc/guides/rel_notes/release_20_05.rst |   1 +
>  drivers/net/mlx5/mlx5.c                |  34 ++++++++--
>  drivers/net/mlx5/mlx5.h                |   1 +
>  drivers/net/mlx5/mlx5_defs.h           |   3 +
>  drivers/net/mlx5/mlx5_rxq.c            |  70 +++++++++++---------
>  drivers/net/mlx5/mlx5_rxtx.c           | 113 +++++++++++++++++++-------------
> -
>  drivers/net/mlx5/mlx5_rxtx.h           |   2 +-
>  8 files changed, 154 insertions(+), 87 deletions(-)
> 
> --
> 1.8.3.1

Series applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh