From 90fb1fd9c01fbb2f44af75c63adb65d721da88ff Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Thu, 21 Sep 2017 11:34:38 +0200 Subject: Imported Upstream version 17.05.2 Change-Id: I562c7c338dad65639f764aea8b598ff6711acd54 Signed-off-by: Christian Ehrhardt --- drivers/net/sfc/sfc_port.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'drivers/net/sfc') diff --git a/drivers/net/sfc/sfc_port.c b/drivers/net/sfc/sfc_port.c index ee96bcde..87affc95 100644 --- a/drivers/net/sfc/sfc_port.c +++ b/drivers/net/sfc/sfc_port.c @@ -242,6 +242,18 @@ sfc_port_start(struct sfc_adapter *sa) } } + if ((port->mac_stats_update_period_ms != 0) && + port->mac_stats_periodic_dma_supported) { + /* + * Request an explicit MAC stats upload immediately to + * preclude bogus figures readback if the user decides + * to read stats before periodic DMA is really started + */ + rc = efx_mac_stats_upload(sa->nic, &port->mac_stats_dma_mem); + if (rc != 0) + goto fail_mac_stats_upload; + } + sfc_log_init(sa, "disable MAC drain"); rc = efx_mac_drain(sa->nic, B_FALSE); if (rc != 0) @@ -262,6 +274,7 @@ fail_mac_drain: (void)efx_mac_stats_periodic(sa->nic, &port->mac_stats_dma_mem, 0, B_FALSE); +fail_mac_stats_upload: fail_mac_stats_periodic: fail_mcast_address_list_set: fail_mac_filter_set: -- cgit 1.2.3-korg