Date: Wed, 10 Oct 2012 19:27:40 +0000 (UTC) From: Navdeep Parhar <np@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241409 - head/sys/dev/cxgbe Message-ID: <201210101927.q9AJRer9086312@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: np Date: Wed Oct 10 19:27:40 2012 New Revision: 241409 URL: http://svn.freebsd.org/changeset/base/241409 Log: Add a driver ioctl to clear a port's MAC statistics. Submitted by: gnn@ MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_ioctl.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_ioctl.h ============================================================================== --- head/sys/dev/cxgbe/t4_ioctl.h Wed Oct 10 19:08:46 2012 (r241408) +++ head/sys/dev/cxgbe/t4_ioctl.h Wed Oct 10 19:27:40 2012 (r241409) @@ -50,6 +50,7 @@ enum { T4_LOAD_FW, /* flash firmware */ T4_GET_MEM, /* read memory */ T4_GET_I2C, /* read from i2c addressible device */ + T4_CLEAR_STATS, /* clear a port's MAC statistics */ }; struct t4_reg { @@ -234,4 +235,5 @@ struct t4_mem_range { #define CHELSIO_T4_LOAD_FW _IOW('f', T4_LOAD_FW, struct t4_data) #define CHELSIO_T4_GET_MEM _IOW('f', T4_GET_MEM, struct t4_mem_range) #define CHELSIO_T4_GET_I2C _IOWR('f', T4_GET_I2C, struct t4_i2c_data) +#define CHELSIO_T4_CLEAR_STATS _IOW('f', T4_CLEAR_STATS, uint32_t) #endif Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Oct 10 19:08:46 2012 (r241408) +++ head/sys/dev/cxgbe/t4_main.c Wed Oct 10 19:27:40 2012 (r241409) @@ -5400,6 +5400,15 @@ t4_ioctl(struct cdev *dev, unsigned long rc = read_i2c(sc, (struct t4_i2c_data *)data); ADAPTER_UNLOCK(sc); break; + case CHELSIO_T4_CLEAR_STATS: { + u_int port_id = *(uint32_t *)data; + + if (port_id >= sc->params.nports) + return (EINVAL); + + t4_clr_port_stats(sc, port_id); + break; + } default: rc = EINVAL; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210101927.q9AJRer9086312>