From owner-svn-src-head@FreeBSD.ORG Sat Dec 1 01:24:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F137DE98; Sat, 1 Dec 2012 01:24:40 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4BB48FC14; Sat, 1 Dec 2012 01:24:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB11OeJA096414; Sat, 1 Dec 2012 01:24:40 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB11OefS096413; Sat, 1 Dec 2012 01:24:40 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201212010124.qB11OefS096413@svn.freebsd.org> From: Jack F Vogel Date: Sat, 1 Dec 2012 01:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243741 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 01:24:41 -0000 Author: jfv Date: Sat Dec 1 01:24:40 2012 New Revision: 243741 URL: http://svnweb.freebsd.org/changeset/base/243741 Log: Patch #12 OK, I said there was only 11 patches, but unfortunately the revamped sysctl code did not work, and needed a change. This makes the limit get set at the time that all sysctl stats are created and is actually more elegant imho anyway. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 01:16:40 2012 (r243740) +++ head/sys/dev/ixgbe/ixgbe.c Sat Dec 1 01:24:40 2012 (r243741) @@ -163,8 +163,6 @@ static int ixgbe_set_thermal_test(SYSCTL static int ixgbe_dma_malloc(struct adapter *, bus_size_t, struct ixgbe_dma_alloc *, int); static void ixgbe_dma_free(struct adapter *, struct ixgbe_dma_alloc *); -static void ixgbe_add_process_limit(struct adapter *, const char *, - const char *, u16 *, u16); static int ixgbe_tx_ctx_setup(struct tx_ring *, struct mbuf *, u32 *, u32 *); static int ixgbe_tso_setup(struct tx_ring *, @@ -3070,11 +3068,6 @@ ixgbe_initialize_transmit_units(struct a u64 tdba = txr->txdma.dma_paddr; u32 txctrl; - /* Sysctl for limiting work done in tx clean */ - ixgbe_add_process_limit(adapter, "tx_processing_limit", - "max number of packets to process", &txr->process_limit, - ixgbe_tx_process_limit); - IXGBE_WRITE_REG(hw, IXGBE_TDBAL(i), (tdba & 0x00000000ffffffffULL)); IXGBE_WRITE_REG(hw, IXGBE_TDBAH(i), (tdba >> 32)); @@ -4119,11 +4112,6 @@ ixgbe_initialize_receive_units(struct ad for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; - /* Sysctl for limiting work done in rx clean */ - ixgbe_add_process_limit(adapter, "rx_processing_limit", - "max number of packets to process", &rxr->process_limit, - ixgbe_rx_process_limit); - /* Setup the Base and Length of the Rx Descriptor Ring */ IXGBE_WRITE_REG(hw, IXGBE_RDBAL(i), (rdba & 0x00000000ffffffffULL)); @@ -5185,6 +5173,23 @@ ixgbe_sysctl_tdt_handler(SYSCTL_HANDLER_ return 0; } +/** ixgbe_sysctl_tx_process_limit - Handler function + * Set the limit value for TX processing + */ +static int +ixgbe_sysctl_tx_process_limit(SYSCTL_HANDLER_ARGS) +{ + int error; + + struct tx_ring *txr = ((struct tx_ring *)oidp->oid_arg1); + if (!txr) return 0; + + error = sysctl_handle_int(oidp, &ixgbe_tx_process_limit, 0, req); + if (error || !req->newptr) + return error; + return 0; +} + /** ixgbe_sysctl_rdh_handler - Handler function * Retrieves the RDH value from the hardware */ @@ -5221,6 +5226,23 @@ ixgbe_sysctl_rdt_handler(SYSCTL_HANDLER_ return 0; } +/** ixgbe_sysctl_rx_process_limit - Handler function + * Set the limit value for RX processing + */ +static int +ixgbe_sysctl_rx_process_limit(SYSCTL_HANDLER_ARGS) +{ + int error; + + struct rx_ring *rxr = ((struct rx_ring *)oidp->oid_arg1); + if (!rxr) return 0; + + error = sysctl_handle_int(oidp, &ixgbe_rx_process_limit, 0, req); + if (error || !req->newptr) + return error; + return 0; +} + static int ixgbe_sysctl_interrupt_rate_handler(SYSCTL_HANDLER_ARGS) { @@ -5308,6 +5330,10 @@ ixgbe_add_hw_stats(struct adapter *adapt CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), ixgbe_sysctl_tdt_handler, "IU", "Transmit Descriptor Tail"); + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "tx_process_limit", + CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), + ixgbe_sysctl_tx_process_limit, "IU", + "Transmit Process Limit"); SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tso_tx", CTLFLAG_RD, &txr->tso_tx, "TSO"); @@ -5343,6 +5369,10 @@ ixgbe_add_hw_stats(struct adapter *adapt CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), ixgbe_sysctl_rdt_handler, "IU", "Receive Descriptor Tail"); + SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rx_process_limit", + CTLTYPE_UINT | CTLFLAG_RD, rxr, sizeof(rxr), + ixgbe_sysctl_rx_process_limit, "IU", + "Receive Process Limit"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "rx_packets", CTLFLAG_RD, &rxr->rx_packets, "Queue Packets Received"); @@ -5543,16 +5573,6 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) return error; } -static void -ixgbe_add_process_limit(struct adapter *adapter, const char *name, - const char *description, u16 *limit, u16 value) -{ - *limit = value; - SYSCTL_ADD_UINT(device_get_sysctl_ctx(adapter->dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), - OID_AUTO, name, CTLTYPE_UINT|CTLFLAG_RW, limit, value, description); -} - /* ** Control link advertise speed: ** 1 - advertise only 1G