hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/ethernet/qlogic/qede/qede_ethtool.c
....@@ -426,6 +426,8 @@
426426 }
427427 }
428428
429
+ spin_lock(&edev->stats_lock);
430
+
429431 for (i = 0; i < QEDE_NUM_STATS; i++) {
430432 if (qede_is_irrelevant_stat(edev, i))
431433 continue;
....@@ -434,6 +436,8 @@
434436
435437 buf++;
436438 }
439
+
440
+ spin_unlock(&edev->stats_lock);
437441
438442 __qede_unlock(edev);
439443 }
....@@ -815,6 +819,7 @@
815819
816820 coal->rx_coalesce_usecs = rx_coal;
817821 coal->tx_coalesce_usecs = tx_coal;
822
+ coal->stats_block_coalesce_usecs = edev->stats_coal_usecs;
818823
819824 return rc;
820825 }
....@@ -826,6 +831,19 @@
826831 struct qede_fastpath *fp;
827832 int i, rc = 0;
828833 u16 rxc, txc;
834
+
835
+ if (edev->stats_coal_usecs != coal->stats_block_coalesce_usecs) {
836
+ edev->stats_coal_usecs = coal->stats_block_coalesce_usecs;
837
+ if (edev->stats_coal_usecs) {
838
+ edev->stats_coal_ticks = usecs_to_jiffies(edev->stats_coal_usecs);
839
+ schedule_delayed_work(&edev->periodic_task, 0);
840
+
841
+ DP_INFO(edev, "Configured stats coal ticks=%lu jiffies\n",
842
+ edev->stats_coal_ticks);
843
+ } else {
844
+ cancel_delayed_work_sync(&edev->periodic_task);
845
+ }
846
+ }
829847
830848 if (!netif_running(dev)) {
831849 DP_INFO(edev, "Interface is down\n");
....@@ -2106,7 +2124,8 @@
21062124 }
21072125
21082126 static const struct ethtool_ops qede_ethtool_ops = {
2109
- .supported_coalesce_params = ETHTOOL_COALESCE_USECS,
2127
+ .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
2128
+ ETHTOOL_COALESCE_STATS_BLOCK_USECS,
21102129 .get_link_ksettings = qede_get_link_ksettings,
21112130 .set_link_ksettings = qede_set_link_ksettings,
21122131 .get_drvinfo = qede_get_drvinfo,
....@@ -2155,7 +2174,8 @@
21552174 };
21562175
21572176 static const struct ethtool_ops qede_vf_ethtool_ops = {
2158
- .supported_coalesce_params = ETHTOOL_COALESCE_USECS,
2177
+ .supported_coalesce_params = ETHTOOL_COALESCE_USECS |
2178
+ ETHTOOL_COALESCE_STATS_BLOCK_USECS,
21592179 .get_link_ksettings = qede_get_link_ksettings,
21602180 .get_drvinfo = qede_get_drvinfo,
21612181 .get_msglevel = qede_get_msglevel,