net/ixgbe: fix Tx threshold setup
authorQi Zhang <qi.z.zhang@intel.com>
Sat, 4 May 2019 09:29:39 +0000 (17:29 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 May 2019 16:40:06 +0000 (18:40 +0200)
commit9f5d2352fe45bee575f50f4a7131f3beee52b43f
treedb773b5cd0a1c1d9c9822404f48d92097bb9840b
parentfb69492c042b96625fa8f5c4e49a326db22cab7c
net/ixgbe: fix Tx threshold setup

Tx desc's DD status is not cleaned by NIC automatically after packets
have been transmitted until software refill a new packet during next
loop. So when tx_free_thresh + tx_rs_thresh > nb_desc, it is possible
that an outdated DD status be checked as tx_next_dd, then segment fault
happen due to free a NULL mbuf pointer.

Then patch fixes this issue by
1. try to adapt tx_rs_thresh to an aggressive tx_free_thresh.
2. queue setup fail when tx_free_thresh + tx_rs_thresh > nb_desc

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
drivers/net/ixgbe/ixgbe_rxtx.c