mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
dpaa2: Stop checking for failures from malloc/taskqueue_create(M_WAITOK)
MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45853 (cherry picked from commit 36ef39831fe0e89f0b1672340a44c4ac1183158e)
This commit is contained in:
parent
e78770d62f
commit
f6c8db29aa
3 changed files with 0 additions and 24 deletions
|
|
@ -146,12 +146,6 @@ dpaa2_chan_setup(device_t dev, device_t iodev, device_t condev, device_t bpdev,
|
|||
}
|
||||
|
||||
ch = malloc(sizeof(struct dpaa2_channel), M_DPAA2_CH, M_WAITOK | M_ZERO);
|
||||
if (ch == NULL) {
|
||||
device_printf(dev, "%s: malloc() failed\n", __func__);
|
||||
error = ENOMEM;
|
||||
goto fail_malloc;
|
||||
}
|
||||
|
||||
ch->ni_dev = dev;
|
||||
ch->io_dev = iodev;
|
||||
ch->con_dev = condev;
|
||||
|
|
@ -281,7 +275,6 @@ fail_dma_setup:
|
|||
/* taskqueue_drain(ch->cleanup_tq, &ch->cleanup_task); */
|
||||
/* } */
|
||||
/* taskqueue_free(ch->cleanup_tq); */
|
||||
fail_malloc:
|
||||
(void)DPAA2_CMD_CON_DISABLE(dev, child, DPAA2_CMD_TK(&cmd, contk));
|
||||
fail_con_enable:
|
||||
(void)DPAA2_CMD_CON_CLOSE(dev, child, DPAA2_CMD_TK(&cmd, contk));
|
||||
|
|
|
|||
|
|
@ -484,8 +484,6 @@ dpaa2_mc_manage_dev(device_t mcdev, device_t dpaa2_dev, uint32_t flags)
|
|||
return (EINVAL);
|
||||
|
||||
di = malloc(sizeof(*di), M_DPAA2_MC, M_WAITOK | M_ZERO);
|
||||
if (!di)
|
||||
return (ENOMEM);
|
||||
di->dpaa2_dev = dpaa2_dev;
|
||||
di->flags = flags;
|
||||
di->owners = 0;
|
||||
|
|
|
|||
|
|
@ -588,11 +588,6 @@ dpaa2_ni_attach(device_t dev)
|
|||
/* Create a taskqueue thread to release new buffers to the pool. */
|
||||
sc->bp_taskq = taskqueue_create(tq_name, M_WAITOK,
|
||||
taskqueue_thread_enqueue, &sc->bp_taskq);
|
||||
if (sc->bp_taskq == NULL) {
|
||||
device_printf(dev, "%s: failed to allocate task queue: %s\n",
|
||||
__func__, tq_name);
|
||||
goto close_ni;
|
||||
}
|
||||
taskqueue_start_threads(&sc->bp_taskq, 1, PI_NET, "%s", tq_name);
|
||||
|
||||
/* sc->cleanup_taskq = taskqueue_create("dpaa2_ch cleanup", M_WAITOK, */
|
||||
|
|
@ -1339,21 +1334,11 @@ dpaa2_ni_setup_tx_flow(device_t dev, struct dpaa2_ni_fq *fq)
|
|||
for (uint64_t j = 0; j < DPAA2_NI_BUFS_PER_TX; j++) {
|
||||
buf = malloc(sizeof(struct dpaa2_buf), M_DPAA2_TXB,
|
||||
M_WAITOK);
|
||||
if (buf == NULL) {
|
||||
device_printf(dev, "%s: malloc() failed (buf)\n",
|
||||
__func__);
|
||||
return (ENOMEM);
|
||||
}
|
||||
/* Keep DMA tag and Tx ring linked to the buffer */
|
||||
DPAA2_BUF_INIT_TAGOPT(buf, ch->tx_dmat, tx);
|
||||
|
||||
buf->sgt = malloc(sizeof(struct dpaa2_buf), M_DPAA2_TXB,
|
||||
M_WAITOK);
|
||||
if (buf->sgt == NULL) {
|
||||
device_printf(dev, "%s: malloc() failed (sgt)\n",
|
||||
__func__);
|
||||
return (ENOMEM);
|
||||
}
|
||||
/* Link SGT to DMA tag and back to its Tx buffer */
|
||||
DPAA2_BUF_INIT_TAGOPT(buf->sgt, ch->sgt_dmat, buf);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue