[dpdk-dev] [PATCH v4 2/3] net/virtio: add packet injection method

Tiwei Bie tiwei.bie at intel.com
Thu Jan 4 08:56:21 CET 2018


On Thu, Jan 04, 2018 at 07:59:37AM -0800, Xiao Wang wrote:
[...]
> +void
> +virtio_inject_pkts(struct rte_eth_dev *dev, struct virtnet_tx *txvq,
> +		struct rte_mbuf **buf, int count)
> +{
> +	struct virtio_hw *hw = dev->data->dev_private;
> +
> +	hw->special_buf = buf;

I think maybe you can give it (hw->special_buf) a
better (more meaningful) name.

You don't need to put txvq in the param list based
on your current implementation. Otherwise, you need
to make special_buf be per-queue variable.

> +	dev->tx_pkt_burst(txvq, buf, count);
> +}
> +

You need to zero the hw->special_buf after calling
tx_pkt_burst().

You should also return the retval of tx_pkt_burst()
to the caller.

Thanks,
Tiwei


More information about the dev mailing list