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 45EC1A0096 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 2835F1B9F0; Wed, 5 Jun 2019 11:34:58 +0200 (CEST) Received: from mail-vs1-f65.google.com (mail-vs1-f65.google.com [209.85.217.65]) by dpdk.org (Postfix) with ESMTP id BFD3E1B9BD for ; Wed, 5 Jun 2019 11:34:56 +0200 (CEST) Received: by mail-vs1-f65.google.com with SMTP id b10so15313587vsp.5 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=NFx6NRy7S1mlhbyU0xktYAKacxvvzs/dMCtuQaqgSMn6lOm+JmuMK64iijnU9plJpW nnQecDUCFmwYC+GxfnZMsssShpRbLHN9udHuP7IZAU1d1tq/rHmyVuL+i9/H0q0zyeSD HhamSUUs1rfrXNIxsoi2Oayz42lrsZk5+zqaxy8QrGv5xTlqngxsezl3r4FtY3yunHk7 PJi1vnL/KbdrsqwQlZQt2lGWsy4+JftQH9OpqV2z4upTMErH6LBv4KXUuJRtLK+bA2ZN 7UZBMSV73GnO+nYT/q9qhmiENK5iN2vUlJmcjY+0Sjm/GIFEZp/c+gQGMl7JJqSSLjZm tS7A== X-Gm-Message-State: APjAAAUa0r3Tlnlq+Co3XM2/BAq2vLNWDa9u8KPLtqJFRyKHP8V6hieP 5oRvxICpAE4bOuI65t82TKW50qj3K3vdOWNMZwEAwA== 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-dev] [dpdk-stable] [PATCH v2 1/4] net/virtio: fix segmented packet issue in in-order Rx path X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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