svn commit: r292670 - head/sys/dev/e1000

Sean Bruno sbruno at FreeBSD.org
Wed Dec 23 21:54:06 UTC 2015


Author: sbruno
Date: Wed Dec 23 21:54:05 2015
New Revision: 292670
URL: https://svnweb.freebsd.org/changeset/base/292670

Log:
  Add support for sysctl knobs to live tune the tx packet processing limits
  in igb and fix a wrap-around bug.
  
  Reviewed by:	hiren
  Obtained from:  Jason (j at nitrology.com)
  MFC after:	2 weeks
  Sponsored by:	LimeLight Networks
  Differential Revision:	https://reviews.freebsd.org/D4039

Modified:
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_igb.h

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Wed Dec 23 21:51:10 2015	(r292669)
+++ head/sys/dev/e1000/if_igb.c	Wed Dec 23 21:54:05 2015	(r292670)
@@ -336,6 +336,12 @@ SYSCTL_INT(_hw_igb, OID_AUTO, rx_process
     &igb_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 igb_tx_process_limit = -1;
+SYSCTL_INT(_hw_igb, OID_AUTO, tx_process_limit, CTLFLAG_RDTUN,
+    &igb_tx_process_limit, 0,
+    "Maximum number of sent packets to process at a time, -1 means unlimited");
+
 #ifdef DEV_NETMAP	/* see ixgbe.c for details */
 #include <dev/netmap/if_igb_netmap.h>
 #endif /* DEV_NETMAP */
@@ -453,11 +459,15 @@ igb_attach(device_t dev)
 
 	e1000_get_bus_info(&adapter->hw);
 
-	/* Sysctl for limiting the amount of work done in the taskqueue */
+	/* Sysctls for limiting the amount of work done in the taskqueues */
 	igb_set_sysctl_value(adapter, "rx_processing_limit",
 	    "max number of rx packets to process",
 	    &adapter->rx_process_limit, igb_rx_process_limit);
 
+	igb_set_sysctl_value(adapter, "tx_processing_limit",
+	    "max number of tx packets to process",
+	    &adapter->tx_process_limit, igb_tx_process_limit);
+
 	/*
 	 * Validate number of transmit and receive descriptors. It
 	 * must not exceed hardware maximum, and must be multiple
@@ -3971,7 +3981,7 @@ igb_txeof(struct tx_ring *txr)
 	struct ifnet		*ifp = adapter->ifp;
 #endif /* DEV_NETMAP */
 	u32			work, processed = 0;
-	u16			limit = txr->process_limit;
+	int			limit = adapter->tx_process_limit;
 	struct igb_tx_buf	*buf;
 	union e1000_adv_tx_desc *txd;
 

Modified: head/sys/dev/e1000/if_igb.h
==============================================================================
--- head/sys/dev/e1000/if_igb.h	Wed Dec 23 21:51:10 2015	(r292669)
+++ head/sys/dev/e1000/if_igb.h	Wed Dec 23 21:54:05 2015	(r292670)
@@ -355,7 +355,6 @@ struct tx_ring {
 	volatile u16		tx_avail;
 	u16			next_avail_desc;
 	u16			next_to_clean;
-	u16			process_limit;
 	u16			num_desc;
 	enum {
 	    IGB_QUEUE_IDLE = 1,
@@ -534,6 +533,7 @@ struct adapter {
 	int			has_manage;
 	int			wol;
 	int			rx_process_limit;
+	int			tx_process_limit;
 	u16			vf_ifp;  /* a VF interface */
 	bool			in_detach; /* Used only in igb_ioctl */
 


More information about the svn-src-head mailing list