Module Name: src Committed By: msaitoh Date: Wed May 23 04:37:13 UTC 2018
Modified Files: src/sys/dev/pci/ixgbe: ixgbe.c ixv.c Log Message: Add rxd_nxck (Receive Descriptor next to check) read only sysctl. To generate a diff of this commit: cvs rdiff -u -r1.153 -r1.154 src/sys/dev/pci/ixgbe/ixgbe.c cvs rdiff -u -r1.98 -r1.99 src/sys/dev/pci/ixgbe/ixv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.153 src/sys/dev/pci/ixgbe/ixgbe.c:1.154 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.153 Fri May 18 10:09:02 2018 +++ src/sys/dev/pci/ixgbe/ixgbe.c Wed May 23 04:37:13 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.c,v 1.153 2018/05/18 10:09:02 msaitoh Exp $ */ +/* $NetBSD: ixgbe.c,v 1.154 2018/05/23 04:37:13 msaitoh Exp $ */ /****************************************************************************** @@ -236,6 +236,7 @@ static int ixgbe_sysctl_phy_overtemp_occ static int ixgbe_sysctl_power_state(SYSCTLFN_PROTO); static int ixgbe_sysctl_print_rss_config(SYSCTLFN_PROTO); #endif +static int ixgbe_sysctl_next_to_check_handler(SYSCTLFN_PROTO); static int ixgbe_sysctl_rdh_handler(SYSCTLFN_PROTO); static int ixgbe_sysctl_rdt_handler(SYSCTLFN_PROTO); static int ixgbe_sysctl_tdt_handler(SYSCTLFN_PROTO); @@ -1817,6 +1818,14 @@ ixgbe_add_hw_stats(struct adapter *adapt if (sysctl_createv(log, 0, &rnode, &cnode, CTLFLAG_READONLY, CTLTYPE_INT, + "rxd_nxck", SYSCTL_DESCR("Receive Descriptor next to check"), + ixgbe_sysctl_next_to_check_handler, 0, (void *)rxr, 0, + CTL_CREATE, CTL_EOL) != 0) + break; + + if (sysctl_createv(log, 0, &rnode, &cnode, + CTLFLAG_READONLY, + CTLTYPE_INT, "rxd_head", SYSCTL_DESCR("Receive Descriptor Head"), ixgbe_sysctl_rdh_handler, 0, (void *)rxr, 0, CTL_CREATE, CTL_EOL) != 0) @@ -2179,6 +2188,27 @@ ixgbe_sysctl_tdt_handler(SYSCTLFN_ARGS) } /* ixgbe_sysctl_tdt_handler */ /************************************************************************ + * ixgbe_sysctl_next_to_check_handler - Receive Descriptor next to check + * handler function + * + * Retrieves the next_to_check value + ************************************************************************/ +static int +ixgbe_sysctl_next_to_check_handler(SYSCTLFN_ARGS) +{ + struct sysctlnode node = *rnode; + struct rx_ring *rxr = (struct rx_ring *)node.sysctl_data; + uint32_t val; + + if (!rxr) + return (0); + + val = rxr->next_to_check; + node.sysctl_data = &val; + return sysctl_lookup(SYSCTLFN_CALL(&node)); +} /* ixgbe_sysctl_next_to_check_handler */ + +/************************************************************************ * ixgbe_sysctl_rdh_handler - Receive Descriptor Head handler function * * Retrieves the RDH value from the hardware Index: src/sys/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.98 src/sys/dev/pci/ixgbe/ixv.c:1.99 --- src/sys/dev/pci/ixgbe/ixv.c:1.98 Fri May 18 10:09:02 2018 +++ src/sys/dev/pci/ixgbe/ixv.c Wed May 23 04:37:13 2018 @@ -1,4 +1,4 @@ -/*$NetBSD: ixv.c,v 1.98 2018/05/18 10:09:02 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.99 2018/05/23 04:37:13 msaitoh Exp $*/ /****************************************************************************** @@ -136,6 +136,7 @@ static void ixv_add_stats_sysctls(struct static void ixv_set_sysctl_value(struct adapter *, const char *, const char *, int *, int); static int ixv_sysctl_interrupt_rate_handler(SYSCTLFN_PROTO); +static int ixv_sysctl_next_to_check_handler(SYSCTLFN_PROTO); static int ixv_sysctl_rdh_handler(SYSCTLFN_PROTO); static int ixv_sysctl_rdt_handler(SYSCTLFN_PROTO); static int ixv_sysctl_tdt_handler(SYSCTLFN_PROTO); @@ -1878,6 +1879,27 @@ ixv_sysctl_tdt_handler(SYSCTLFN_ARGS) } /* ixv_sysctl_tdt_handler */ /************************************************************************ + * ixv_sysctl_next_to_check_handler - Receive Descriptor next to check + * handler function + * + * Retrieves the next_to_check value + ************************************************************************/ +static int +ixv_sysctl_next_to_check_handler(SYSCTLFN_ARGS) +{ + struct sysctlnode node = *rnode; + struct rx_ring *rxr = (struct rx_ring *)node.sysctl_data; + uint32_t val; + + if (!rxr) + return (0); + + val = rxr->next_to_check; + node.sysctl_data = &val; + return sysctl_lookup(SYSCTLFN_CALL(&node)); +} /* ixv_sysctl_next_to_check_handler */ + +/************************************************************************ * ixv_sysctl_rdh_handler - Receive Descriptor Head handler function * * Retrieves the RDH value from the hardware @@ -2450,6 +2472,14 @@ ixv_add_stats_sysctls(struct adapter *ad if (sysctl_createv(log, 0, &rnode, &cnode, CTLFLAG_READONLY, CTLTYPE_INT, + "rxd_nxck", SYSCTL_DESCR("Receive Descriptor next to check"), + ixv_sysctl_next_to_check_handler, 0, (void *)rxr, 0, + CTL_CREATE, CTL_EOL) != 0) + break; + + if (sysctl_createv(log, 0, &rnode, &cnode, + CTLFLAG_READONLY, + CTLTYPE_INT, "rxd_head", SYSCTL_DESCR("Receive Descriptor Head"), ixv_sysctl_rdh_handler, 0, (void *)rxr, 0, CTL_CREATE, CTL_EOL) != 0)