From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 17E1FA0096 for ; Wed, 5 Jun 2019 11:34:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 029DA1B9AD; Wed, 5 Jun 2019 11:34:58 +0200 (CEST) Received: from mail-vs1-f67.google.com (mail-vs1-f67.google.com [209.85.217.67]) by dpdk.org (Postfix) with ESMTP id BAFC61B9AD for ; Wed, 5 Jun 2019 11:34:56 +0200 (CEST) Received: by mail-vs1-f67.google.com with SMTP id v6so89826vsq.4 for ; Wed, 05 Jun 2019 02:34:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PIrqucR2f0QMzuLTguWL/znFtVPcsg3Js+O0ebswRRo=; b=WeqhqqwKl3ldcDkBqgH7C15vF2yXuPOHueIDEiQIaieU1UocUvvkVZ14VLILvpgBnV elFyNDQoKa+SvXdWaPVM42YvItDGoi7Bjs0485OLcjoSSP833YZjebnLiDOuQ3F1fKaw 3CZEZlRZ4NsCjPh1IRR6j7mQmfrPmtRPNCPx/mjtbuant3XYXEo5kbsmPd1sqKU9arrb 7wC8FCYzXemSEbrXamd/I4RL1T9xMgB8BJL7CFIqeQ9J7IJsRiJjevypHbuu+8jik45o iBJXuikQZOQlHHcTO4a7eGvtBE4VT3hpMlqQeaslBuqKaVJ0U3Gw4s6Nlkch0jCeewYp j9kA== X-Gm-Message-State: APjAAAVt4vAsiP9A5e/DiyF+53dm0GoDtsd1gCm//ch18e3lgpmDoBQy AVtV3wo6qaKFpbHqrh0a6xXDG+ZexYRRyPGVFCkRBQ== X-Google-Smtp-Source: APXvYqx0ZtbH7h7gWc1CKEGMlAV/sMdRnq+sQu2PUpcZkFYGb19w2EButm65nz8ThxGxnvVmGNzDRXez7/n6HLL3qZw= X-Received: by 2002:a67:1bc6:: with SMTP id b189mr4085976vsb.39.1559727296156; Wed, 05 Jun 2019 02:34:56 -0700 (PDT) MIME-Version: 1.0 References: <20190605081005.15716-1-maxime.coquelin@redhat.com> <20190605081005.15716-2-maxime.coquelin@redhat.com> In-Reply-To: <20190605081005.15716-2-maxime.coquelin@redhat.com> From: David Marchand Date: Wed, 5 Jun 2019 11:34:45 +0200 Message-ID: To: Maxime Coquelin Cc: dev , ybrustin@cisco.com, Tiwei Bie , Jens Freimann , dpdk stable Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-stable] [PATCH v2 1/4] net/virtio: fix segmented packet issue in in-order Rx path X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Wed, Jun 5, 2019 at 10:10 AM Maxime Coquelin wrote: > After having dequeued a burst of descriptors, there may be a > need to dequeue a few more if the last packet was segmented > and not complete. When it happens, the extra segments were > not properly attached to the mbuf chain, and so were lost. > > Also, head segment data_len field is wrongly summed with > the length of all the segments of the chain. > > This patch fixes both the mbuf chaining and head segment's > data_len field. > > Fixes: e5f456a98d3c ("net/virtio: support in-order Rx and Tx") > Cc: stable@dpdk.org > > Reported-by: Yaroslav Brustinov > Signed-off-by: Maxime Coquelin > --- > drivers/net/virtio/virtio_rxtx.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/net/virtio/virtio_rxtx.c > b/drivers/net/virtio/virtio_rxtx.c > index 1de28540cd..6b3baf0423 100644 > --- a/drivers/net/virtio/virtio_rxtx.c > +++ b/drivers/net/virtio/virtio_rxtx.c > @@ -1424,7 +1424,7 @@ virtio_recv_pkts_inorder(void *rx_queue, > struct virtqueue *vq = rxvq->vq; > struct virtio_hw *hw = vq->hw; > struct rte_mbuf *rxm; > - struct rte_mbuf *prev; > + struct rte_mbuf *prev = NULL; > uint16_t nb_used, num, nb_rx; > uint32_t len[VIRTIO_MBUF_BURST_SZ]; > struct rte_mbuf *rcv_pkts[VIRTIO_MBUF_BURST_SZ]; > @@ -1516,7 +1516,6 @@ virtio_recv_pkts_inorder(void *rx_queue, > rxm->data_len = (uint16_t)(len[i]); > > 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; > @@ -1536,7 +1535,6 @@ virtio_recv_pkts_inorder(void *rx_queue, > uint16_t rcv_cnt = RTE_MIN((uint16_t)seg_res, > VIRTIO_MBUF_BURST_SZ); > > - prev = rcv_pkts[nb_rx]; > if (likely(VIRTQUEUE_NUSED(vq) >= rcv_cnt)) { > virtio_rmb(hw->weak_barriers); > num = virtqueue_dequeue_rx_inorder(vq, rcv_pkts, > len, > I think you have missed another data_len update line 1554. Reviewed-by: David Marchand -- David Marchand