]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r322248:
authorhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 15 Aug 2017 09:21:46 +0000 (09:21 +0000)
committerhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 15 Aug 2017 09:21:46 +0000 (09:21 +0000)
commit9f8d2f82c4fdb7c1978462626460834051d7accc
tree998c37faca6e3bc3e84d9d01430b177fa0a6c958
parent8061d2df9d6709276a4d9bb5969ea503ea9cca17
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

git-svn-id: svn://svn.freebsd.org/base/stable/10@322531 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