Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 Dec 2015 08:49:07 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Hans Petter Selasky <hselasky@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r291699 - in head/sys: modules/mlxen ofed/drivers/net/mlx4
Message-ID:  <1449157747.1262.98.camel@freebsd.org>
In-Reply-To: <201512031456.tB3EuHVs030967@repo.freebsd.org>
References:  <201512031456.tB3EuHVs030967@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1449157747.1262.98.camel>