On 4/7/21 12:17 PM, Balazs Nemeth wrote: > Move allocation out further and perform all allocation in one loop. The > same goes for freeing packets. This is to prepare for use of bulk > versions of these functions. > > Signed-off-by: Balazs Nemeth <bnem...@redhat.com> > --- > lib/librte_vhost/virtio_net.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > > diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c > index 666e7fdb8..496f750e3 100644 > --- a/lib/librte_vhost/virtio_net.c > +++ b/lib/librte_vhost/virtio_net.c > @@ -2471,14 +2471,13 @@ virtio_dev_tx_packed(struct virtio_net *dev, > uint32_t remained = count; > uint16_t i; > > + for (i = 0; i < count; ++i) > + pkts[i] = rte_pktmbuf_alloc(mbuf_pool); Same comment as for previous patch, we need to check whether allocation succeeded.
- [dpdk-dev] [PATCH 0/4] Use bulk alloc/free in virtio packe... Balazs Nemeth
- [dpdk-dev] [PATCH 1/4] vhost: move allocation of mbuf... Balazs Nemeth
- [dpdk-dev] [PATCH v2 1/4] vhost: move allocation ... Balazs Nemeth
- Re: [dpdk-dev] [PATCH v2 1/4] vhost: move all... Maxime Coquelin
- [dpdk-dev] [PATCH v2 2/4] vhost: perform all mbuf... Balazs Nemeth
- Re: [dpdk-dev] [PATCH v2 2/4] vhost: perform ... Maxime Coquelin
- [dpdk-dev] [PATCH v2 3/4] vhost: allocate and fre... Balazs Nemeth
- Re: [dpdk-dev] [PATCH v2 3/4] vhost: allocate... Maxime Coquelin
- Re: [dpdk-dev] [PATCH v2 3/4] vhost: allo... David Marchand
- Re: [dpdk-dev] [PATCH v2 3/4] vhost:... Maxime Coquelin
- Re: [dpdk-dev] [PATCH v2 3/4] vh... Maxime Coquelin
- [dpdk-dev] [PATCH v2 4/4] vhost: remove unnecessa... Balazs Nemeth
- Re: [dpdk-dev] [PATCH v2 4/4] vhost: remove u... Maxime Coquelin
- [dpdk-dev] [PATCH 2/4] vhost: perform all mbuf alloca... Balazs Nemeth
- [dpdk-dev] [PATCH 3/4] vhost: allocate and free packe... Balazs Nemeth
- [dpdk-dev] [PATCH 4/4] vhost: remove unnecessary leve... Balazs Nemeth