From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Balazs Nemeth <bnemeth@redhat.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] vhost: don't track remaining packets separately
Date: Tue, 13 Apr 2021 13:36:33 +0200 [thread overview]
Message-ID: <27fe657d-54af-36e9-a949-89bb49f84cd5@redhat.com> (raw)
In-Reply-To: <5ef3d4c29927ed241c7128819fe35ac1d95d8f24.1617892982.git.bnemeth@redhat.com>
Hi Balazs,
Your patch does not apply, it needs to be rebased:
http://patches.dpdk.org/project/dpdk/patch/5ef3d4c29927ed241c7128819fe35ac1d95d8f24.1617892982.git.bnemeth@redhat.com/
Can you please send a rebased version.
Thanks,
Maxime
On 4/8/21 4:44 PM, Balazs Nemeth wrote:
> The remained variable stores the same information as the difference
> between count and pkt_idx. Remove the remained variable to simplify.
>
> Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
> ---
> lib/librte_vhost/virtio_net.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
> index e8cc5f659..cfd52360d 100644
> --- a/lib/librte_vhost/virtio_net.c
> +++ b/lib/librte_vhost/virtio_net.c
> @@ -1353,16 +1353,14 @@ virtio_dev_rx_packed(struct virtio_net *dev,
> uint32_t count)
> {
> uint32_t pkt_idx = 0;
> - uint32_t remained = count;
>
> do {
> rte_prefetch0(&vq->desc_packed[vq->last_avail_idx]);
>
> - if (remained >= PACKED_BATCH_SIZE) {
> + if (count - pkt_idx >= PACKED_BATCH_SIZE) {
> if (!virtio_dev_rx_batch_packed(dev, vq,
> &pkts[pkt_idx])) {
> pkt_idx += PACKED_BATCH_SIZE;
> - remained -= PACKED_BATCH_SIZE;
> continue;
> }
> }
> @@ -1370,7 +1368,6 @@ virtio_dev_rx_packed(struct virtio_net *dev,
> if (virtio_dev_rx_single_packed(dev, vq, pkts[pkt_idx]))
> break;
> pkt_idx++;
> - remained--;
>
> } while (pkt_idx < count);
>
> @@ -2480,12 +2477,11 @@ virtio_dev_tx_packed(struct virtio_net *dev,
> do {
> rte_prefetch0(&vq->desc_packed[vq->last_avail_idx]);
>
> - if (remained >= PACKED_BATCH_SIZE) {
> + if (count - pkt_idx >= PACKED_BATCH_SIZE) {
>
> if (!virtio_dev_tx_batch_packed(dev, vq,
> &pkts[pkt_idx])) {
> pkt_idx += PACKED_BATCH_SIZE;
> - remained -= PACKED_BATCH_SIZE;
>
> continue;
> }
> @@ -2496,9 +2492,7 @@ virtio_dev_tx_packed(struct virtio_net *dev,
> break;
> }
> pkt_idx++;
> - remained--;
> -
> - } while (remained);
> + } while (pkt_idx < count);
>
> if (pkt_idx != count) {
> rte_pktmbuf_free_bulk(&pkts[pkt_idx], count - pkt_idx);
>
next prev parent reply other threads:[~2021-04-13 11:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-08 14:44 Balazs Nemeth
2021-04-13 11:36 ` Maxime Coquelin [this message]
2021-04-13 13:20 ` [dpdk-dev] [PATCH v2] " Balazs Nemeth
2021-04-13 13:31 ` [dpdk-dev] [PATCH v3] " Balazs Nemeth
2021-04-15 16:22 ` Maxime Coquelin
2021-04-28 3:14 ` Xia, Chenbo
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=27fe657d-54af-36e9-a949-89bb49f84cd5@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=bnemeth@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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).