freebsd-src/sys/ofed
Hans Petter Selasky c40fbda341 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.

Approved by:		re (kib)
Submitted by:		mjoras@
Differential Revision:	https://reviews.freebsd.org/D11683
Sponsored by:		Mellanox Technologies
2017-08-15 09:21:46 +00:00
..
drivers MFC r322248: 2017-08-15 09:21:46 +00:00
include MFC r314878: 2017-08-14 12:59:14 +00:00