DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: add debug print of LRO minimal size
@ 2020-10-08 15:11 Dekel Peled
  2020-10-13  9:10 ` Matan Azrad
  2020-10-15 13:37 ` [dpdk-dev] [PATCH v2] " Dekel Peled
  0 siblings, 2 replies; 4+ messages in thread
From: Dekel Peled @ 2020-10-08 15:11 UTC (permalink / raw)
  To: viacheslavo, shahafs, matan; +Cc: dev

Add debug printout showing HCA capability lro_min_mss_size - the
minimal size of TCP segment required for coalescing.
MLX5 PMD documentation is updated to note this condition.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
---
 doc/guides/nics/mlx5.rst             | 4 +++-
 drivers/common/mlx5/mlx5_devx_cmds.c | 2 ++
 drivers/common/mlx5/mlx5_devx_cmds.h | 1 +
 drivers/net/mlx5/linux/mlx5_os.c     | 3 +++
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index b0614ae..f4632dc 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -302,8 +302,10 @@ Limitations
     it with size limited to max LRO size, not to max RX packet length.
   - LRO can be used with outer header of TCP packets of the standard format:
         eth (with or without vlan) / ipv4 or ipv6 / tcp / payload
-
     Other TCP packets (e.g. with MPLS label) received on Rx queue with LRO enabled, will be received with bad checksum.
+  - LRO packet aggregation is performed by HW only for packet size larger than
+    ``lro_min_mss_size``. This value is reported on device start, when debug
+    mode is enabled.
 
 - CRC:
 
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index 7c81ae1..224f72c 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -792,6 +792,8 @@ struct mlx5_devx_obj *
 			MLX5_GET(per_protocol_networking_offload_caps, hcattr,
 				 lro_timer_supported_periods[i]);
 	}
+	attr->lro_min_mss_size = MLX5_GET(per_protocol_networking_offload_caps,
+					  hcattr, lro_min_mss_size);
 	attr->tunnel_stateless_geneve_rx =
 			    MLX5_GET(per_protocol_networking_offload_caps,
 				     hcattr, tunnel_stateless_geneve_rx);
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 1c84cea..1834132 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -85,6 +85,7 @@ struct mlx5_hca_attr {
 	uint32_t tunnel_lro_vxlan:1;
 	uint32_t lro_max_msg_sz_mode:2;
 	uint32_t lro_timer_supported_periods[MLX5_LRO_NUM_SUPP_PERIODS];
+	uint16_t lro_min_mss_size;
 	uint32_t flex_parser_protocols;
 	uint32_t hairpin:1;
 	uint32_t log_max_hairpin_queues:5;
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 487714f..5bf460a 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1071,6 +1071,9 @@
 				config->hca_attr.lro_timer_supported_periods[0];
 			DRV_LOG(DEBUG, "LRO session timeout set to %d usec",
 				config->lro.timeout);
+			DRV_LOG(DEBUG, "LRO minimal size of TCP segment "
+				"required for coalescing is %d bytes",
+				config->hca_attr.lro_min_mss_size);
 		}
 #if defined(HAVE_MLX5DV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER)
 		if (config->hca_attr.qos.sup &&
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: add debug print of LRO minimal size
  2020-10-08 15:11 [dpdk-dev] [PATCH] net/mlx5: add debug print of LRO minimal size Dekel Peled
@ 2020-10-13  9:10 ` Matan Azrad
  2020-10-15 13:37 ` [dpdk-dev] [PATCH v2] " Dekel Peled
  1 sibling, 0 replies; 4+ messages in thread
From: Matan Azrad @ 2020-10-13  9:10 UTC (permalink / raw)
  To: Dekel Peled, Slava Ovsiienko, Shahaf Shuler; +Cc: dev



From: Dekel Peled
> Add debug printout showing HCA capability lro_min_mss_size - the minimal
> size of TCP segment required for coalescing.
> MLX5 PMD documentation is updated to note this condition.
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@mellanox.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH v2] net/mlx5: add debug print of LRO minimal size
  2020-10-08 15:11 [dpdk-dev] [PATCH] net/mlx5: add debug print of LRO minimal size Dekel Peled
  2020-10-13  9:10 ` Matan Azrad
@ 2020-10-15 13:37 ` Dekel Peled
  2020-10-19 11:40   ` Raslan Darawsheh
  1 sibling, 1 reply; 4+ messages in thread
From: Dekel Peled @ 2020-10-15 13:37 UTC (permalink / raw)
  To: viacheslavo, shahafs, matan; +Cc: dev

Add debug printout showing HCA capability lro_min_mss_size - the
minimal size of TCP segment required for coalescing.
MLX5 PMD documentation is updated to note this condition.

Signed-off-by: Dekel Peled <dekelp@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 doc/guides/nics/mlx5.rst             | 3 +++
 drivers/common/mlx5/mlx5_devx_cmds.c | 2 ++
 drivers/common/mlx5/mlx5_devx_cmds.h | 1 +
 drivers/net/mlx5/linux/mlx5_os.c     | 3 +++
 4 files changed, 9 insertions(+)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index a071db2..f3afb24 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -304,6 +304,9 @@ Limitations
         eth (with or without vlan) / ipv4 or ipv6 / tcp / payload
 
     Other TCP packets (e.g. with MPLS label) received on Rx queue with LRO enabled, will be received with bad checksum.
+  - LRO packet aggregation is performed by HW only for packet size larger than
+    ``lro_min_mss_size``. This value is reported on device start, when debug
+    mode is enabled.
 
 - CRC:
 
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index fd4e3f2..d3e90b5 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -819,6 +819,8 @@ struct mlx5_devx_obj *
 			MLX5_GET(per_protocol_networking_offload_caps, hcattr,
 				 lro_timer_supported_periods[i]);
 	}
+	attr->lro_min_mss_size = MLX5_GET(per_protocol_networking_offload_caps,
+					  hcattr, lro_min_mss_size);
 	attr->tunnel_stateless_geneve_rx =
 			    MLX5_GET(per_protocol_networking_offload_caps,
 				     hcattr, tunnel_stateless_geneve_rx);
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index cfa7a7b..c2d089c 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -85,6 +85,7 @@ struct mlx5_hca_attr {
 	uint32_t tunnel_lro_vxlan:1;
 	uint32_t lro_max_msg_sz_mode:2;
 	uint32_t lro_timer_supported_periods[MLX5_LRO_NUM_SUPP_PERIODS];
+	uint16_t lro_min_mss_size;
 	uint32_t flex_parser_protocols;
 	uint32_t hairpin:1;
 	uint32_t log_max_hairpin_queues:5;
diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 09d0944..e0a5a21 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -1071,6 +1071,9 @@
 				config->hca_attr.lro_timer_supported_periods[0];
 			DRV_LOG(DEBUG, "LRO session timeout set to %d usec",
 				config->lro.timeout);
+			DRV_LOG(DEBUG, "LRO minimal size of TCP segment "
+				"required for coalescing is %d bytes",
+				config->hca_attr.lro_min_mss_size);
 		}
 #if defined(HAVE_MLX5DV_DR) && defined(HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER)
 		if (config->hca_attr.qos.sup &&
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/mlx5: add debug print of LRO minimal size
  2020-10-15 13:37 ` [dpdk-dev] [PATCH v2] " Dekel Peled
@ 2020-10-19 11:40   ` Raslan Darawsheh
  0 siblings, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2020-10-19 11:40 UTC (permalink / raw)
  To: Dekel Peled, Slava Ovsiienko, Shahaf Shuler, Matan Azrad; +Cc: dev

Hi,

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Dekel Peled
> Sent: Thursday, October 15, 2020 4:37 PM
> To: Slava Ovsiienko <viacheslavo@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; Matan Azrad <matan@nvidia.com>
> Cc: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH v2] net/mlx5: add debug print of LRO minimal
> size
> 
> Add debug printout showing HCA capability lro_min_mss_size - the
> minimal size of TCP segment required for coalescing.
> MLX5 PMD documentation is updated to note this condition.
> 
> Signed-off-by: Dekel Peled <dekelp@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>
> ---
>  doc/guides/nics/mlx5.rst             | 3 +++
>  drivers/common/mlx5/mlx5_devx_cmds.c | 2 ++
>  drivers/common/mlx5/mlx5_devx_cmds.h | 1 +
>  drivers/net/mlx5/linux/mlx5_os.c     | 3 +++
>  4 files changed, 9 insertions(+)
> 
> diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
> index a071db2..f3afb24 100644
> --- a/doc/guides/nics/mlx5.rst
> +++ b/doc/guides/nics/mlx5.rst
> @@ -304,6 +304,9 @@ Limitations
>          eth (with or without vlan) / ipv4 or ipv6 / tcp / payload
> 
>      Other TCP packets (e.g. with MPLS label) received on Rx queue with LRO
> enabled, will be received with bad checksum.
> +  - LRO packet aggregation is performed by HW only for packet size larger
> than
> +    ``lro_min_mss_size``. This value is reported on device start, when debug
> +    mode is enabled.
> 
>  - CRC:
> 
> diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c
> b/drivers/common/mlx5/mlx5_devx_cmds.c
> index fd4e3f2..d3e90b5 100644
> --- a/drivers/common/mlx5/mlx5_devx_cmds.c
> +++ b/drivers/common/mlx5/mlx5_devx_cmds.c
> @@ -819,6 +819,8 @@ struct mlx5_devx_obj *
>  			MLX5_GET(per_protocol_networking_offload_caps,
> hcattr,
>  				 lro_timer_supported_periods[i]);
>  	}
> +	attr->lro_min_mss_size =
> MLX5_GET(per_protocol_networking_offload_caps,
> +					  hcattr, lro_min_mss_size);
>  	attr->tunnel_stateless_geneve_rx =
> 
> MLX5_GET(per_protocol_networking_offload_caps,
>  				     hcattr, tunnel_stateless_geneve_rx);
> diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h
> b/drivers/common/mlx5/mlx5_devx_cmds.h
> index cfa7a7b..c2d089c 100644
> --- a/drivers/common/mlx5/mlx5_devx_cmds.h
> +++ b/drivers/common/mlx5/mlx5_devx_cmds.h
> @@ -85,6 +85,7 @@ struct mlx5_hca_attr {
>  	uint32_t tunnel_lro_vxlan:1;
>  	uint32_t lro_max_msg_sz_mode:2;
>  	uint32_t
> lro_timer_supported_periods[MLX5_LRO_NUM_SUPP_PERIODS];
> +	uint16_t lro_min_mss_size;
>  	uint32_t flex_parser_protocols;
>  	uint32_t hairpin:1;
>  	uint32_t log_max_hairpin_queues:5;
> diff --git a/drivers/net/mlx5/linux/mlx5_os.c
> b/drivers/net/mlx5/linux/mlx5_os.c
> index 09d0944..e0a5a21 100644
> --- a/drivers/net/mlx5/linux/mlx5_os.c
> +++ b/drivers/net/mlx5/linux/mlx5_os.c
> @@ -1071,6 +1071,9 @@
>  				config-
> >hca_attr.lro_timer_supported_periods[0];
>  			DRV_LOG(DEBUG, "LRO session timeout set to %d
> usec",
>  				config->lro.timeout);
> +			DRV_LOG(DEBUG, "LRO minimal size of TCP segment
> "
> +				"required for coalescing is %d bytes",
> +				config->hca_attr.lro_min_mss_size);
>  		}
>  #if defined(HAVE_MLX5DV_DR) &&
> defined(HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER)
>  		if (config->hca_attr.qos.sup &&
> --
> 1.8.3.1

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-10-19 11:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-08 15:11 [dpdk-dev] [PATCH] net/mlx5: add debug print of LRO minimal size Dekel Peled
2020-10-13  9:10 ` Matan Azrad
2020-10-15 13:37 ` [dpdk-dev] [PATCH v2] " Dekel Peled
2020-10-19 11:40   ` Raslan Darawsheh

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git