From owner-svn-src-stable-10@freebsd.org Thu Jan 14 18:57:19 2016 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A57E2A838B2; Thu, 14 Jan 2016 18:57:19 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 603801C03; Thu, 14 Jan 2016 18:57:19 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u0EIvIbI008614; Thu, 14 Jan 2016 18:57:18 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u0EIvI6a008611; Thu, 14 Jan 2016 18:57:18 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201601141857.u0EIvI6a008611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 14 Jan 2016 18:57:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r294030 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jan 2016 18:57:19 -0000 Author: sbruno Date: Thu Jan 14 18:57:17 2016 New Revision: 294030 URL: https://svnweb.freebsd.org/changeset/base/294030 Log: MFC r292670 Add support for sysctl knobs to live tune the tx packet processing limits in igb and fix a wrap-around bug. Submitted by: Jason (j@nitrology.com) Sponsored by: Limelight Networks Modified: stable/10/sys/dev/e1000/if_igb.c stable/10/sys/dev/e1000/if_igb.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/if_igb.c ============================================================================== --- stable/10/sys/dev/e1000/if_igb.c Thu Jan 14 18:53:54 2016 (r294029) +++ stable/10/sys/dev/e1000/if_igb.c Thu Jan 14 18:57:17 2016 (r294030) @@ -408,6 +408,13 @@ 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; +TUNABLE_INT("hw.igb.tx_process_limit", &igb_tx_process_limit); +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 #endif /* DEV_NETMAP */ @@ -526,11 +533,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 @@ -3956,7 +3967,7 @@ igb_txeof(struct tx_ring *txr) struct adapter *adapter = txr->adapter; struct ifnet *ifp = adapter->ifp; 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: stable/10/sys/dev/e1000/if_igb.h ============================================================================== --- stable/10/sys/dev/e1000/if_igb.h Thu Jan 14 18:53:54 2016 (r294029) +++ stable/10/sys/dev/e1000/if_igb.h Thu Jan 14 18:57:17 2016 (r294030) @@ -300,7 +300,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, @@ -479,6 +478,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 */