net/ice: fix Tx threshold setup
authorQi Zhang <qi.z.zhang@intel.com>
Sat, 4 May 2019 09:29:38 +0000 (17:29 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 May 2019 16:40:06 +0000 (18:40 +0200)
commitfb69492c042b96625fa8f5c4e49a326db22cab7c
tree23da714a2d1bdaf598418719566b71b78278b947
parent1c5c7c91d300355b5b76c5c396e54f6b35bac28a
net/ice: 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: 50370662b727 ("net/ice: support device and queue ops")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
drivers/net/ice/ice_rxtx.c