Skip to content

Commit

Permalink
dpaa2: ni: Seed pool with maximum buffers per channel.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsalychev committed Jun 19, 2022
1 parent e856e7a commit 846462f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions sys/dev/dpaa2/dpaa2_ni.c
Original file line number Diff line number Diff line change
Expand Up @@ -3009,8 +3009,8 @@ dpaa2_ni_seed_buf_pool(struct dpaa2_ni_softc *sc, struct dpaa2_ni_channel *chan)
bpsc = device_get_softc(bp_dev);

KASSERT(DPAA2_NI_BUFS_PER_CHAN <= DPAA2_NI_MAX_BPC,
("maximum buffers per channel must be <= %d: buffers=%d",
DPAA2_NI_MAX_BPC, DPAA2_NI_BUFS_PER_CHAN));
("%s: too many buffers (%d) per channel: max=%d", __func__,
DPAA2_NI_BUFS_PER_CHAN, DPAA2_NI_MAX_BPC));

chan_bufn = 0;

Expand All @@ -3019,6 +3019,12 @@ dpaa2_ni_seed_buf_pool(struct dpaa2_ni_softc *sc, struct dpaa2_ni_channel *chan)
/* Allocate enough buffers to release in one QBMan command. */
for (j = 0; j < DPAA2_SWP_BUFS_PER_CMD; j++) {
buf_idx = i + j;
if (buf_idx >= DPAA2_NI_BUFS_PER_CHAN) {
/* Release the last buffers to the pool. */
stop = true;
break;
}

buf = &chan->buf[buf_idx];
buf->dmap = NULL;
buf->m = NULL;
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/dpaa2/dpaa2_ni.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#define DPAA2_NI_MAX_POOLS 8 /* buffer pools per DPNI */

/* Maximum number of buffers allocated per channel. */
#define DPAA2_NI_BUFS_PER_CHAN (50u * DPAA2_SWP_BUFS_PER_CMD)
#define DPAA2_NI_BUFS_PER_CHAN (2048u)
#define DPAA2_NI_MAX_BPC (2048u) /* 11 bits for buffer index max. */

/* Maximum number of buffers allocated per Tx ring. */
Expand Down

0 comments on commit 846462f

Please sign in to comment.