git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/bnxt: fix recovery alarm race condition in port close
[dpdk.git]
/
drivers
/
net
/
bnxt
/
bnxt_ethdev.c
diff --git
a/drivers/net/bnxt/bnxt_ethdev.c
b/drivers/net/bnxt/bnxt_ethdev.c
index
7147cc8
..
b8b30ed
100644
(file)
--- a/
drivers/net/bnxt/bnxt_ethdev.c
+++ b/
drivers/net/bnxt/bnxt_ethdev.c
@@
-133,6
+133,7
@@
static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev);
static int bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev);
static void bnxt_cancel_fw_health_check(struct bnxt *bp);
static int bnxt_restore_vlan_filters(struct bnxt *bp);
static int bnxt_uninit_resources(struct bnxt *bp, bool reconfig_dev);
static void bnxt_cancel_fw_health_check(struct bnxt *bp);
static int bnxt_restore_vlan_filters(struct bnxt *bp);
+static void bnxt_dev_recover(void *arg);
int is_bnxt_in_error(struct bnxt *bp)
{
int is_bnxt_in_error(struct bnxt *bp)
{
@@
-150,7
+151,7
@@
int is_bnxt_in_error(struct bnxt *bp)
* High level utility functions
*/
* High level utility functions
*/
-uint16_t bnxt_rss_ctxts(const struct bnxt *bp)
+
static
uint16_t bnxt_rss_ctxts(const struct bnxt *bp)
{
if (!BNXT_CHIP_THOR(bp))
return 1;
{
if (!BNXT_CHIP_THOR(bp))
return 1;
@@
-980,6
+981,10
@@
static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
{
struct bnxt *bp = eth_dev->data->dev_private;
{
struct bnxt *bp = eth_dev->data->dev_private;
+ /* cancel the recovery handler before remove dev */
+ rte_eal_alarm_cancel(bnxt_dev_reset_and_resume, (void *)bp);
+ rte_eal_alarm_cancel(bnxt_dev_recover, (void *)bp);
+
if (eth_dev->data->dev_started)
bnxt_dev_stop_op(eth_dev);
if (eth_dev->data->dev_started)
bnxt_dev_stop_op(eth_dev);
@@
-4022,15
+4027,17
@@
static void bnxt_dev_recover(void *arg)
rc = bnxt_dev_start_op(bp->eth_dev);
if (rc) {
PMD_DRV_LOG(ERR, "Failed to start port after reset\n");
rc = bnxt_dev_start_op(bp->eth_dev);
if (rc) {
PMD_DRV_LOG(ERR, "Failed to start port after reset\n");
- goto err;
+ goto err
_start
;
}
rc = bnxt_restore_filters(bp);
if (rc)
}
rc = bnxt_restore_filters(bp);
if (rc)
- goto err;
+ goto err
_start
;
PMD_DRV_LOG(INFO, "Recovered from FW reset\n");
return;
PMD_DRV_LOG(INFO, "Recovered from FW reset\n");
return;
+err_start:
+ bnxt_dev_stop_op(bp->eth_dev);
err:
bp->flags |= BNXT_FLAG_FATAL_ERROR;
bnxt_uninit_resources(bp, false);
err:
bp->flags |= BNXT_FLAG_FATAL_ERROR;
bnxt_uninit_resources(bp, false);