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");
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to