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 B4B89A0096 for ; Wed, 5 Jun 2019 11:35:08 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 951E11BA57; Wed, 5 Jun 2019 11:35:08 +0200 (CEST) Received: from mail-vs1-f66.google.com (mail-vs1-f66.google.com [209.85.217.66]) by dpdk.org (Postfix) with ESMTP id 1825A1B9FB for ; Wed, 5 Jun 2019 11:35:05 +0200 (CEST) Received: by mail-vs1-f66.google.com with SMTP id b10so15313760vsp.5 for ; Wed, 05 Jun 2019 02:35:05 -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=cplO6t0n14e8EwmnOr08tI4fHy7qI41ztorsYUBWpoA=; b=d5Nwn4CICpis+LtolkE+96LOWjwzij3pvdMyFtyclr0xXjchfuY5gu4SMfEK2/J/Zf ejhS1HAR/C3ZvOLbkl5TVCutj8Dr4mvXdqnY2R9Rjyzuhb4KulCtbY01WihiJFzeyYVe iF6nxIo5bwS4u+Rk+VfbECOjtFSlhlF65DP9lB48ZOfR2QDeYeDqZwLoeXqVvyDKRW0f kOoGsfoOEobnUZgVE1vK97Oq5i880DoOtUsdFGQZHwbAOgQQ3RhOf889TePQoGXH/pA6 YkoGnDyutT32iKpT1If8gYQCBCz5Uw5i54ajmTcWiK6jI2VJBVIrrXMII9K+nxNVFGL2 rBwg== X-Gm-Message-State: APjAAAU9E+x2vtRrmZKObnArk0fegfIYPWvxUAHMYcedatf/nx9AvkyI qm75WGv63Xj13+SCvW1j01HFt/Z0GYtsXxOwcvSCyQ== X-Google-Smtp-Source: APXvYqwqAstquXrGFs5D3KlSZo3U4NqXEzDNBP5dWw/56hEpq1YCZ9pUDjly+5etnyXp+vAR07KSuqV5yFVxqN8SVq4= X-Received: by 2002:a67:688f:: with SMTP id d137mr10877410vsc.198.1559727304515; Wed, 05 Jun 2019 02:35:04 -0700 (PDT) MIME-Version: 1.0 References: <20190605081005.15716-1-maxime.coquelin@redhat.com> <20190605081005.15716-3-maxime.coquelin@redhat.com> In-Reply-To: <20190605081005.15716-3-maxime.coquelin@redhat.com> From: David Marchand Date: Wed, 5 Jun 2019 11:34:53 +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 2/4] net/virtio: fix segmented packet issue in mergeable 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:11 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: bcac5aa207f8 ("net/virtio: improve batching in mergeable path") > 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 6b3baf0423..9469ecb743 100644 > --- a/drivers/net/virtio/virtio_rxtx.c > +++ b/drivers/net/virtio/virtio_rxtx.c > @@ -1614,7 +1614,7 @@ virtio_recv_mergeable_pkts(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 = 0; > uint32_t len[VIRTIO_MBUF_BURST_SZ]; > struct rte_mbuf *rcv_pkts[VIRTIO_MBUF_BURST_SZ]; > @@ -1721,7 +1721,6 @@ virtio_recv_mergeable_pkts(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_burst_rx(vq, rcv_pkts, len, > @@ -1738,7 +1737,6 @@ virtio_recv_mergeable_pkts(void *rx_queue, > prev->next = rxm; > prev = rxm; > rx_pkts[nb_rx]->pkt_len += len[extra_idx]; > - rx_pkts[nb_rx]->data_len += len[extra_idx]; > extra_idx += 1; > }; > seg_res -= rcv_cnt; > -- > 2.21.0 > > Idem previous patch, you have missed a data_len line 1704. Reviewed-by: David Marchand -- David Marchand