From owner-svn-src-head@freebsd.org Mon Aug 1 22:22:12 2016 Return-Path: Delivered-To: svn-src-head@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 DB8D7BAC2CC; Mon, 1 Aug 2016 22:22:12 +0000 (UTC) (envelope-from markj@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 ADBE41CE1; Mon, 1 Aug 2016 22:22:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u71MMBkP018483; Mon, 1 Aug 2016 22:22:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u71MMB4E018482; Mon, 1 Aug 2016 22:22:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608012222.u71MMB4E018482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 1 Aug 2016 22:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303646 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 22:22:13 -0000 Author: markj Date: Mon Aug 1 22:22:11 2016 New Revision: 303646 URL: https://svnweb.freebsd.org/changeset/base/303646 Log: ipoib: Bound the number of egress mbufs buffered during pathrec lookups. In pathological situations where the master subnet manager becomes unresponsive for an extended period, we may otherwise end up queuing all of the system's mbufs while waiting for a response to a path record lookup. This addresses the same issue as commit 1e85b806f9 in Linux. Reviewed by: cem, ngie MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:19:23 2016 (r303645) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:22:11 2016 (r303646) @@ -660,7 +660,13 @@ ipoib_unicast_send(struct mbuf *mb, stru new_path = 1; } if (path) { - _IF_ENQUEUE(&path->queue, mb); + if (_IF_QLEN(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) + _IF_ENQUEUE(&path->queue, mb); + else { + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); + m_freem(mb); + } + if (!path->query && path_rec_start(priv, path)) { spin_unlock_irqrestore(&priv->lock, flags); if (new_path)