Skip to content

Commit

Permalink
net/iavf: fix Tx threshold check
Browse files Browse the repository at this point in the history
[ upstream commit ed21e06 ]

Function check_tx_thresh is called with wrong parameter. If the
check fails, tx_queue_setup should return error not keep going.
This patch fixes above issues.

Fixes: 69dd4c3 ("net/avf: enable queue and device")

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
  • Loading branch information
Li-Xiaoyun authored and cpaelzer committed Aug 10, 2021
1 parent a3b51a8 commit a4cb6c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/iavf/iavf_rxtx.c
Expand Up @@ -449,7 +449,8 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev,
tx_conf->tx_rs_thresh : DEFAULT_TX_RS_THRESH);
tx_free_thresh = (uint16_t)((tx_conf->tx_free_thresh) ?
tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH);
check_tx_thresh(nb_desc, tx_rs_thresh, tx_rs_thresh);
if (check_tx_thresh(nb_desc, tx_rs_thresh, tx_free_thresh) != 0)
return -EINVAL;

/* Free memory if needed. */
if (dev->data->tx_queues[queue_idx]) {
Expand Down

0 comments on commit a4cb6c2

Please sign in to comment.