From: Maxime Coquelin <maxime.coquelin@redhat.com> To: David Marchand <david.marchand@redhat.com>, Balazs Nemeth <bnemeth@redhat.com> Cc: dev <dev@dpdk.org> Subject: Re: [dpdk-dev] [PATCH v2 3/4] vhost: allocate and free packets in bulk Date: Thu, 15 Apr 2021 17:58:26 +0200 Message-ID: <189cd2c1-cac0-75a0-f293-0641ef73a5b6@redhat.com> (raw) In-Reply-To: <deccf9bc-59e9-b968-3f18-cb0626a38149@redhat.com> On 4/15/21 5:50 PM, Maxime Coquelin wrote: > > > On 4/15/21 5:45 PM, David Marchand wrote: >> On Thu, Apr 15, 2021 at 5:33 PM Maxime Coquelin >> <maxime.coquelin@redhat.com> wrote: >>> On 4/7/21 12:17 PM, Balazs Nemeth wrote: >>>> Now that all allocation and freeing has been moved together, use the >>>> faster bulk versions instead of handling packets one by one. >>>> >>>> Signed-off-by: Balazs Nemeth <bnemeth@redhat.com> >>>> --- >>>> lib/librte_vhost/virtio_net.c | 11 ++++++----- >>>> 1 file changed, 6 insertions(+), 5 deletions(-) >>>> >>>> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c >>>> index 496f750e3..2f0c97b91 100644 >>>> --- a/lib/librte_vhost/virtio_net.c >>>> +++ b/lib/librte_vhost/virtio_net.c >>>> @@ -2469,10 +2469,10 @@ virtio_dev_tx_packed(struct virtio_net *dev, >>>> { >>>> uint32_t pkt_idx = 0; >>>> uint32_t remained = count; >>>> - uint16_t i; >>>> >>>> - for (i = 0; i < count; ++i) >>>> - pkts[i] = rte_pktmbuf_alloc(mbuf_pool); >>>> + if (rte_pktmbuf_alloc_bulk(mbuf_pool, pkts, count)) { >>>> + return 0; >>>> + } >>> >>> OK, get it now :) >>> Maybe just add a comment in previous patches that it is going to be >>> handled when moving to bulk allocation. >> >> Looking at the whole series, it is easy to read and understand as a >> single patch. >> And it avoids this intermediate issue. > > I agree with David, better to squash the first three patches. As David told me off-list, all the series can be squashed since the last patch is a consequence of doing bulk allocation. Cheers, Maxime > Thanks, > Maxime >
next prev parent reply other threads:[~2021-04-15 15:58 UTC|newest] Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-06 15:44 [dpdk-dev] [PATCH 0/4] Use bulk alloc/free in virtio packed Balazs Nemeth 2021-04-06 15:44 ` [dpdk-dev] [PATCH 1/4] vhost: move allocation of mbuf outside of packet enqueue Balazs Nemeth 2021-04-07 10:17 ` [dpdk-dev] [PATCH v2 " Balazs Nemeth 2021-04-15 12:37 ` Maxime Coquelin 2021-04-16 8:18 ` [dpdk-dev] [PATCH v3] vhost: allocate and free packets in bulk Balazs Nemeth 2021-04-16 8:36 ` Maxime Coquelin 2021-04-16 9:05 ` David Marchand 2021-04-16 9:12 ` Balazs Nemeth 2021-04-16 9:41 ` Maxime Coquelin 2021-04-16 9:43 ` David Marchand 2021-04-16 9:48 ` [dpdk-dev] [PATCH v4] " Balazs Nemeth 2021-04-16 10:25 ` [dpdk-dev] [PATCH v5] vhost: allocate and free packets in bulk in Tx packed Balazs Nemeth 2021-04-16 11:14 ` David Marchand 2021-04-21 7:48 ` Maxime Coquelin 2021-04-28 3:16 ` Xia, Chenbo 2021-04-07 10:17 ` [dpdk-dev] [PATCH v2 2/4] vhost: perform all mbuf allocations in one loop Balazs Nemeth 2021-04-15 15:30 ` Maxime Coquelin 2021-04-07 10:17 ` [dpdk-dev] [PATCH v2 3/4] vhost: allocate and free packets in bulk Balazs Nemeth 2021-04-15 15:32 ` Maxime Coquelin 2021-04-15 15:45 ` David Marchand 2021-04-15 15:50 ` Maxime Coquelin 2021-04-15 15:58 ` Maxime Coquelin [this message] 2021-04-07 10:17 ` [dpdk-dev] [PATCH v2 4/4] vhost: remove unnecessary level of indirection Balazs Nemeth 2021-04-15 15:38 ` Maxime Coquelin 2021-04-06 15:44 ` [dpdk-dev] [PATCH 2/4] vhost: perform all mbuf allocations in one loop Balazs Nemeth 2021-04-06 15:44 ` [dpdk-dev] [PATCH 3/4] vhost: allocate and free packets in bulk Balazs Nemeth 2021-04-06 15:44 ` [dpdk-dev] [PATCH 4/4] vhost: remove unnecessary level of indirection Balazs Nemeth
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=189cd2c1-cac0-75a0-f293-0641ef73a5b6@redhat.com \ --to=maxime.coquelin@redhat.com \ --cc=bnemeth@redhat.com \ --cc=david.marchand@redhat.com \ --cc=dev@dpdk.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
DPDK patches and discussions This inbox may be cloned and mirrored by anyone: git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \ dev@dpdk.org public-inbox-index dev Example config snippet for mirrors. Newsgroup available over NNTP: nntp://inbox.dpdk.org/inbox.dpdk.dev AGPL code for this site: git clone https://public-inbox.org/public-inbox.git