From owner-freebsd-current@FreeBSD.ORG Sat Jul 29 07:01:34 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A5E8D16A4DA for ; Sat, 29 Jul 2006 07:01:34 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id E640F43D45 for ; Sat, 29 Jul 2006 07:01:33 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by nz-out-0102.google.com with SMTP id 13so11735nzn for ; Sat, 29 Jul 2006 00:01:33 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:subject:message-id:reply-to:mime-version:content-type:content-disposition:user-agent; b=NC0hMu44C0hZ3AT1Tqrjqfea7cr7m+7BeMLB0SlKFDWRspTS5FCF+DJsjyEE+BI8ahw1VNMMpfmNgV/SLU6LReD3dORy6zKtvMkqHfRKNHGf4eYgHhnMoymceLzj2FpxH9XLXe10LamTEb26HJEfWguWmbpY+wVsDzqtDfKm2P8= Received: by 10.65.236.14 with SMTP id n14mr287509qbr; Sat, 29 Jul 2006 00:01:33 -0700 (PDT) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.gmail.com with ESMTP id 16sm1644563nzo.2006.07.29.00.01.31; Sat, 29 Jul 2006 00:01:33 -0700 (PDT) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id k6T71eQS029363 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 29 Jul 2006 16:01:40 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id k6T71d22029362 for freebsd-current@FreeBSD.org; Sat, 29 Jul 2006 16:01:39 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Sat, 29 Jul 2006 16:01:39 +0900 From: Pyun YongHyeon To: freebsd-current@FreeBSD.org Message-ID: <20060729070139.GB27724@cdnetworks.co.kr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Cc: Subject: em(4) patch for ENOBUFS X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jul 2006 07:01:34 -0000 Hi, Whilst reading em(4) code to fix jb's sun4v issue I noticed em(4) is very vulnerable to ENOBUFS situation on receive path. If em(4) encounter an ENOBUFS it just breaks receive loop and then try to process the packet next time. However it didn't update the Rx descriptor status so it never process receive path again(em_handle_rxtx task runs but it couldn't complete its job and the task takes up all your CPU). I've revised receive path to cope with the ENOBUFS situation more gracefully. It also contains a fix to handle DMA map loading failure case on receive path by allocating a spare DMA map. If you have em(4) and experienced ENOBUFS problem please try the following patch and let me know the result. http://people.freebsd.org/~yongari/em.ENOBUFS.patch You can reproduce current issue by lowering number of mbuf clusters in /boot/loader.conf. For example, add kern.ipc.nmbclusters="1000" to limit number of mbuf clusters. -- Regards, Pyun YongHyeon