Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151329515
D3719.id8903.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D3719.id8903.diff
View Options
Index: sys/dev/ixgbe/if_ix.c
===================================================================
--- sys/dev/ixgbe/if_ix.c
+++ sys/dev/ixgbe/if_ix.c
@@ -170,6 +170,8 @@
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);
@@ -461,6 +463,15 @@
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) {
@@ -2878,7 +2889,7 @@
txr->tail = IXGBE_TDT(j);
/* Set the processing limit */
- txr->process_limit = ixgbe_tx_process_limit;
+ txr->process_limit = adapter->tx_process_limit;
/* Disable Head Writeback */
switch (hw->mac.type) {
@@ -3137,7 +3148,7 @@
IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0);
/* Set the processing limit */
- rxr->process_limit = ixgbe_rx_process_limit;
+ rxr->process_limit = adapter->rx_process_limit;
/* Set the driver rx tail address */
rxr->tail = IXGBE_RDT(rxr->me);
@@ -4458,6 +4469,16 @@
"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:
Index: sys/dev/ixgbe/if_ixv.c
===================================================================
--- sys/dev/ixgbe/if_ixv.c
+++ sys/dev/ixgbe/if_ixv.c
@@ -115,6 +115,8 @@
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 *);
@@ -325,6 +327,15 @@
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) {
@@ -1601,7 +1612,7 @@
txr->tail = IXGBE_VFTDT(i);
/* Set the processing limit */
- txr->process_limit = ixv_tx_process_limit;
+ txr->process_limit = adapter->tx_process_limit;
/* Set Ring parameters */
IXGBE_WRITE_REG(hw, IXGBE_VFTDBAL(i),
@@ -1692,7 +1703,7 @@
IXGBE_WRITE_REG(hw, IXGBE_VFSRRCTL(i), reg);
/* Set the processing limit */
- rxr->process_limit = ixv_rx_process_limit;
+ rxr->process_limit = adapter->rx_process_limit;
/* Capture Rx Tail index */
rxr->tail = IXGBE_VFRDT(rxr->me);
@@ -2122,6 +2133,16 @@
"# 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.
Index: sys/dev/ixgbe/ix_txrx.c
===================================================================
--- sys/dev/ixgbe/ix_txrx.c
+++ sys/dev/ixgbe/ix_txrx.c
@@ -986,12 +986,12 @@
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;
@@ -1747,7 +1747,7 @@
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;
Index: sys/dev/ixgbe/ixgbe.h
===================================================================
--- sys/dev/ixgbe/ixgbe.h
+++ sys/dev/ixgbe/ixgbe.h
@@ -539,6 +539,7 @@
*/
struct tx_ring *tx_rings;
u32 num_tx_desc;
+ u32 tx_process_limit;
/*
* Receive rings:
@@ -547,6 +548,7 @@
struct rx_ring *rx_rings;
u64 active_queues;
u32 num_rx_desc;
+ u32 rx_process_limit;
/* Multicast array memory */
struct ixgbe_mc_addr *mta;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 3:42 PM (2 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31105913
Default Alt Text
D3719.id8903.diff (5 KB)
Attached To
Mode
D3719: Add support for sysctl knobs to live tune the per interrupt rx/tx packet processing limits in ixgbe(4)
Attached
Detach File
Event Timeline
Log In to Comment