i40e: call _clear_cmd() when error occurs
PATCH v4 4/6 i40e: call _clear_cmd() when error occurs
_clear_cmd() was not being called in failure situations, resulting in the next command also failing.
Fix several typos.
Signed-off-by Bernard Iremonger <[email protected]>
--- drivers/net/i40e/i40e_ethdev_vf.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
drivers/net/i40e/i40e_ethdev_vf.c +7 -4
@@ -361,6 +361,7 @@ i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args) args->in_args, args->in_args_size, NULL);if (err) {PMD_DRV_LOG (ERR ,"fail to send cmd %d" , args->ops); +_clear_cmd (vf);return err; }
@@ -368,8 +369,10 @@ i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)/* read message and it's expected one */ if (!err && args->ops == info.ops)_clear_cmd (vf); -else if (err) +else if (err) {PMD_DRV_LOG (ERR ,"Failed to read message from AdminQ" ); +_clear_cmd (vf); + }else if (args->ops != info.ops)PMD_DRV_LOG (ERR ,"command mismatch, expect %u, get %u" , args->ops, info.ops);
@@ -794,7 +797,7 @@ i40evf_stop_queues(struct rte_eth_dev *dev)/* Stop TX queues first */ for (i =0 ; i < dev->data->nb_tx_queues; i++) {if (i40evf_dev_tx_queue_stop (dev, i) !=0 ) { -PMD_DRV_LOG (ERR ,"Fail to start queue %u" , i); +PMD_DRV_LOG (ERR ,"Fail to stop queue %u" , i);return -1 ; } }
@@ -802,7 +805,7 @@ i40evf_stop_queues(struct rte_eth_dev *dev)/* Then stop RX queues */ for (i =0 ; i < dev->data->nb_rx_queues; i++) {if (i40evf_dev_rx_queue_stop (dev, i) !=0 ) { -PMD_DRV_LOG (ERR ,"Fail to start queue %u" , i); +PMD_DRV_LOG (ERR ,"Fail to stop queue %u" , i);return -1 ; } }
@@ -1443,7 +1446,7 @@ i40evf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) err =i40evf_switch_queue (dev, FALSE, tx_queue_id, FALSE);if (err) { -PMD_DRV_LOG (ERR ,"Failed to switch TX queue %u of" , +PMD_DRV_LOG (ERR ,"Failed to switch TX queue %u off" , tx_queue_id);return err; }
Signature · 1 line
1.7.4.1
PATCH v4 5/6 i40e: clear queues in i40evf_dev_stop
Changes in V3:
This patch added.
Signed-off-by Bernard Iremonger <[email protected]>
--- drivers/net/i40e/i40e_ethdev_vf.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/net/i40e/i40e_ethdev_vf.c +1 -0
@@ -1632,6 +1632,7 @@ i40evf_dev_stop(struct rte_eth_dev *dev)i40evf_disable_queues_intr (hw);i40evf_stop_queues (dev); +i40e_dev_clear_queues (dev); } static int
Signature · 1 line
1.7.4.1
PATCH v4 6/6 i40e: check rxq parameter in i40e_reset_rx_queue
In reply to Bernard IremongerThere is a segmentation fault if rxq is NULL
Changes in V4:
This patch added.
Signed-off-by Bernard Iremonger <[email protected]>
--- drivers/net/i40e/i40e_rxtx.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/i40e/i40e_rxtx.c +5 -0
@@ -2269,6 +2269,11 @@ i40e_reset_rx_queue(struct i40e_rx_queue *rxq)unsigned i;uint16_t len; +if (!rxq) { +PMD_DRV_LOG (DEBUG ,"Pointer to rxq is NULL" ); +return ; + } +#ifdef RTE_LIBRTE_I40E_RX_ALLOW_BULK_ALLOC if (check_rx_burst_bulk_alloc_preconditions (rxq) ==0 ) len = (uint16_t )(rxq->nb_rx_desc +RTE_PMD_I40E_RX_MAX_BURST );
Signature · 1 line
1.7.4.1