]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r322248:
authorhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 15 Aug 2017 12:28:16 +0000 (12:28 +0000)
committerhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 15 Aug 2017 12:28:16 +0000 (12:28 +0000)
commitcc94b13210187a4e8f2ee06afad5a4f3b79b3566
tree90c88647c1f51c49af348f4a8ea939698f3a0af8
parent3fba99682ddb64ccf96fb4819177d13070ef5b42
MFC r322248:
Fix for mlx4en(4) to properly call m_defrag().

The m_defrag() function can only defrag mbuf chains which have a valid
mbuf packet header. In r291699 when the mlx4en(4) driver was converted
into using BUSDMA(9), the call to m_defrag() was moved after the part
of the transmit routine which strips the header from the mbuf chain.
This effectivly disabled the mbuf defrag mechanism and such packets
simply got dropped.

This patch removes the stripping of mbufs from a chain and loads all
mbufs using busdma. If busdma finds there are no segments, unload
the DMA map and free the mbuf right away, because that means all
data in the mbuf has been inlined in the TX ring. Else proceed
as usual.

Add a per-ring rounter for the number of defrag attempts and
make sure the oversized_packets counter gets zeroed while at it.

The counters are per-ring to avoid excessive cache misses in the
TX path.

Submitted by: mjoras@
Differential Revision: https://reviews.freebsd.org/D11683
Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/9@322536 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/ofed/drivers/net/mlx4/en_netdev.c
sys/ofed/drivers/net/mlx4/en_port.c
sys/ofed/drivers/net/mlx4/en_tx.c
sys/ofed/drivers/net/mlx4/mlx4_en.h
sys/ofed/drivers/net/mlx4/mlx4_stats.h