aboutsummaryrefslogtreecommitdiffstats
path: root/sys/dev/ixl/ixl.h
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2014-09-27 20:54:57 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2014-09-27 20:54:57 +0000
commit4b443922e0d44014207ebc72ef5a16081d0c4fef (patch)
tree729338e838705b1192a679659083bf59b847f73a /sys/dev/ixl/ixl.h
parent08c95c53d791b5d977ab6ff47c1582a0cc823308 (diff)
downloadsrc-4b443922e0d44014207ebc72ef5a16081d0c4fef.tar.gz
src-4b443922e0d44014207ebc72ef5a16081d0c4fef.zip
Convert driver to if_get_counter method.
Submitted by: rstone Reviewed by: Eric Joyner <ricera10 gmail.com>
Notes
Notes: svn path=/head/; revision=272227
Diffstat (limited to 'sys/dev/ixl/ixl.h')
-rw-r--r--sys/dev/ixl/ixl.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/sys/dev/ixl/ixl.h b/sys/dev/ixl/ixl.h
index 69be0085f07b..c240b026e355 100644
--- a/sys/dev/ixl/ixl.h
+++ b/sys/dev/ixl/ixl.h
@@ -264,6 +264,35 @@
#define IXL_RX_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx)
#define IXL_RX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx)
+#if __FreeBSD_version >= 1100000
+#define IXL_SET_IPACKETS(vsi, count) (vsi)->ipackets = (count)
+#define IXL_SET_IERRORS(vsi, count) (vsi)->ierrors = (count)
+#define IXL_SET_OPACKETS(vsi, count) (vsi)->opackets = (count)
+#define IXL_SET_OERRORS(vsi, count) (vsi)->oerrors = (count)
+#define IXL_SET_COLLISIONS(vsi, count) /* Do nothing; collisions is always 0. */
+#define IXL_SET_IBYTES(vsi, count) (vsi)->ibytes = (count)
+#define IXL_SET_OBYTES(vsi, count) (vsi)->obytes = (count)
+#define IXL_SET_IMCASTS(vsi, count) (vsi)->imcasts = (count)
+#define IXL_SET_OMCASTS(vsi, count) (vsi)->omcasts = (count)
+#define IXL_SET_IQDROPS(vsi, count) (vsi)->iqdrops = (count)
+#define IXL_SET_OQDROPS(vsi, count) (vsi)->iqdrops = (count)
+#define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count)
+#else
+#define IXL_SET_IPACKETS(vsi, count) (vsi)->ifp->if_ipackets = (count)
+#define IXL_SET_IERRORS(vsi, count) (vsi)->ifp->if_ierrors = (count)
+#define IXL_SET_OPACKETS(vsi, count) (vsi)->ifp->if_opackets = (count)
+#define IXL_SET_OERRORS(vsi, count) (vsi)->ifp->if_oerrors = (count)
+#define IXL_SET_COLLISIONS(vsi, count) (vsi)->ifp->if_collisions = (count)
+#define IXL_SET_IBYTES(vsi, count) (vsi)->ifp->if_ibytes = (count)
+#define IXL_SET_OBYTES(vsi, count) (vsi)->ifp->if_obytes = (count)
+#define IXL_SET_IMCASTS(vsi, count) (vsi)->ifp->if_imcasts = (count)
+#define IXL_SET_OMCASTS(vsi, count) (vsi)->ifp->if_omcasts = (count)
+#define IXL_SET_IQDROPS(vsi, count) (vsi)->ifp->if_iqdrops = (count)
+#define IXL_SET_OQDROPS(vsi, odrops) (vsi)->ifp->if_snd.ifq_drops = (odrops)
+#define IXL_SET_NOPROTO(vsi, count) (vsi)->noproto = (count)
+#endif
+
+
/*
*****************************************************************************
* vendor_info_array
@@ -447,6 +476,17 @@ struct ixl_vsi {
struct i40e_eth_stats eth_stats;
struct i40e_eth_stats eth_stats_offsets;
bool stat_offsets_loaded;
+ u64 ipackets;
+ u64 ierrors;
+ u64 opackets;
+ u64 oerrors;
+ u64 ibytes;
+ u64 obytes;
+ u64 imcasts;
+ u64 omcasts;
+ u64 iqdrops;
+ u64 oqdrops;
+ u64 noproto;
/* Driver statistics */
u64 hw_filters_del;
@@ -554,5 +594,8 @@ void ixl_free_que_rx(struct ixl_queue *);
#ifdef IXL_FDIR
void ixl_atr(struct ixl_queue *, struct tcphdr *, int);
#endif
+#if __FreeBSD_version >= 1100000
+uint64_t ixl_get_counter(if_t ifp, ift_counter cnt);
+#endif
#endif /* _IXL_H_ */