Skip to contentSkip to conversation

ENA driver metrics changes

PATCH Superseded David Arinzon 5 participants 22 messages Aug 11, 2024 – Sep 4, 2024

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

David Arinzon

author maintainer
#0 lore raw

cover ENA driver metrics changes

This patchset contains an introduction of new metrics available to ENA users.

David Arinzon (2):
net: ena: Add ENA Express metrics support
net: ena: Extend customer metrics reporting support

 .../device_drivers/ethernet/amazon/ena.rst    |   5 +
 .../net/ethernet/amazon/ena/ena_admin_defs.h  |  72 ++++++++
 drivers/net/ethernet/amazon/ena/ena_com.c     | 173 +++++++++++++++---
 drivers/net/ethernet/amazon/ena/ena_com.h     |  68 +++++++
 drivers/net/ethernet/amazon/ena/ena_ethtool.c | 162 +++++++++++++---
 drivers/net/ethernet/amazon/ena/ena_netdev.c  |  27 ++-
 drivers/net/ethernet/amazon/ena/ena_netdev.h  |   2 +-
 7 files changed, 441 insertions(+), 68 deletions(-)
Signature · 1 line
2.40.1
author maintainer
#1 lore raw

PATCH 1/2 net: ena: Add ENA Express metrics support

ENA Express metrics, called ena_srd are exposed to customers via ethtool.
The metrics allow customers to check the configuration, tx/rx counters as well resource usage.

The documentation is also updated to provide a general explanation and links for further information.

---
 .../device_drivers/ethernet/amazon/ena.rst    |  5 ++
 .../net/ethernet/amazon/ena/ena_admin_defs.h  | 42 ++++++++++
 drivers/net/ethernet/amazon/ena/ena_com.c     | 21 +++++
 drivers/net/ethernet/amazon/ena/ena_com.h     |  9 ++
 drivers/net/ethernet/amazon/ena/ena_ethtool.c | 84 ++++++++++++++-----
 drivers/net/ethernet/amazon/ena/ena_netdev.c  | 13 ---
 drivers/net/ethernet/amazon/ena/ena_netdev.h  |  2 +-
 7 files changed, 142 insertions(+), 34 deletions(-)
Documentation/networking/device_drivers/ethernet/amazon/ena.rst +5 -0
index a4c7d0c6..4561e8ab 100644
@@ -230,6 +230,11 @@ per-queue stats) from the device.
 
 In addition the driver logs the stats to syslog upon device reset.
 
+On supported instance types, the statistics will also include the
+ENA Express data (fields prefixed with `ena_srd`). For a complete
+documentation of ENA Express data refer to
+https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ena-express.html#ena-express-monitor
+
 MTU
 ===
 
drivers/net/ethernet/amazon/ena/ena_admin_defs.h +42 -0

72 lines not on this page · raw message

drivers/net/ethernet/amazon/ena/ena_com.c +21 -0
index 713a5953..3cc3830d 100644
@@ -2152,6 +2152,27 @@ int ena_com_get_eni_stats(struct ena_com_dev *ena_dev,
 	return ret;
 }
 
+int ena_com_get_ena_srd_info(struct ena_com_dev *ena_dev,
+			     struct ena_admin_ena_srd_info *info)
+{
+	struct ena_com_stats_ctx ctx;
+	int ret;
+
+	if (!ena_com_get_cap(ena_dev, ENA_ADMIN_ENA_SRD_INFO)) {
+		netdev_err(ena_dev->net_device, "Capability %d isn't supported\n",
+			   ENA_ADMIN_ENA_SRD_INFO);
+		return -EOPNOTSUPP;
+	}
+
+	memset(&ctx, 0x0, sizeof(ctx));
+	ret = ena_get_dev_stats(ena_dev, &ctx, ENA_ADMIN_GET_STATS_TYPE_ENA_SRD);
+	if (likely(ret == 0))
+		memcpy(info, &ctx.get_resp.u.ena_srd_info,
+		       sizeof(ctx.get_resp.u.ena_srd_info));
+
+	return ret;
+}
+
 int ena_com_get_dev_basic_stats(struct ena_com_dev *ena_dev,
 				struct ena_admin_basic_stats *stats)
 {
drivers/net/ethernet/amazon/ena/ena_com.h +9 -0
index 924f03f5..372066e0 100644
@@ -595,6 +595,15 @@ int ena_com_get_dev_basic_stats(struct ena_com_dev *ena_dev,
 int ena_com_get_eni_stats(struct ena_com_dev *ena_dev,
 			  struct ena_admin_eni_stats *stats);
 
+/* ena_com_get_ena_srd_info - Get ENA SRD network interface statistics
+ * @ena_dev: ENA communication layer struct
+ * @info: ena srd stats and flags
+ *
+ * @return: 0 on Success and negative value otherwise.
+ */
+int ena_com_get_ena_srd_info(struct ena_com_dev *ena_dev,
+			     struct ena_admin_ena_srd_info *info);
+
 /* ena_com_set_dev_mtu - Configure the device mtu.
  * @ena_dev: ENA communication layer struct
  * @mtu: mtu value
drivers/net/ethernet/amazon/ena/ena_ethtool.c +64 -20

151 lines not on this page · raw message

drivers/net/ethernet/amazon/ena/ena_netdev.c +0 -13
index 184b6e6c..0883c9a2 100644
@@ -2798,19 +2798,6 @@ err:
 	ena_com_delete_debug_area(adapter->ena_dev);
 }
 
-int ena_update_hw_stats(struct ena_adapter *adapter)
-{
-	int rc;
-
-	rc = ena_com_get_eni_stats(adapter->ena_dev, &adapter->eni_stats);
-	if (rc) {
-		netdev_err(adapter->netdev, "Failed to get ENI stats\n");
-		return rc;
-	}
-
-	return 0;
-}
-
 static void ena_get_stats64(struct net_device *netdev,
 			    struct rtnl_link_stats64 *stats)
 {
drivers/net/ethernet/amazon/ena/ena_netdev.h +1 -1
index d5950974..6e12ae3b 100644
@@ -373,6 +373,7 @@ struct ena_adapter {
 	struct u64_stats_sync syncp;
 	struct ena_stats_dev dev_stats;
 	struct ena_admin_eni_stats eni_stats;
+	struct ena_admin_ena_srd_info ena_srd_info;
 
 	/* last queue index that was checked for uncompleted tx packets */
 	u32 last_monitored_tx_qid;
@@ -390,7 +391,6 @@ void ena_dump_stats_to_dmesg(struct ena_adapter *adapter);
 
 void ena_dump_stats_to_buf(struct ena_adapter *adapter, u8 *buf);
 
-int ena_update_hw_stats(struct ena_adapter *adapter);
 
 int ena_update_queue_params(struct ena_adapter *adapter,
 			    u32 new_tx_size,
Signature · 1 line
2.40.1
maintainer
#2 lore raw

Re: [PATCH v1 net-next 1/2] net: ena: Add ENA Express metrics support

Documentation/networking/device_drivers/ethernet/amazon/ena.rst per-queue stats) from the device. · line 236

Quoted 4 lines · On Sun, 11 Aug 2024 13:07:10 +0300 David Arinzon wrote:
Documentation/networking/device_drivers/ethernet/amazon/ena.rst +4 -0
+On supported instance types, the statistics will also include the
+ENA Express data (fields prefixed with `ena_srd`). For a complete
+documentation of ENA Express data refer to
+https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ena-express.html#ena-express-monitor

On a quick scan I don't see anything about statistics in this link. One can probably guess the meaning of most of them from the names.

author maintainer
#3 lore raw

RE: [PATCH v1 net-next 1/2] net: ena: Add ENA Express metrics support

Quoted 10 lines · On Sun, 11 Aug 2024 13:07:10 +0300 David Arinzon wrote:

Review

Quoted 4 lines
(quoted diff) +4 -0
+On supported instance types, the statistics will also include the ENA
+Express data (fields prefixed with `ena_srd`). For a complete
+documentation of ENA Express data refer to
+https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ena-

express.html#

Quoted 1 line

+ena-express-monitor

On a quick scan I don't see anything about statistics in this link. One can probably guess the meaning of most of them from the names.

Hi Jakub,

Thanks for looking into this.
There's actually wording about this in the link (in "how ENA Express works", below the note), quoting:

After you've enabled ENA Express for the network interface attachments on both the sending instance and the receiving instance, you can use ENA Express metrics to help ensure that your instances take full advantage of the performance improvements that SRD technology provides. For more information about ENA Express metrics, see Metrics for ENA Express.

There's also a link in "see metrics for ENA Express" for further information and examples about the statistics themselves,

Thanks,
David

author maintainer
#4 lore raw

PATCH 2/2 net: ena: Extend customer metrics reporting support

In reply to David Arinzon

Customers are using ethtool in order to extract traffic allowance metrics for the interface.

The interface between the driver and the device has been upgraded to allow more flexibility and expendability. This change is required to allow the addition of a new metric - conntrack_allowance_available and additional metrics in the future.

---
 .../net/ethernet/amazon/ena/ena_admin_defs.h  |  30 ++++
 drivers/net/ethernet/amazon/ena/ena_com.c     | 154 +++++++++++++---
 drivers/net/ethernet/amazon/ena/ena_com.h     |  59 +++++++
 drivers/net/ethernet/amazon/ena/ena_ethtool.c | 164 ++++++++++++------
 drivers/net/ethernet/amazon/ena/ena_netdev.c  |  14 +-
 5 files changed, 343 insertions(+), 78 deletions(-)
drivers/net/ethernet/amazon/ena/ena_admin_defs.h +30 -0
index 74772b00..9d9fa655 100644
@@ -7,6 +7,21 @@
 
 #define ENA_ADMIN_RSS_KEY_PARTS              10
 
+#define ENA_ADMIN_CUSTOMER_METRICS_SUPPORT_MASK 0x3F
+#define ENA_ADMIN_CUSTOMER_METRICS_MIN_SUPPORT_MASK 0x1F
+
+ /* customer metrics - in correlation with
+  * ENA_ADMIN_CUSTOMER_METRICS_SUPPORT_MASK
+  */
+enum ena_admin_customer_metrics_id {
+	ENA_ADMIN_BW_IN_ALLOWANCE_EXCEEDED         = 0,
+	ENA_ADMIN_BW_OUT_ALLOWANCE_EXCEEDED        = 1,
+	ENA_ADMIN_PPS_ALLOWANCE_EXCEEDED           = 2,
+	ENA_ADMIN_CONNTRACK_ALLOWANCE_EXCEEDED     = 3,
+	ENA_ADMIN_LINKLOCAL_ALLOWANCE_EXCEEDED     = 4,
+	ENA_ADMIN_CONNTRACK_ALLOWANCE_AVAILABLE    = 5,
+};
+
 enum ena_admin_aq_opcode {
 	ENA_ADMIN_CREATE_SQ                         = 1,
 	ENA_ADMIN_DESTROY_SQ                        = 2,
@@ -53,6 +68,7 @@ enum ena_admin_aq_caps_id {
 	ENA_ADMIN_ENI_STATS                         = 0,
 	/* ENA SRD customer metrics */
 	ENA_ADMIN_ENA_SRD_INFO                      = 1,
+	ENA_ADMIN_CUSTOMER_METRICS                  = 2,
 };
 
 enum ena_admin_placement_policy_type {
@@ -103,6 +119,7 @@ enum ena_admin_get_stats_type {
 	ENA_ADMIN_GET_STATS_TYPE_ENI                = 2,
 	/* extra HW stats for ENA SRD */
 	ENA_ADMIN_GET_STATS_TYPE_ENA_SRD            = 3,
+	ENA_ADMIN_GET_STATS_TYPE_CUSTOMER_METRICS   = 4,
 };
 
 enum ena_admin_get_stats_scope {
@@ -377,6 +394,9 @@ struct ena_admin_aq_get_stats_cmd {
 	 * stats of other device
 	 */
 	u16 device_id;
+
+	/* a bitmap representing the requested metric values */
+	u64 requested_metrics;
 };
 
 /* Basic Statistics Command. */
@@ -459,6 +479,14 @@ struct ena_admin_ena_srd_info {
 	struct ena_admin_ena_srd_stats ena_srd_stats;
 };
 
+/* Customer Metrics Command. */
+struct ena_admin_customer_metrics {
+	/* A bitmap representing the reported customer metrics according to
+	 * the order they are reported
+	 */
+	u64 reported_metrics;
+};
+
 struct ena_admin_acq_get_stats_resp {
 	struct ena_admin_acq_common_desc acq_common_desc;
 
@@ -470,6 +498,8 @@ struct ena_admin_acq_get_stats_resp {
 		struct ena_admin_eni_stats eni_stats;
 
 		struct ena_admin_ena_srd_info ena_srd_info;
+
+		struct ena_admin_customer_metrics customer_metrics;
 	} u;
 };
 
drivers/net/ethernet/amazon/ena/ena_com.c +127 -27

190 lines not on this page · raw message

drivers/net/ethernet/amazon/ena/ena_com.h +59 -0

101 lines not on this page · raw message

drivers/net/ethernet/amazon/ena/ena_ethtool.c +115 -49

224 lines not on this page · raw message

drivers/net/ethernet/amazon/ena/ena_netdev.c +12 -2
index 0883c9a2..c5b50cfa 100644
@@ -3931,10 +3931,16 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	pci_set_drvdata(pdev, adapter);
 
+	rc = ena_com_allocate_customer_metrics_buffer(ena_dev);
+	if (rc) {
+		netdev_err(netdev, "ena_com_allocate_customer_metrics_buffer failed\n");
+		goto err_netdev_destroy;
+	}
+
 	rc = ena_map_llq_mem_bar(pdev, ena_dev, bars);
 	if (rc) {
 		dev_err(&pdev->dev, "ENA LLQ bar mapping failed\n");
-		goto err_netdev_destroy;
+		goto err_metrics_destroy;
 	}
 
 	rc = ena_device_init(adapter, pdev, &get_feat_ctx, &wd_state);
@@ -3942,7 +3948,7 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		dev_err(&pdev->dev, "ENA device init failed\n");
 		if (rc == -ETIME)
 			rc = -EPROBE_DEFER;
-		goto err_netdev_destroy;
+		goto err_metrics_destroy;
 	}
 
 	/* Initial TX and RX interrupt delay. Assumes 1 usec granularity.
@@ -4063,6 +4069,8 @@ err_worker_destroy:
 err_device_destroy:
 	ena_com_delete_host_info(ena_dev);
 	ena_com_admin_destroy(ena_dev);
+err_metrics_destroy:
+	ena_com_delete_customer_metrics_buffer(ena_dev);
 err_netdev_destroy:
 	free_netdev(netdev);
 err_free_region:
@@ -4126,6 +4134,8 @@ static void __ena_shutoff(struct pci_dev *pdev, bool shutdown)
 
 	ena_com_delete_host_info(ena_dev);
 
+	ena_com_delete_customer_metrics_buffer(ena_dev);
+
 	ena_release_bars(ena_dev, pdev);
 
 	pci_disable_device(pdev);
Signature · 1 line
2.40.1
maintainer
#5 lore raw

Re: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

drivers/net/ethernet/amazon/ena/ena_admin_defs.h line 22

Quoted 6 lines · On Sun, 11 Aug 2024 13:07:11 +0300 David Arinzon wrote:
drivers/net/ethernet/amazon/ena/ena_admin_defs.h +6 -0
+	ENA_ADMIN_BW_IN_ALLOWANCE_EXCEEDED         = 0,
+	ENA_ADMIN_BW_OUT_ALLOWANCE_EXCEEDED        = 1,
+	ENA_ADMIN_PPS_ALLOWANCE_EXCEEDED           = 2,
+	ENA_ADMIN_CONNTRACK_ALLOWANCE_EXCEEDED     = 3,
+	ENA_ADMIN_LINKLOCAL_ALLOWANCE_EXCEEDED     = 4,
+	ENA_ADMIN_CONNTRACK_ALLOWANCE_AVAILABLE    = 5,

We have similar stats in the standard "queue-capable" stats:

https://docs.kernel.org/next/networking/netlink_spec/netdev.html#rx-hw-drop-ratelimits-uint
https://docs.kernel.org/next/networking/netlink_spec/netdev.html#tx-hw-drop-ratelimits-uint

they were added based on the virtio stats spec. They appear to map very neatly to the first stats you have. Drivers must report the stats via a common API if one exists.

Signature · 1 line
pw-bot: cr
author maintainer
#6 lore raw

RE: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 15 lines · On Sun, 11 Aug 2024 13:07:11 +0300 David Arinzon wrote:

drivers/net/ethernet/amazon/ena/ena_admin_defs.h line 22

Quoted 6 lines
drivers/net/ethernet/amazon/ena/ena_admin_defs.h +6 -0
+     ENA_ADMIN_BW_IN_ALLOWANCE_EXCEEDED         = 0,
+     ENA_ADMIN_BW_OUT_ALLOWANCE_EXCEEDED        = 1,
+     ENA_ADMIN_PPS_ALLOWANCE_EXCEEDED           = 2,
+     ENA_ADMIN_CONNTRACK_ALLOWANCE_EXCEEDED     = 3,
+     ENA_ADMIN_LINKLOCAL_ALLOWANCE_EXCEEDED     = 4,
+     ENA_ADMIN_CONNTRACK_ALLOWANCE_AVAILABLE    = 5,

We have similar stats in the standard "queue-capable" stats:

https://docs.kernel.org/next/networking/netlink_spec/netdev.html#rx-hw-
drop-ratelimits-uint
https://docs.kernel.org/next/networking/netlink_spec/netdev.html#tx-hw-
drop-ratelimits-uint

Quoted 5 lines

they were added based on the virtio stats spec. They appear to map very neatly to the first stats you have. Drivers must report the stats via a common API if one exists.
--
pw-bot: cr

Thank you for bringing this to our attention, Jakub.

I will note that this patch modifies the infrastructure/logic in which these stats are retrieved to allow expandability and flexibility of the interface between the driver and the device (written in the commit message). The top five (0 - 4) are already part of the upstream code and the last one (5) is added in this patch.

The statistics discussed here and are exposed by ENA are not on a queue level but on an interface level, therefore, I am not sure that the ones pointed out by you would be a good fit for us.

But in any case, would it be possible from your point of view to progress in two paths, one would be this patchset with the addition of the new metric and another would be to explore whether there are such stats on an interface level that can be exposed?

Thanks,
David

maintainer
#7 lore raw

Re: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 5 lines · David

I will note that this patch modifies the infrastructure/logic in which these stats are retrieved to allow expandability and flexibility of the interface between the driver and the device (written in the commit message). The top five (0 - 4) are already part of the upstream code and the last one (5) is added in this patch.

That's not clear at all from the one sentence in the commit message. Please don't assume that the reviewers are familiar with your driver.

Quoted 3 lines

The statistics discussed here and are exposed by ENA are not on a queue level but on an interface level, therefore, I am not sure that the ones pointed out by you would be a good fit for us.

The API in question is queue-capable, but it also supports reporting the stats for the overall device, without per-queue breakdown (via the "get_base_stats" callback).

Quoted 4 lines

But in any case, would it be possible from your point of view to progress in two paths, one would be this patchset with the addition of the new metric and another would be to explore whether there are such stats on an interface level that can be exposed?

Adding a callback and filling in two stats is not a large ask. Just do it, please.

author maintainer
#8 lore raw

RE: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 17 lines
Quoted 5 lines

I will note that this patch modifies the infrastructure/logic in which these stats are retrieved to allow expandability and flexibility of the interface between the driver and the device (written in the commit message). The top five (0 - 4) are already part of the upstream code and the last one (5) is added in this patch.

That's not clear at all from the one sentence in the commit message. Please don't assume that the reviewers are familiar with your driver.

Quoted 3 lines

The statistics discussed here and are exposed by ENA are not on a queue level but on an interface level, therefore, I am not sure that the ones pointed out by you would be a good fit for us.

The API in question is queue-capable, but it also supports reporting the stats for the overall device, without per-queue breakdown (via the "get_base_stats" callback).

Quoted 7 lines
Quoted 4 lines

But in any case, would it be possible from your point of view to progress in two paths, one would be this patchset with the addition of the new metric and another would be to explore whether there are such stats on an interface level that can be exposed?

Adding a callback and filling in two stats is not a large ask. Just do it, please.

Hi Jakub,

I've looked into the definition of the metrics under question

Based on AWS documentation (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-network-performance-ena.html)

bw_in_allowance_exceeded: The number of packets queued or dropped because the inbound aggregate bandwidth exceeded the maximum for the instance.
bw_out_allowance_exceeded: The number of packets queued or dropped because the outbound aggregate bandwidth exceeded the maximum for the instance.

Based on the netlink spec (https://docs.kernel.org/next/networking/netlink_spec/netdev.html)

rx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the received packets bitrate exceeding the device rate limit. tx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the transmit packets bitrate exceeding the device rate limit.

The AWS metrics are counting for packets dropped or queued (delayed, but are sent/received with a delay), a change in these metrics is an indication to customers to check their applications and workloads due to risk of exceeding limits. There's no distinction between dropped and queued in these metrics, therefore, they do not match the ratelimits in the netlink spec.
In case there will be a separation of these metrics in the future to dropped and queued, we'll be able to add the support for hw-drop-ratelimits.

Thanks,
David

maintainer
#9 lore raw

Re: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 9 lines · David

I've looked into the definition of the metrics under question

Based on AWS documentation (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-network-performance-ena.html)

bw_in_allowance_exceeded: The number of packets queued or dropped because the inbound aggregate bandwidth exceeded the maximum for the instance.
bw_out_allowance_exceeded: The number of packets queued or dropped because the outbound aggregate bandwidth exceeded the maximum for the instance.

Based on the netlink spec (https://docs.kernel.org/next/networking/netlink_spec/netdev.html)

Quoted 8 lines

rx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the received packets bitrate exceeding the device rate limit. tx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the transmit packets bitrate exceeding the device rate limit.

The AWS metrics are counting for packets dropped or queued (delayed, but are sent/received with a delay), a change in these metrics is an indication to customers to check their applications and workloads due to risk of exceeding limits. There's no distinction between dropped and queued in these metrics, therefore, they do not match the ratelimits in the netlink spec.
In case there will be a separation of these metrics in the future to dropped and queued, we'll be able to add the support for hw-drop-ratelimits.

Xuan, Michael, the virtio spec calls out drops due to b/w limit being exceeded, but AWS people say their NICs also count packets buffered but not dropped towards a similar metric.

I presume the virtio spec is supposed to cover the same use cases. Have the stats been approved? Is it reasonable to extend the definition of the "exceeded" stats in the virtio spec to cover what AWS specifies? Looks like PR is still open:
https://github.com/oasis-tcs/virtio-spec/issues/180

author maintainer
#10 lore raw

RE: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 37 lines
Quoted 4 lines

I've looked into the definition of the metrics under question

Based on AWS documentation
(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-

networ

Quoted 3 lines

k-performance-ena.html)

bw_in_allowance_exceeded: The number of packets queued or dropped

because the inbound aggregate bandwidth exceeded the maximum for the instance.

Quoted 1 line

bw_out_allowance_exceeded: The number of packets queued or dropped

because the outbound aggregate bandwidth exceeded the maximum for the instance.

Quoted 6 lines

Based on the netlink spec
(https://docs.kernel.org/next/networking/netlink_spec/netdev.html)

rx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the received

packets bitrate exceeding the device rate limit.

Quoted 2 lines

tx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the transmit

packets bitrate exceeding the device rate limit.

Quoted 2 lines

The AWS metrics are counting for packets dropped or queued (delayed,

but are sent/received with a delay), a change in these metrics is an indication to customers to check their applications and workloads due to risk of exceeding limits.

Quoted 1 line

There's no distinction between dropped and queued in these metrics,

therefore, they do not match the ratelimits in the netlink spec.

Quoted 1 line

In case there will be a separation of these metrics in the future to dropped

and queued, we'll be able to add the support for hw-drop-ratelimits.

Xuan, Michael, the virtio spec calls out drops due to b/w limit being exceeded, but AWS people say their NICs also count packets buffered but not dropped towards a similar metric.

Quoted 5 lines

I presume the virtio spec is supposed to cover the same use cases. Have the stats been approved? Is it reasonable to extend the definition of the "exceeded" stats in the virtio spec to cover what AWS specifies? Looks like PR is still open:
https://github.com/oasis-tcs/virtio-spec/issues/180

How do we move forward with this patchset?
Regarding the counter itself, even though we don't support this at the moment, I would recommend to keep the queued and dropped as split (for example, add tx/rx-hw-queued-ratelimits, or something similar, if that makes sense).

Thanks
David

maintainer
#11 lore raw

Re: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 10 lines · David
Quoted 9 lines

Xuan, Michael, the virtio spec calls out drops due to b/w limit being exceeded, but AWS people say their NICs also count packets buffered but not dropped towards a similar metric.

I presume the virtio spec is supposed to cover the same use cases. Have the stats been approved? Is it reasonable to extend the definition of the "exceeded" stats in the virtio spec to cover what AWS specifies? Looks like PR is still open:
https://github.com/oasis-tcs/virtio-spec/issues/180

Quoted 5 lines

How do we move forward with this patchset?
Regarding the counter itself, even though we don't support this at the moment, I would recommend to keep the queued and dropped as split (for example, add tx/rx-hw-queued-ratelimits, or something similar, if that makes sense).

Could you share some background for your recommendation? As you say, the advice contradicts your own code :S Let's iron this out for virtio's benefit.

You can resend the first patch separately in the meantime.

author maintainer
#12 lore raw

RE: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 14 lines
Quoted 7 lines
Quoted 7 lines

Xuan, Michael, the virtio spec calls out drops due to b/w limit being exceeded, but AWS people say their NICs also count packets buffered but not dropped towards a similar metric.

I presume the virtio spec is supposed to cover the same use cases. Have the stats been approved? Is it reasonable to extend the definition of the "exceeded" stats in the virtio spec to cover what AWS

specifies?

Quoted 6 lines
Quoted 2 lines

Looks like PR is still open:
https://github.com/oasis-tcs/virtio-spec/issues/180

How do we move forward with this patchset?
Regarding the counter itself, even though we don't support this at the moment, I would recommend to keep the queued and dropped as split

Quoted 8 lines

(for

Quoted 2 lines

example, add tx/rx-hw-queued-ratelimits, or something similar, if that makes sense).

Could you share some background for your recommendation?
As you say, the advice contradicts your own code :S Let's iron this out for virtio's benefit.

The links I've shared before are of public AWS documentation, therefore, this is what AWS currently supports. When looking at the definition of what queued and what dropped means, having such a separation will benefit customers better as it will provide them more detailed information about the limits that they're about to exceed or are already exceeding. A queued packet will be received with a delay, while a dropped packet wouldn't arrive to the destination.
In both cases, customers need to look into their applications and network loads and see what should be changed, but when I'm looking at a case where packets are dropped, it is more dire (in some use-cases) that when packets are being delayed, which is possibly more transparent to some network loads that are not looking for cases like low latency.

Even though the ENA driver can't support it at the moment, given that the stats interface is aiming for other drivers to implement (based on their level of support), the level of granularity and separation will be more generic and more beneficial to customers. In my opinion, the suggestion to virtio is more posing a limitation based on what AWS currently supports than creating something
generic that other drivers will hopefully implement based on their NICs.

Quoted 1 line

You can resend the first patch separately in the meantime.

I prefer them to be picked up together.

author maintainer
#13 lore raw

RE: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 46 lines
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines

Xuan, Michael, the virtio spec calls out drops due to b/w limit being exceeded, but AWS people say their NICs also count packets buffered but not dropped towards a similar metric.

I presume the virtio spec is supposed to cover the same use cases. Have the stats been approved? Is it reasonable to extend the definition of the "exceeded" stats in the virtio spec to cover what AWS

specifies?

Quoted 7 lines
Quoted 2 lines

Looks like PR is still open:
https://github.com/oasis-tcs/virtio-spec/issues/180

How do we move forward with this patchset?
Regarding the counter itself, even though we don't support this at the moment, I would recommend to keep the queued and dropped as split

Quoted 8 lines

(for

Quoted 2 lines

example, add tx/rx-hw-queued-ratelimits, or something similar, if that makes sense).

Could you share some background for your recommendation? As you say, the advice contradicts your own code :S Let's iron this out for virtio's benefit.

The links I've shared before are of public AWS documentation, therefore, this is what AWS currently supports.
When looking at the definition of what queued and what dropped means, having such a separation will benefit customers better as it will provide them more detailed information about the limits that they're about to exceed or are already exceeding. A queued packet will be received with a delay, while a dropped packet wouldn't arrive to the destination.
In both cases, customers need to look into their applications and network loads and see what should be changed, but when I'm looking at a case where packets are dropped, it is more dire (in some use-cases) that when packets are being delayed, which is possibly more transparent to some network loads that are not looking for cases like low latency.

Even though the ENA driver can't support it at the moment, given that the stats interface is aiming for other drivers to implement (based on their level of support), the level of granularity and separation will be more generic and more beneficial to customers. In my opinion, the suggestion to virtio is more posing a limitation based on what AWS currently supports than creating something generic that other drivers will hopefully implement based on their NICs.

Quoted 4 lines
Quoted 1 line

You can resend the first patch separately in the meantime.

I prefer them to be picked up together.

I see that there's no feedback from Xuan or Michael.

Jakub, what are your thoughts about my suggestion?

maintainer
#14 lore raw

Re: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 3 lines · David

I see that there's no feedback from Xuan or Michael.

Jakub, what are your thoughts about my suggestion?

I suggest you stop pinging me.

#15 lore raw

Re: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 7 lines · Jakub Kicinski
Quoted 3 lines · David

I see that there's no feedback from Xuan or Michael.

Jakub, what are your thoughts about my suggestion?

I suggest you stop pinging me.

Note: my reply does not mean I like/agree with anything I saw in this patch, nor do I mind if it gets merged eventually.

Still, given that the counters in question are already exposed through ethtool (which was very unclear from the poor commit message/cover letter) it's kinda unfair to hold back a patch that changes the way the counters are queried, or adds an additional counter which so far no one objected to.

Perhaps David can show some good will and help sort out the virtio stuff, or push his team to expose counters that match the netlink semantics, but this should've been the "blocker" when they first introduced these counters, now is too late.

maintainer
#16 lore raw

Re: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 2 lines · On Tue, 27 Aug 2024 19:41:47 +0300 Gal Pressman wrote:

Perhaps David can show some good will and help sort out the virtio stuff,

Why do you say "perhaps he could". AFAICT all he did is say "they aren't replying" after I CCed them. Do I need to spell out how to engage with development community on the Internet?

#17 lore raw

Re: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 7 lines · Jakub Kicinski
Quoted 2 lines · On Tue, 27 Aug 2024 19:41:47 +0300 Gal Pressman wrote:

Perhaps David can show some good will and help sort out the virtio stuff,

Why do you say "perhaps he could". AFAICT all he did is say "they aren't replying" after I CCed them. Do I need to spell out how to engage with development community on the Internet?

My phrasing is due to the fact that I'm in no position to tell David what to do.. I just got the feeling that he didn't get your hint.

I understand your motivation, but my point is that even without him being a "good citizen" these counters are already out there, should they really block new ones?

maintainer
#18 lore raw

Re: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 10 lines · On Tue, 27 Aug 2024 21:33:55 +0300 Gal Pressman wrote:
Quoted 3 lines

Why do you say "perhaps he could". AFAICT all he did is say "they aren't replying" after I CCed them. Do I need to spell out how to engage with development community on the Internet?

My phrasing is due to the fact that I'm in no position to tell David what to do.. I just got the feeling that he didn't get your hint.

I understand your motivation, but my point is that even without him being a "good citizen" these counters are already out there, should they really block new ones?

Agreed, not great to block them.. Unfortunately it's literally the only lever we have as maintainers.

Amazon's experience and recommendation needs to be communicated to the folks working on the virtio spec. IDK if they follow the list, but there's a process for the spec, and a GH PR to which I linked.

#19 lore raw

RE: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

In reply to Jakub Kicinski
Quoted 36 lines

From: Jakub Kicinski <[email protected]>
Sent: Thursday, August 15, 2024 12:42 AM

Quoted 4 lines · David

I've looked into the definition of the metrics under question

Based on AWS documentation
(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-

networ

Quoted 3 lines

k-performance-ena.html)

bw_in_allowance_exceeded: The number of packets queued or dropped

because the inbound aggregate bandwidth exceeded the maximum for the instance.

Quoted 1 line

bw_out_allowance_exceeded: The number of packets queued or dropped

because the outbound aggregate bandwidth exceeded the maximum for the instance.

Quoted 6 lines

Based on the netlink spec
(https://docs.kernel.org/next/networking/netlink_spec/netdev.html)

rx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the received

packets bitrate exceeding the device rate limit.

Quoted 2 lines

tx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the transmit

packets bitrate exceeding the device rate limit.

Quoted 2 lines

The AWS metrics are counting for packets dropped or queued (delayed, but

are sent/received with a delay), a change in these metrics is an indication to customers to check their applications and workloads due to risk of exceeding limits.

Quoted 1 line

There's no distinction between dropped and queued in these metrics,

therefore, they do not match the ratelimits in the netlink spec.

Quoted 8 lines
Quoted 1 line

In case there will be a separation of these metrics in the future to dropped

and queued, we'll be able to add the support for hw-drop-ratelimits.

Xuan, Michael, the virtio spec calls out drops due to b/w limit being exceeded, but AWS people say their NICs also count packets buffered but not dropped towards a similar metric.

I presume the virtio spec is supposed to cover the same use cases.

On tx side, number of packets may not be queued, but may not be even DMAed if the rate has exceeded. This is hw nic implementation detail and a choice with trade-offs.

Similarly on rx, one may implement drop or queue or both (queue upto some limit, and drop beyond it).

Quoted 1 line

Have the stats been approved?

Yes. it is approved last year; I have also reviewed it; It is part of the spec nearly 10 months ago at [1]. GH PR is merged but GH is not updated yet.

[1] https://github.com/oasis-tcs/virtio-spec/commit/42f389989823039724f95bbbd243291ab0064f82

Quoted 2 lines

Is it reasonable to extend the definition of the "exceeded" stats in the virtio spec to cover what AWS specifies?

Virtio may add new stats for exceeded stats in future.
But I do not understand how AWS ENA nic is related to virtio PCI HW nic.

Should virtio implement it? may be yes. Looks useful to me.
Should it be now in virtio spec, not sure, this depends on virtio community and actual hw/sw supporting it.

Quoted 2 lines

Looks like PR is still open:
https://github.com/oasis-tcs/virtio-spec/issues/180

Spec already has it at [1] for drops. GH PR is not upto date.

author maintainer
#20 lore raw

RE: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 62 lines
Quoted 11 lines
Quoted 4 lines

I've looked into the definition of the metrics under question

Based on AWS documentation
(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-

networ

Quoted 3 lines

k-performance-ena.html)

bw_in_allowance_exceeded: The number of packets queued or dropped

because the inbound aggregate bandwidth exceeded the maximum for the instance.

Quoted 1 line

bw_out_allowance_exceeded: The number of packets queued or

dropped

Quoted 1 line

because the outbound aggregate bandwidth exceeded the maximum for

the

Quoted 21 lines

instance.

Quoted 6 lines

Based on the netlink spec
(https://docs.kernel.org/next/networking/netlink_spec/netdev.html)

rx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the received

packets bitrate exceeding the device rate limit.

Quoted 2 lines

tx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the transmit

packets bitrate exceeding the device rate limit.

Quoted 3 lines

The AWS metrics are counting for packets dropped or queued (delayed, but

are sent/received with a delay), a change in these metrics is an indication to customers to check their applications and workloads due to risk of exceeding limits.

Quoted 1 line

There's no distinction between dropped and queued in these metrics,

therefore, they do not match the ratelimits in the netlink spec.

Quoted 2 lines

In case there will be a separation of these metrics in the future to dropped

Quoted 7 lines

and queued, we'll be able to add the support for hw-drop-ratelimits.

Xuan, Michael, the virtio spec calls out drops due to b/w limit being exceeded, but AWS people say their NICs also count packets buffered but not dropped towards a similar metric.

I presume the virtio spec is supposed to cover the same use cases.

On tx side, number of packets may not be queued, but may not be even DMAed if the rate has exceeded.
This is hw nic implementation detail and a choice with trade-offs.

Similarly on rx, one may implement drop or queue or both (queue upto some limit, and drop beyond it).

Quoted 1 line

Have the stats been approved?

Yes. it is approved last year; I have also reviewed it; It is part of the spec nearly 10 months ago at [1].
GH PR is merged but GH is not updated yet.

[1] https://github.com/oasis-tcs/virtio-
spec/commit/42f389989823039724f95bbbd243291ab0064f82

Quoted 2 lines

Is it reasonable to extend the definition of the "exceeded" stats in the virtio spec to cover what AWS specifies?

Virtio may add new stats for exceeded stats in future.
But I do not understand how AWS ENA nic is related to virtio PCI HW nic.

Quoted 7 lines

Should virtio implement it? may be yes. Looks useful to me. Should it be now in virtio spec, not sure, this depends on virtio community and actual hw/sw supporting it.

Quoted 2 lines

Looks like PR is still open:
https://github.com/oasis-tcs/virtio-spec/issues/180

Spec already has it at [1] for drops. GH PR is not upto date.

Thank you for the reply, Parav.
I've raised the query and the summary of this discussion in the above mentioned github ticket.

#21 lore raw

Re: RE: [PATCH v1 net-next 2/2] net: ena: Extend customer metrics reporting support

Quoted 66 lines · David
Quoted 66 lines
Quoted 11 lines
Quoted 4 lines

I've looked into the definition of the metrics under question

Based on AWS documentation
(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-

networ

Quoted 3 lines

k-performance-ena.html)

bw_in_allowance_exceeded: The number of packets queued or dropped

because the inbound aggregate bandwidth exceeded the maximum for the instance.

Quoted 1 line

bw_out_allowance_exceeded: The number of packets queued or

dropped

Quoted 1 line

because the outbound aggregate bandwidth exceeded the maximum for

the

Quoted 21 lines

instance.

Quoted 6 lines

Based on the netlink spec
(https://docs.kernel.org/next/networking/netlink_spec/netdev.html)

rx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the received

packets bitrate exceeding the device rate limit.

Quoted 2 lines

tx-hw-drop-ratelimits (uint)
doc: Number of the packets dropped by the device due to the transmit

packets bitrate exceeding the device rate limit.

Quoted 3 lines

The AWS metrics are counting for packets dropped or queued (delayed, but

are sent/received with a delay), a change in these metrics is an indication to customers to check their applications and workloads due to risk of exceeding limits.

Quoted 1 line

There's no distinction between dropped and queued in these metrics,

therefore, they do not match the ratelimits in the netlink spec.

Quoted 2 lines

In case there will be a separation of these metrics in the future to dropped

Quoted 7 lines

and queued, we'll be able to add the support for hw-drop-ratelimits.

Xuan, Michael, the virtio spec calls out drops due to b/w limit being exceeded, but AWS people say their NICs also count packets buffered but not dropped towards a similar metric.

I presume the virtio spec is supposed to cover the same use cases.

On tx side, number of packets may not be queued, but may not be even DMAed if the rate has exceeded.
This is hw nic implementation detail and a choice with trade-offs.

Similarly on rx, one may implement drop or queue or both (queue upto some limit, and drop beyond it).

Quoted 1 line

Have the stats been approved?

Yes. it is approved last year; I have also reviewed it; It is part of the spec nearly 10 months ago at [1].
GH PR is merged but GH is not updated yet.

[1] https://github.com/oasis-tcs/virtio-
spec/commit/42f389989823039724f95bbbd243291ab0064f82

Quoted 2 lines

Is it reasonable to extend the definition of the "exceeded" stats in the virtio spec to cover what AWS specifies?

Virtio may add new stats for exceeded stats in future.
But I do not understand how AWS ENA nic is related to virtio PCI HW nic.

Should virtio implement it? may be yes. Looks useful to me. Should it be now in virtio spec, not sure, this depends on virtio community and actual hw/sw supporting it.

Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

Looks like PR is still open:
https://github.com/oasis-tcs/virtio-spec/issues/180

Spec already has it at [1] for drops. GH PR is not upto date.

Thank you for the reply, Parav.
I've raised the query and the summary of this discussion in the above mentioned github ticket.

I saw your reply on github.

So what is the question?

Now the stats are rx/tx_hw_drop_ratelimits, so I think these stats should only count the number of dropped packets.

Yes, I also think the stats of queue packets are good. But that may be new stats in the next version of the virtio spec or with new virtio feature.

But for the user, I thinks these are important. For me, I think nic should provide all these stats.

Thanks.