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: handle reset notify async event from FW
[dpdk.git]
/
drivers
/
net
/
bnx2x
/
bnx2x.c
diff --git
a/drivers/net/bnx2x/bnx2x.c
b/drivers/net/bnx2x/bnx2x.c
index
5a47fd8
..
1a08826
100644
(file)
--- a/
drivers/net/bnx2x/bnx2x.c
+++ b/
drivers/net/bnx2x/bnx2x.c
@@
-2015,6
+2015,8
@@
bnx2x_nic_unload(struct bnx2x_softc *sc, uint32_t unload_mode, uint8_t keep_link
uint8_t global = FALSE;
uint32_t val;
uint8_t global = FALSE;
uint32_t val;
+ PMD_INIT_FUNC_TRACE(sc);
+
PMD_DRV_LOG(DEBUG, sc, "Starting NIC unload...");
/* mark driver as unloaded in shmem2 */
PMD_DRV_LOG(DEBUG, sc, "Starting NIC unload...");
/* mark driver as unloaded in shmem2 */
@@
-2118,6
+2120,9
@@
bnx2x_nic_unload(struct bnx2x_softc *sc, uint32_t unload_mode, uint8_t keep_link
bnx2x_free_mem(sc);
}
bnx2x_free_mem(sc);
}
+ /* free the host hardware/software hsi structures */
+ bnx2x_free_hsi_mem(sc);
+
bnx2x_free_fw_stats_mem(sc);
sc->state = BNX2X_STATE_CLOSED;
bnx2x_free_fw_stats_mem(sc);
sc->state = BNX2X_STATE_CLOSED;
@@
-2401,9
+2406,6
@@
static void bnx2x_free_mem(struct bnx2x_softc *sc)
ecore_ilt_mem_op(sc, ILT_MEMOP_FREE);
bnx2x_free_ilt_lines_mem(sc);
ecore_ilt_mem_op(sc, ILT_MEMOP_FREE);
bnx2x_free_ilt_lines_mem(sc);
-
- /* free the host hardware/software hsi structures */
- bnx2x_free_hsi_mem(sc);
}
static int bnx2x_alloc_mem(struct bnx2x_softc *sc)
}
static int bnx2x_alloc_mem(struct bnx2x_softc *sc)
@@
-2454,13
+2456,6
@@
static int bnx2x_alloc_mem(struct bnx2x_softc *sc)
return -1;
}
return -1;
}
- /* allocate the host hardware/software hsi structures */
- if (bnx2x_alloc_hsi_mem(sc) != 0) {
- PMD_DRV_LOG(ERR, sc, "bnx2x_alloc_hsi_mem was failed");
- bnx2x_free_mem(sc);
- return -ENXIO;
- }
-
return 0;
}
return 0;
}
@@
-7240,6
+7235,14
@@
int bnx2x_nic_load(struct bnx2x_softc *sc)
}
}
}
}
+ /* allocate the host hardware/software hsi structures */
+ if (bnx2x_alloc_hsi_mem(sc) != 0) {
+ PMD_DRV_LOG(ERR, sc, "bnx2x_alloc_hsi_mem was failed");
+ sc->state = BNX2X_STATE_CLOSED;
+ rc = -ENOMEM;
+ goto bnx2x_nic_load_error0;
+ }
+
if (bnx2x_alloc_fw_stats_mem(sc) != 0) {
sc->state = BNX2X_STATE_CLOSED;
rc = -ENOMEM;
if (bnx2x_alloc_fw_stats_mem(sc) != 0) {
sc->state = BNX2X_STATE_CLOSED;
rc = -ENOMEM;
@@
-7455,6
+7458,7
@@
bnx2x_nic_load_error1:
bnx2x_nic_load_error0:
bnx2x_free_fw_stats_mem(sc);
bnx2x_nic_load_error0:
bnx2x_free_fw_stats_mem(sc);
+ bnx2x_free_hsi_mem(sc);
bnx2x_free_mem(sc);
return rc;
bnx2x_free_mem(sc);
return rc;
@@
-8900,9
+8904,9
@@
int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
uint32_t i;
if (IS_PF(sc)) {
uint32_t i;
if (IS_PF(sc)) {
-/************************/
-/* DEFAULT STATUS BLOCK */
-/************************/
+
/************************/
+
/* DEFAULT STATUS BLOCK */
+
/************************/
if (bnx2x_dma_alloc(sc, sizeof(struct host_sp_status_block),
&sc->def_sb_dma, "def_sb",
if (bnx2x_dma_alloc(sc, sizeof(struct host_sp_status_block),
&sc->def_sb_dma, "def_sb",
@@
-8912,9
+8916,9
@@
int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
sc->def_sb =
(struct host_sp_status_block *)sc->def_sb_dma.vaddr;
sc->def_sb =
(struct host_sp_status_block *)sc->def_sb_dma.vaddr;
-/***************/
-/* EVENT QUEUE */
-/***************/
+
/***************/
+
/* EVENT QUEUE */
+
/***************/
if (bnx2x_dma_alloc(sc, BNX2X_PAGE_SIZE,
&sc->eq_dma, "ev_queue",
if (bnx2x_dma_alloc(sc, BNX2X_PAGE_SIZE,
&sc->eq_dma, "ev_queue",
@@
-8925,9
+8929,9
@@
int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
sc->eq = (union event_ring_elem *)sc->eq_dma.vaddr;
sc->eq = (union event_ring_elem *)sc->eq_dma.vaddr;
-/*************/
-/* SLOW PATH */
-/*************/
+
/*************/
+
/* SLOW PATH */
+
/*************/
if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_slowpath),
&sc->sp_dma, "sp",
if (bnx2x_dma_alloc(sc, sizeof(struct bnx2x_slowpath),
&sc->sp_dma, "sp",
@@
-8939,9
+8943,9
@@
int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
sc->sp = (struct bnx2x_slowpath *)sc->sp_dma.vaddr;
sc->sp = (struct bnx2x_slowpath *)sc->sp_dma.vaddr;
-/*******************/
-/* SLOW PATH QUEUE */
-/*******************/
+
/*******************/
+
/* SLOW PATH QUEUE */
+
/*******************/
if (bnx2x_dma_alloc(sc, BNX2X_PAGE_SIZE,
&sc->spq_dma, "sp_queue",
if (bnx2x_dma_alloc(sc, BNX2X_PAGE_SIZE,
&sc->spq_dma, "sp_queue",
@@
-8954,9
+8958,9
@@
int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
sc->spq = (struct eth_spe *)sc->spq_dma.vaddr;
sc->spq = (struct eth_spe *)sc->spq_dma.vaddr;
-/***************************/
-/* FW DECOMPRESSION BUFFER */
-/***************************/
+
/***************************/
+
/* FW DECOMPRESSION BUFFER */
+
/***************************/
if (bnx2x_dma_alloc(sc, FW_BUF_SIZE, &sc->gz_buf_dma,
"fw_buf", RTE_CACHE_LINE_SIZE) != 0) {
if (bnx2x_dma_alloc(sc, FW_BUF_SIZE, &sc->gz_buf_dma,
"fw_buf", RTE_CACHE_LINE_SIZE) != 0) {
@@
-8980,9
+8984,9
@@
int bnx2x_alloc_hsi_mem(struct bnx2x_softc *sc)
fp->sc = sc;
fp->index = i;
fp->sc = sc;
fp->index = i;
-/*******************/
-/* FP STATUS BLOCK */
-/*******************/
+
/*******************/
+
/* FP STATUS BLOCK */
+
/*******************/
snprintf(buf, sizeof(buf), "fp_%d_sb", i);
if (bnx2x_dma_alloc(sc, sizeof(union bnx2x_host_hc_status_block),
snprintf(buf, sizeof(buf), "fp_%d_sb", i);
if (bnx2x_dma_alloc(sc, sizeof(union bnx2x_host_hc_status_block),
@@
-9013,43
+9017,50
@@
void bnx2x_free_hsi_mem(struct bnx2x_softc *sc)
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
for (i = 0; i < sc->num_queues; i++) {
fp = &sc->fp[i];
-/*******************/
-/* FP STATUS BLOCK */
-/*******************/
+
/*******************/
+
/* FP STATUS BLOCK */
+
/*******************/
memset(&fp->status_block, 0, sizeof(fp->status_block));
memset(&fp->status_block, 0, sizeof(fp->status_block));
+ bnx2x_dma_free(&fp->sb_dma);
}
}
- /***************************/
- /* FW DECOMPRESSION BUFFER */
- /***************************/
-
- sc->gz_buf = NULL;
+ if (IS_PF(sc)) {
+ /***************************/
+ /* FW DECOMPRESSION BUFFER */
+ /***************************/
- /*******************/
- /* SLOW PATH QUEUE */
- /*******************/
+ bnx2x_dma_free(&sc->gz_buf_dma);
+ sc->gz_buf = NULL;
- sc->spq = NULL;
+ /*******************/
+ /* SLOW PATH QUEUE */
+ /*******************/
- /*************/
- /* SLOW PATH */
- /*************/
+ bnx2x_dma_free(&sc->spq_dma);
+ sc->spq = NULL;
- sc->sp = NULL;
+ /*************/
+ /* SLOW PATH */
+ /*************/
- /***************/
- /* EVENT QUEUE */
- /***************/
+ bnx2x_dma_free(&sc->sp_dma);
+ sc->sp = NULL;
- sc->eq = NULL;
+ /***************/
+ /* EVENT QUEUE */
+ /***************/
- /************************/
- /* DEFAULT STATUS BLOCK */
- /************************/
+ bnx2x_dma_free(&sc->eq_dma);
+ sc->eq = NULL;
- sc->def_sb = NULL;
+ /************************/
+ /* DEFAULT STATUS BLOCK */
+ /************************/
+ bnx2x_dma_free(&sc->def_sb_dma);
+ sc->def_sb = NULL;
+ }
}
/*
}
/*