From owner-cvs-src@FreeBSD.ORG Wed Nov 1 10:46:51 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 650D116A403; Wed, 1 Nov 2006 10:46:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (cell.sick.ru [217.72.144.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 860AC43D53; Wed, 1 Nov 2006 10:46:50 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from cell.sick.ru (glebius@localhost [127.0.0.1]) by cell.sick.ru (8.13.4/8.13.3) with ESMTP id kA1AkmSE068290 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 1 Nov 2006 13:46:49 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.sick.ru (8.13.4/8.13.1/Submit) id kA1AkmMm068289; Wed, 1 Nov 2006 13:46:48 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.sick.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 1 Nov 2006 13:46:48 +0300 From: Gleb Smirnoff To: Pawel Worach Message-ID: <20061101104648.GK75694@FreeBSD.org> References: <200610311721.k9VHLFpw058923@repoman.freebsd.org> <20061101101928.GJ75694@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="phCU5ROyZO6kBE05" Content-Disposition: inline In-Reply-To: <20061101101928.GJ75694@FreeBSD.org> User-Agent: Mutt/1.5.6i Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, John Baldwin Subject: Re: cvs commit: src/sys/dev/em if_em.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Nov 2006 10:46:51 -0000 --phCU5ROyZO6kBE05 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline On Wed, Nov 01, 2006 at 01:19:28PM +0300, Gleb Smirnoff wrote: T> On Wed, Nov 01, 2006 at 11:05:24AM +0100, Pawel Worach wrote: T> P> On 10/31/06, John Baldwin wrote: T> P> >jhb 2006-10-31 17:21:15 UTC T> P> > T> P> > FreeBSD src repository T> P> > T> P> > Modified files: T> P> > sys/dev/em if_em.c T> P> > Log: T> P> > Allocate receive and transmit data structures during attach() and free T> P> > them T> P> T> P> Could this be related? T> T> Yes, it is. John's patch was tested on RELENG_6 only, where TSO support T> isn't yet present. T> T> I'll try to fix this. The attached patch fixes this. I am not sure whether it is correct, I've mimiced behaviour of mxge(4) driver here. -- Totus tuus, Glebius. GLEBIUS-RIPN GLEB-RIPE --phCU5ROyZO6kBE05 Content-Type: text/plain; charset=koi8-r Content-Disposition: attachment; filename="em.diff" Index: if_em.c =================================================================== RCS file: /home/ncvs/src/sys/dev/em/if_em.c,v retrieving revision 1.160 diff -u -p -r1.160 if_em.c --- if_em.c 31 Oct 2006 17:21:14 -0000 1.160 +++ if_em.c 1 Nov 2006 10:34:00 -0000 @@ -2614,31 +2603,21 @@ em_dma_free(struct adapter *adapter, str static int em_allocate_transmit_structures(struct adapter *adapter) { - struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; struct em_buffer *tx_buffer; - bus_size_t size, segsize; int error, i; /* * Setup DMA descriptor areas. */ - segsize = size = roundup2(adapter->hw.max_frame_size, MCLBYTES); - - /* Overrides for TSO - want large sizes */ - if (ifp->if_hwassist & EM_TCPSEG_FEATURES) { - size = EM_TSO_SIZE; - segsize = PAGE_SIZE; - } - if ((error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - size, /* maxsize */ + EM_TSO_SIZE, /* maxsize */ EM_MAX_SCATTER, /* nsegments */ - segsize, /* maxsegsize */ + PAGE_SIZE, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ --phCU5ROyZO6kBE05--