From owner-svn-src-head@FreeBSD.ORG Mon Dec 3 21:38:02 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 D5541B26; Mon, 3 Dec 2012 21:38:02 +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 B9B608FC08; Mon, 3 Dec 2012 21:38:02 +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 qB3Lc2OW053280; Mon, 3 Dec 2012 21:38:02 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB3Lc2Jq053279; Mon, 3 Dec 2012 21:38:02 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201212032138.qB3Lc2Jq053279@svn.freebsd.org> From: Jack F Vogel Date: Mon, 3 Dec 2012 21:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243833 - 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: Mon, 03 Dec 2012 21:38:03 -0000 Author: jfv Date: Mon Dec 3 21:38:02 2012 New Revision: 243833 URL: http://svnweb.freebsd.org/changeset/base/243833 Log: Remove the sysctl process_limit interface, after some thought I've decided its overkill,a simple tuneable for each RX and TX limit, and then init sets the ring values based on that, should be sufficient. More importantly, fix a bug causing a panic, when changing the define style to IXGBE_LEGACY_TX a taskqueue init was inadvertently set #ifdef when it should be #ifndef. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Dec 3 19:55:00 2012 (r243832) +++ head/sys/dev/ixgbe/ixgbe.c Mon Dec 3 21:38:02 2012 (r243833) @@ -2329,7 +2329,7 @@ ixgbe_allocate_msix(struct adapter *adap if (adapter->num_queues > 1) bus_bind_intr(dev, que->res, i); -#ifdef IXGBE_LEGACY_TX +#ifndef IXGBE_LEGACY_TX TASK_INIT(&txr->txq_task, 0, ixgbe_deferred_mq_start, txr); #endif TASK_INIT(&que->que_task, 0, ixgbe_handle_que, que); @@ -3082,6 +3082,9 @@ ixgbe_initialize_transmit_units(struct a txr->txd_cmd = IXGBE_TXD_CMD_IFCS; txr->queue_status = IXGBE_QUEUE_IDLE; + /* Set the processing limit */ + txr->process_limit = ixgbe_tx_process_limit; + /* Disable Head Writeback */ switch (hw->mac.type) { case ixgbe_mac_82598EB: @@ -4130,6 +4133,9 @@ ixgbe_initialize_receive_units(struct ad /* Setup the HW Rx Head and Tail Descriptor Pointers */ IXGBE_WRITE_REG(hw, IXGBE_RDH(i), 0); IXGBE_WRITE_REG(hw, IXGBE_RDT(i), 0); + + /* Set the processing limit */ + rxr->process_limit = ixgbe_rx_process_limit; } if (adapter->hw.mac.type != ixgbe_mac_82598EB) { @@ -5173,23 +5179,6 @@ 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 */ @@ -5226,23 +5215,6 @@ 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) { @@ -5330,10 +5302,6 @@ 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"); @@ -5369,10 +5337,6 @@ 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");