svn commit: r331340 - head/sys/dev/cxgbe
Navdeep Parhar
np at FreeBSD.org
Thu Mar 22 02:04:58 UTC 2018
Author: np
Date: Thu Mar 22 02:04:57 2018
New Revision: 331340
URL: https://svnweb.freebsd.org/changeset/base/331340
Log:
cxgbe(4): Tunnel congestion drops on a port should be cleared when the
stats for that port are cleared.
MFC after: 1 week
Sponsored by: Chelsio Communications
Modified:
head/sys/dev/cxgbe/t4_main.c
Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c Thu Mar 22 01:00:55 2018 (r331339)
+++ head/sys/dev/cxgbe/t4_main.c Thu Mar 22 02:04:57 2018 (r331340)
@@ -9650,7 +9650,7 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t
rc = read_i2c(sc, (struct t4_i2c_data *)data);
break;
case CHELSIO_T4_CLEAR_STATS: {
- int i, v;
+ int i, v, bg_map;
u_int port_id = *(uint32_t *)data;
struct port_info *pi;
struct vi_info *vi;
@@ -9664,10 +9664,19 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t
/* MAC stats */
t4_clr_port_stats(sc, pi->tx_chan);
pi->tx_parse_error = 0;
+ pi->tnl_cong_drops = 0;
mtx_lock(&sc->reg_lock);
for_each_vi(pi, v, vi) {
if (vi->flags & VI_INIT_DONE)
t4_clr_vi_stats(sc, vi->viid);
+ }
+ bg_map = pi->mps_bg_map;
+ v = 0; /* reuse */
+ while (bg_map) {
+ i = ffs(bg_map) - 1;
+ t4_write_indirect(sc, A_TP_MIB_INDEX, A_TP_MIB_DATA, &v,
+ 1, A_TP_MIB_TNL_CNG_DROP_0 + i);
+ bg_map &= ~(1 << i);
}
mtx_unlock(&sc->reg_lock);
More information about the svn-src-head
mailing list