Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Expose system level ixgbe sysctls.

Device level sysctls are already exposed as dev.ix.<device>

Fixing the case where number of queues for igb is auto-tuned and
hw.igb.num_queues does not return current/updated value.

Reviewed by:	jfv
Approved by:	re (delphij)
MFC after:	2 weeks
  • Loading branch information...
commit e6885256cdc6759add16ed571a19768419ac65ef 1 parent 4c51628
hirenp hirenp authored
Showing with 29 additions and 0 deletions.
  1. +3 −0  sys/dev/e1000/if_igb.c
  2. +26 −0 sys/dev/ixgbe/ixgbe.c
3  sys/dev/e1000/if_igb.c
View
@@ -2883,6 +2883,9 @@ igb_setup_msix(struct adapter *adapter)
if (queues > maxqueues)
queues = maxqueues;
+ /* reflect correct sysctl value */
+ igb_num_queues = queues;
+
/*
** One vector (RX/TX pair) per queue
** plus an additional for Link interrupt
26 sys/dev/ixgbe/ixgbe.c
View
@@ -234,6 +234,9 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1);
** TUNEABLE PARAMETERS:
*/
+static SYSCTL_NODE(_hw, OID_AUTO, ix, CTLFLAG_RD, 0,
+ "IXGBE driver parameters");
+
/*
** AIM: Adaptive Interrupt Moderation
** which means that the interrupt rate
@@ -242,17 +245,29 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1);
*/
static int ixgbe_enable_aim = TRUE;
TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim);
+SYSCTL_INT(_hw_ix, OID_AUTO, enable_aim, CTLFLAG_RW, &ixgbe_enable_aim, 0,
+ "Enable adaptive interrupt moderation");
static int ixgbe_max_interrupt_rate = (4000000 / IXGBE_LOW_LATENCY);
TUNABLE_INT("hw.ixgbe.max_interrupt_rate", &ixgbe_max_interrupt_rate);
+SYSCTL_INT(_hw_ix, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN,
+ &ixgbe_max_interrupt_rate, 0, "Maximum interrupts per second");
/* How many packets rxeof tries to clean at a time */
static int ixgbe_rx_process_limit = 256;
TUNABLE_INT("hw.ixgbe.rx_process_limit", &ixgbe_rx_process_limit);
+SYSCTL_INT(_hw_ix, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN,
+ &ixgbe_rx_process_limit, 0,
+ "Maximum number of received packets to process at a time,"
+ "-1 means unlimited");
/* How many packets txeof tries to clean at a time */
static int ixgbe_tx_process_limit = 256;
TUNABLE_INT("hw.ixgbe.tx_process_limit", &ixgbe_tx_process_limit);
+SYSCTL_INT(_hw_ix, OID_AUTO, tx_process_limit, CTLFLAG_RDTUN,
+ &ixgbe_tx_process_limit, 0,
+ "Maximum number of sent packets to process at a time,"
+ "-1 means unlimited");
/*
** Smart speed setting, default to on
@@ -269,6 +284,8 @@ static int ixgbe_smart_speed = ixgbe_smart_speed_on;
*/
static int ixgbe_enable_msix = 1;
TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix);
+SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &ixgbe_enable_msix, 0,
+ "Enable MSI-X interrupts");
/*
* Number of Queues, can be set to 0,
@@ -278,6 +295,8 @@ TUNABLE_INT("hw.ixgbe.enable_msix", &ixgbe_enable_msix);
*/
static int ixgbe_num_queues = 0;
TUNABLE_INT("hw.ixgbe.num_queues", &ixgbe_num_queues);
+SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0,
+ "Number of queues to configure, 0 indicates autoconfigure");
/*
** Number of TX descriptors per ring,
@@ -286,10 +305,14 @@ TUNABLE_INT("hw.ixgbe.num_queues", &ixgbe_num_queues);
*/
static int ixgbe_txd = PERFORM_TXD;
TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd);
+SYSCTL_INT(_hw_ix, OID_AUTO, txd, CTLFLAG_RDTUN, &ixgbe_txd, 0,
+ "Number of receive descriptors per queue");
/* Number of RX descriptors per ring */
static int ixgbe_rxd = PERFORM_RXD;
TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd);
+SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLAG_RDTUN, &ixgbe_rxd, 0,
+ "Number of receive descriptors per queue");
/*
** Defining this on will allow the use
@@ -2442,6 +2465,9 @@ ixgbe_setup_msix(struct adapter *adapter)
else if ((ixgbe_num_queues == 0) && (queues > 8))
queues = 8;
+ /* reflect correct sysctl value */
+ ixgbe_num_queues = queues;
+
/*
** Want one vector (RX/TX pair) per queue
** plus an additional for Link.
Please sign in to comment.
Something went wrong with that request. Please try again.