[PATCH v9 04/17] net/nbl: add Channel layer definitions and implementation
Stephen Hemminger
stephen at networkplumber.org
Thu Sep 18 18:35:48 CEST 2025
On Wed, 17 Sep 2025 01:08:30 -0700
Dimon Zhao <dimon.zhao at nebula-matrix.com> wrote:
> +static int nbl_chan_send_ack(void *priv, struct nbl_chan_ack_info *chan_ack)
> +{
> + struct nbl_channel_mgt *chan_mgt = (struct nbl_channel_mgt *)priv;
> + struct nbl_chan_send_info chan_send;
> + u32 *tmp;
> + u32 len = 3 * sizeof(u32) + chan_ack->data_len;
> +
> + tmp = rte_zmalloc("nbl_chan_send_tmp", len, 0);
> + if (!tmp) {
> + NBL_LOG(ERR, "Chan send ack data malloc failed");
> + return -ENOMEM;
> + }
> +
> + tmp[0] = chan_ack->msg_type;
> + tmp[1] = chan_ack->msgid;
> + tmp[2] = (u32)chan_ack->err;
> + if (chan_ack->data && chan_ack->data_len)
> + memcpy(&tmp[3], chan_ack->data, chan_ack->data_len);
> +
> + NBL_CHAN_SEND(chan_send, chan_ack->dstid, NBL_CHAN_MSG_ACK, tmp, len, NULL, 0, 0);
> + nbl_chan_send_msg(chan_mgt, &chan_send);
> + rte_free(tmp);
> +
> + return 0;
> +}
Does tmp need to be in huge pages (for DMA etc), or could it just be on regular
heap?
More information about the dev
mailing list