summaryrefslogtreecommitdiffstats
path: root/sys/dev/ixgbe/if_ixv.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/ixgbe/if_ixv.c')
-rw-r--r--sys/dev/ixgbe/if_ixv.c26
1 files changed, 21 insertions, 5 deletions
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.
OpenPOWER on IntegriCloud