From owner-svn-src-head@freebsd.org Thu Dec 3 15:49:16 2015 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 9C8C7A405D9 for ; Thu, 3 Dec 2015 15:49:16 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 7BA6C1037 for ; Thu, 3 Dec 2015 15:49:16 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 3 Dec 2015 15:49:44 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tB3Fn7tP019386; Thu, 3 Dec 2015 08:49:07 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1449157747.1262.98.camel@freebsd.org> Subject: Re: svn commit: r291699 - in head/sys: modules/mlxen ofed/drivers/net/mlx4 From: Ian Lepore To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 03 Dec 2015 08:49:07 -0700 In-Reply-To: <201512031456.tB3EuHVs030967@repo.freebsd.org> References: <201512031456.tB3EuHVs030967@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 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: Thu, 03 Dec 2015 15:49:16 -0000 On Thu, 2015-12-03 at 14:56 +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Dec 3 14:56:17 2015 > New Revision: 291699 > URL: https://svnweb.freebsd.org/changeset/base/291699 > > Log: > Convert the mlxen driver to use the BUSDMA(9) APIs instead of > vtophys() when loading mbufs for transmission and reception. While > at > it all pointer arithmetic and cast qualifier issues were fixed, > mostly > related to transmission and reception. > > MFC after: 1 week > Sponsored by: Mellanox Technologies > Differential Revision: https://reviews.freebsd.org/D4284 > > Modified: > head/sys/modules/mlxen/Makefile > head/sys/ofed/drivers/net/mlx4/en_netdev.c > head/sys/ofed/drivers/net/mlx4/en_rx.c > head/sys/ofed/drivers/net/mlx4/en_tx.c > head/sys/ofed/drivers/net/mlx4/mlx4_en.h > > [...] > + /* load spare mbuf into BUSDMA */ > + err = -bus_dmamap_load_mbuf_sg(ring->dma_tag, ring > ->spare.dma_map, > + mb, segs, &nsegs, BUS_DMA_NOWAIT); > + if (unlikely(err != 0)) { > + m_freem(mb); > + return (err); > + } > + KASSERT(nsegs == 1, > + ("Number of segments is expected to be one")); > + This KASSERT() (and others like it following map loads) could never fire, because the dma tag is created with maxsegs 1. If the buffer can't be mapped as a single segment the map load would return EFBIG error. -- Ian