[v4,2/3] net/mlx5: use API to set max LRO packet size

Message ID ad556cbf043ab96d84a6690c07d73a4deebdfe41.1573129825.git.dekelp@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series support API to set max LRO packet size |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Dekel Peled Nov. 7, 2019, 12:35 p.m. UTC
  This patch implements use of the API for LRO aggregated packet
max size.
Rx queue create is updated to use the relevant configuration.
Documentation is updated accordingly.

Signed-off-by: Dekel Peled <dekelp@mellanox.com>
---
 doc/guides/nics/mlx5.rst    | 2 ++
 drivers/net/mlx5/mlx5_rxq.c | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)
  

Comments

Slava Ovsiienko Nov. 8, 2019, 9:12 a.m. UTC | #1
> -----Original Message-----
> From: Dekel Peled <dekelp@mellanox.com>
> Sent: Thursday, November 7, 2019 14:35
> To: john.mcnamara@intel.com; marko.kovacevic@intel.com;
> nhorman@tuxdriver.com; ajit.khaparde@broadcom.com;
> somnath.kotur@broadcom.com; anatoly.burakov@intel.com;
> xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com;
> zhouguoyang@huawei.com; wenzhuo.lu@intel.com;
> konstantin.ananyev@intel.com; Matan Azrad <matan@mellanox.com>;
> Shahaf Shuler <shahafs@mellanox.com>; Slava Ovsiienko
> <viacheslavo@mellanox.com>; rmody@marvell.com;
> shshaikh@marvell.com; maxime.coquelin@redhat.com;
> tiwei.bie@intel.com; zhihong.wang@intel.com; yongwang@vmware.com;
> Thomas Monjalon <thomas@monjalon.net>; ferruh.yigit@intel.com;
> arybchenko@solarflare.com; jingjing.wu@intel.com;
> bernard.iremonger@intel.com
> Cc: dev@dpdk.org
> Subject: [PATCH v4 2/3] net/mlx5: use API to set max LRO packet size
> 
> This patch implements use of the API for LRO aggregated packet max size.
> Rx queue create is updated to use the relevant configuration.
> Documentation is updated accordingly.
> 
> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
  
Ferruh Yigit Nov. 8, 2019, 9:23 a.m. UTC | #2
On 11/8/2019 9:12 AM, Slava Ovsiienko wrote:
>> -----Original Message-----
>> From: Dekel Peled <dekelp@mellanox.com>
>> Sent: Thursday, November 7, 2019 14:35
>> To: john.mcnamara@intel.com; marko.kovacevic@intel.com;
>> nhorman@tuxdriver.com; ajit.khaparde@broadcom.com;
>> somnath.kotur@broadcom.com; anatoly.burakov@intel.com;
>> xuanziyang2@huawei.com; cloud.wangxiaoyun@huawei.com;
>> zhouguoyang@huawei.com; wenzhuo.lu@intel.com;
>> konstantin.ananyev@intel.com; Matan Azrad <matan@mellanox.com>;
>> Shahaf Shuler <shahafs@mellanox.com>; Slava Ovsiienko
>> <viacheslavo@mellanox.com>; rmody@marvell.com;
>> shshaikh@marvell.com; maxime.coquelin@redhat.com;
>> tiwei.bie@intel.com; zhihong.wang@intel.com; yongwang@vmware.com;
>> Thomas Monjalon <thomas@monjalon.net>; ferruh.yigit@intel.com;
>> arybchenko@solarflare.com; jingjing.wu@intel.com;
>> bernard.iremonger@intel.com
>> Cc: dev@dpdk.org
>> Subject: [PATCH v4 2/3] net/mlx5: use API to set max LRO packet size
>>
>> This patch implements use of the API for LRO aggregated packet max size.
>> Rx queue create is updated to use the relevant configuration.
>> Documentation is updated accordingly.
>>
>> Signed-off-by: Dekel Peled <dekelp@mellanox.com>
> Acked-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com>
> 

This is an ethdev level API change, that will affect multiple PMDs, shouldn't we
get more input than single company?
  

Patch

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 4f1093f..3b10daf 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -207,6 +207,8 @@  Limitations
   - KEEP_CRC offload cannot be supported with LRO.
   - The first mbuf length, without head-room,  must be big enough to include the
     TCP header (122B).
+  - Rx queue with LRO offload enabled, receiving a non-LRO packet, can forward
+    it with size limited to max LRO size, not to max RX packet length.
 
 Statistics
 ----------
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 9423e7b..c725e14 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -1772,7 +1772,9 @@  struct mlx5_rxq_ctrl *
 			   dev->data->dev_conf.rxmode.offloads;
 	unsigned int lro_on_queue = !!(offloads & DEV_RX_OFFLOAD_TCP_LRO);
 	const int mprq_en = mlx5_check_mprq_support(dev) > 0;
-	unsigned int max_rx_pkt_len = dev->data->dev_conf.rxmode.max_rx_pkt_len;
+	unsigned int max_rx_pkt_len = lro_on_queue ?
+			dev->data->dev_conf.rxmode.max_lro_pkt_size :
+			dev->data->dev_conf.rxmode.max_rx_pkt_len;
 	unsigned int non_scatter_min_mbuf_size = max_rx_pkt_len +
 							RTE_PKTMBUF_HEADROOM;
 	unsigned int max_lro_size = 0;