From owner-cvs-all@FreeBSD.ORG Mon Aug 14 01:50:55 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A7A516A4DE; Mon, 14 Aug 2006 01:50:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF7FB43D45; Mon, 14 Aug 2006 01:50:54 +0000 (GMT) (envelope-from yongari@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7E1os8X005684; Mon, 14 Aug 2006 01:50:54 GMT (envelope-from yongari@repoman.freebsd.org) Received: (from yongari@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7E1osuf005683; Mon, 14 Aug 2006 01:50:54 GMT (envelope-from yongari) Message-Id: <200608140150.k7E1osuf005683@repoman.freebsd.org> From: Pyun YongHyeon Date: Mon, 14 Aug 2006 01:50:54 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/dev/em if_em.c if_em.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2006 01:50:55 -0000 yongari 2006-08-14 01:50:54 UTC FreeBSD src repository Modified files: sys/dev/em if_em.c if_em.h Log: Overhaul Rx path to recover from mbuf cluster allocation failure. o Create one more spare DMA map for Rx handler to recover from bus_dmamap_load_mbuf_sg(9) failure. o Make sure to update status bit in Rx descriptors even if we failed to allocate a new buffer. Previously it resulted in stuck condition and em_handle_rxtx task took up all available CPU cycles. o Don't blindly unload DMA map. Reuse loaded DMA map if received packet has errors. This would speed up Rx processing a bit under heavy load as it does not need to reload DMA map in case of error. (bus_dmamap_load_mbuf_sg(9) is the most expensive call in driver context.) o Update if_iqdrops counter if it can't allocate a mbuf cluster. With this change it's now possible to see queue dropped packets with netstat(1). o Update mbuf_cluster_failed counter if fixup code failed to allocate mbuf header. o Return ENOBUFS instead of ENOMEM in case of Rx fixup failure. o Make adapter->lmp NULL in case of Rx fixup failure. Strictly specking it's not necessary for correct operation but it makes the intention clear. o Remove now unused dropped_pkts member in softc. With these changes em(4) should survive mbuf cluster allocation failure on Rx path. Reviewed by: pdeuskar, glebius (with improvements) Revision Changes Path 1.129 +68 -47 src/sys/dev/em/if_em.c 1.48 +1 -1 src/sys/dev/em/if_em.h