From: David Marchand <david.marchand@redhat.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev <dev@dpdk.org>,
ybrustin@cisco.com, Tiwei Bie <tiwei.bie@intel.com>,
Jens Freimann <jfreimann@redhat.com>,
dpdk stable <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 4/4] net/virtio: remove useless pointers checks
Date: Wed, 5 Jun 2019 11:35:04 +0200 [thread overview]
Message-ID: <CAJFAV8wWAyVPudFP1DRMMewsjjKXLc4cS7d--CFYgsHg5MFoTw@mail.gmail.com> (raw)
In-Reply-To: <20190605081005.15716-5-maxime.coquelin@redhat.com>
On Wed, Jun 5, 2019 at 10:11 AM Maxime Coquelin <maxime.coquelin@redhat.com>
wrote:
> This patch removes uses checks on 'prev' pointer, as it
> is always set before with a valid value.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> drivers/net/virtio/virtio_rxtx.c | 15 ++++-----------
> 1 file changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/virtio/virtio_rxtx.c
> b/drivers/net/virtio/virtio_rxtx.c
> index 33dbc78906..fabd2e31d5 100644
> --- a/drivers/net/virtio/virtio_rxtx.c
> +++ b/drivers/net/virtio/virtio_rxtx.c
> @@ -1517,9 +1517,7 @@ virtio_recv_pkts_inorder(void *rx_queue,
>
> rx_pkts[nb_rx]->pkt_len += (uint32_t)(len[i]);
>
> - if (prev)
> - prev->next = rxm;
> -
> + prev->next = rxm;
> prev = rxm;
> seg_res -= 1;
> }
> @@ -1703,9 +1701,7 @@ virtio_recv_mergeable_pkts(void *rx_queue,
> rx_pkts[nb_rx]->pkt_len += (uint32_t)(len[i]);
> rx_pkts[nb_rx]->data_len += (uint16_t)(len[i]);
>
> - if (prev)
> - prev->next = rxm;
> -
> + prev->next = rxm;
> prev = rxm;
> seg_res -= 1;
> }
> @@ -1879,9 +1875,7 @@ virtio_recv_mergeable_pkts_packed(void *rx_queue,
> rx_pkts[nb_rx]->pkt_len += (uint32_t)(len[i]);
> rx_pkts[nb_rx]->data_len += (uint16_t)(len[i]);
>
> - if (prev)
> - prev->next = rxm;
> -
> + prev->next = rxm;
> prev = rxm;
> seg_res -= 1;
> }
> @@ -1924,8 +1918,7 @@ virtio_recv_mergeable_pkts_packed(void *rx_queue,
> } else {
> PMD_RX_LOG(ERR,
> "No enough segments for packet.");
> - if (prev)
> - virtio_discard_rxbuf(vq, prev);
> + virtio_discard_rxbuf(vq, prev);
> rxvq->stats.errors++;
> break;
> }
> --
> 2.21.0
>
>
Reviewed-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
prev parent reply other threads:[~2019-06-05 9:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-05 8:10 [dpdk-dev] [PATCH v2 0/4] net/virtio: Fix packet segmentation bug Maxime Coquelin
2019-06-05 8:10 ` [dpdk-dev] [PATCH v2 1/4] net/virtio: fix segmented packet issue in in-order Rx path Maxime Coquelin
2019-06-05 9:34 ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-06-05 8:10 ` [dpdk-dev] [PATCH v2 2/4] net/virtio: fix segmented packet issue in mergeable " Maxime Coquelin
2019-06-05 9:34 ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-06-05 8:10 ` [dpdk-dev] [PATCH v2 3/4] net/virtio: fix segment data len in mergeable packed " Maxime Coquelin
2019-06-05 9:34 ` [dpdk-dev] [dpdk-stable] " David Marchand
2019-06-05 8:10 ` [dpdk-dev] [PATCH v2 4/4] net/virtio: remove useless pointers checks Maxime Coquelin
2019-06-05 9:35 ` David Marchand [this message]
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=CAJFAV8wWAyVPudFP1DRMMewsjjKXLc4cS7d--CFYgsHg5MFoTw@mail.gmail.com \
--to=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=jfreimann@redhat.com \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
--cc=tiwei.bie@intel.com \
--cc=ybrustin@cisco.com \
/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).