diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ixgbe/if_ix.c | 27 | ||||
-rw-r--r-- | sys/dev/ixgbe/if_ixv.c | 26 | ||||
-rw-r--r-- | sys/dev/ixgbe/ix_txrx.c | 6 | ||||
-rw-r--r-- | sys/dev/ixgbe/ixgbe.h | 4 |
4 files changed, 47 insertions, 16 deletions
diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index c2bf573..ac5f93d 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -163,6 +163,8 @@ static void ixgbe_add_device_sysctls(struct adapter *); static void ixgbe_add_hw_stats(struct adapter *); /* Sysctl handlers */ +static void ixgbe_set_sysctl_value(struct adapter *, const char *, + const char *, int *, int); static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS); static int ixgbe_set_advertise(SYSCTL_HANDLER_ARGS); static int ixgbe_sysctl_thermal_test(SYSCTL_HANDLER_ARGS); @@ -436,6 +438,15 @@ ixgbe_attach(device_t dev) goto err_out; } + /* Sysctls for limiting the amount of work done in the taskqueues */ + ixgbe_set_sysctl_value(adapter, "rx_processing_limit", + "max number of rx packets to process", + &adapter->rx_process_limit, ixgbe_rx_process_limit); + + ixgbe_set_sysctl_value(adapter, "tx_processing_limit", + "max number of tx packets to process", + &adapter->tx_process_limit, ixgbe_tx_process_limit); + /* Do descriptor calc and sanity checks */ if (((ixgbe_txd * sizeof(union ixgbe_adv_tx_desc)) % DBA_ALIGN) != 0 || ixgbe_txd < MIN_TXD || ixgbe_txd > MAX_TXD) { @@ -2695,9 +2706,6 @@ ixgbe_initialize_transmit_units(struct adapter *adapter) /* Cache the tail address */ txr->tail = IXGBE_TDT(txr->me); - /* Set the processing limit */ - txr->process_limit = ixgbe_tx_process_limit; - /* Disable Head Writeback */ switch (hw->mac.type) { case ixgbe_mac_82598EB: @@ -2907,9 +2915,6 @@ ixgbe_initialize_receive_units(struct adapter *adapter) 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; - /* Set the driver rx tail address */ rxr->tail = IXGBE_RDT(rxr->me); } @@ -4219,6 +4224,16 @@ ixgbe_add_hw_stats(struct adapter *adapter) "1024-1522 byte frames transmitted"); } +static void +ixgbe_set_sysctl_value(struct adapter *adapter, const char *name, + const char *description, int *limit, int value) +{ + *limit = value; + SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), + OID_AUTO, name, CTLFLAG_RW, limit, value, description); +} + /* ** Set flow control using sysctl: ** Flow control values: diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index a550a85..bd6b0ed 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -115,6 +115,8 @@ static void ixv_save_stats(struct adapter *); static void ixv_init_stats(struct adapter *); static void ixv_update_stats(struct adapter *); static void ixv_add_stats_sysctls(struct adapter *); +static void ixv_set_sysctl_value(struct adapter *, const char *, + const char *, int *, int); /* The MSI/X Interrupt handlers */ static void ixv_msix_que(void *); @@ -301,6 +303,15 @@ ixv_attach(device_t dev) goto err_out; } + /* Sysctls for limiting the amount of work done in the taskqueues */ + ixv_set_sysctl_value(adapter, "rx_processing_limit", + "max number of rx packets to process", + &adapter->rx_process_limit, ixv_rx_process_limit); + + ixv_set_sysctl_value(adapter, "tx_processing_limit", + "max number of tx packets to process", + &adapter->tx_process_limit, ixv_tx_process_limit); + /* Do descriptor calc and sanity checks */ if (((ixv_txd * sizeof(union ixgbe_adv_tx_desc)) % DBA_ALIGN) != 0 || ixv_txd < MIN_TXD || ixv_txd > MAX_TXD) { @@ -1555,9 +1566,6 @@ ixv_initialize_transmit_units(struct adapter *adapter) /* Set Tx Tail register */ txr->tail = IXGBE_VFTDT(i); - /* Set the processing limit */ - txr->process_limit = ixv_tx_process_limit; - /* Set Ring parameters */ IXGBE_WRITE_REG(hw, IXGBE_VFTDBAL(i), (tdba & 0x00000000ffffffffULL)); @@ -1637,8 +1645,6 @@ ixv_initialize_receive_units(struct adapter *adapter) IXGBE_WRITE_REG(hw, IXGBE_VFRDH(rxr->me), 0); IXGBE_WRITE_REG(hw, IXGBE_VFRDT(rxr->me), adapter->num_rx_desc - 1); - /* Set the processing limit */ - rxr->process_limit = ixv_rx_process_limit; /* Set Rx Tail register */ rxr->tail = IXGBE_VFRDT(rxr->me); @@ -2041,6 +2047,16 @@ ixv_add_stats_sysctls(struct adapter *adapter) "# of times not enough descriptors were available during TX"); } +static void +ixv_set_sysctl_value(struct adapter *adapter, const char *name, + const char *description, int *limit, int value) +{ + *limit = value; + SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), + OID_AUTO, name, CTLFLAG_RW, limit, value, description); +} + /********************************************************************** * * This routine is called only when em_display_debug_stats is enabled. diff --git a/sys/dev/ixgbe/ix_txrx.c b/sys/dev/ixgbe/ix_txrx.c index 35c1ddd..3f61b00 100644 --- a/sys/dev/ixgbe/ix_txrx.c +++ b/sys/dev/ixgbe/ix_txrx.c @@ -971,12 +971,12 @@ ixgbe_tso_setup(struct tx_ring *txr, struct mbuf *mp, void ixgbe_txeof(struct tx_ring *txr) { -#ifdef DEV_NETMAP struct adapter *adapter = txr->adapter; +#ifdef DEV_NETMAP struct ifnet *ifp = adapter->ifp; #endif u32 work, processed = 0; - u16 limit = txr->process_limit; + u32 limit = adapter->tx_process_limit; struct ixgbe_tx_buf *buf; union ixgbe_adv_tx_desc *txd; @@ -1733,7 +1733,7 @@ ixgbe_rxeof(struct ix_queue *que) struct lro_entry *queued; int i, nextp, processed = 0; u32 staterr = 0; - u16 count = rxr->process_limit; + u32 count = adapter->rx_process_limit; union ixgbe_adv_rx_desc *cur; struct ixgbe_rx_buf *rbuf, *nbuf; u16 pkt_info; diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index a28bdc8..a501d8a 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -323,7 +323,6 @@ struct tx_ring { volatile u16 tx_avail; u16 next_avail_desc; u16 next_to_clean; - u16 process_limit; u16 num_desc; u32 txd_cmd; bus_dma_tag_t txtag; @@ -365,7 +364,6 @@ struct rx_ring { u16 next_to_check; u16 num_desc; u16 mbuf_sz; - u16 process_limit; char mtx_name[16]; struct ixgbe_rx_buf *rx_buffers; bus_dma_tag_t ptag; @@ -472,6 +470,7 @@ struct adapter { */ struct tx_ring *tx_rings; u32 num_tx_desc; + u32 tx_process_limit; /* * Receive rings: @@ -480,6 +479,7 @@ struct adapter { struct rx_ring *rx_rings; u64 active_queues; u32 num_rx_desc; + u32 rx_process_limit; /* Multicast array memory */ u8 *mta; |