From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f171.google.com (mail-pf0-f171.google.com [209.85.192.171]) by dpdk.org (Postfix) with ESMTP id 7C8CD1396 for ; Fri, 4 Dec 2015 02:12:46 +0100 (CET) Received: by pfdd184 with SMTP id d184so17231518pfd.3 for ; Thu, 03 Dec 2015 17:12:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2XwLJEZ6xSc2+MaD5YeZzaUNXAyr56kqHQ3CSh5PHFA=; b=R5uAMkMGWv6B3USb4d4ohew037pijV2dZgFSizbXbjPEwYmYwVFW2M0yORael/Z6NG k3FEOURQV5iTxHyONDPZ1hL0JONZT1jU6w8E696sN4O8dhg3zTDN7FmiHfV1Cf35VM1A 4jlmMtZiWtfgYBZfulpfo20e2/IV8H2OaX0QXtUNwvLNeo59TBK/ozyRkzOnIUzE3WdU k18gp2gw9NZeTi4xqt1LzzRjFsXkyf+p2aQZsd3n22zSv9D96EUETrF/1jE6AE3NyRKj FmBFBYz5Wz15fkkDcJ+9MioTynXAAdZ1OKY1y91asMLqfKB3jGFu/DafbsqR4XJxpU2L WZ7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2XwLJEZ6xSc2+MaD5YeZzaUNXAyr56kqHQ3CSh5PHFA=; b=jYNF7O5iYMCJPxfzI0NJsaNqbyTZ/rjCKX9TUtI3o1m8jjSlR45FQNxvy1Z83hjH5d Tv3hjQ27lxmuwYf/9UUSkQUCuy8ZXhsq85eD1IKQI0wX7kO2MLq3cJiokJznJuGlwqn+ 03VfYQre2OyCKuiTOgaw+zxMZI1PHIrzYsa/lmzSJjY3aoyZ2iK6TcgoWH+McirSzX1o J4x8mSEu3i8fC3+xgG15BVk4jhYjP3J2n2bxPWkiI5t/skZF8tv5cFiYaK1KHd+oXZ04 5gVnB9PAFQwA6La1ozxQRn5aJr2Zb/m/gG28hUOEVNgAaOJYkP+NvS2/b7/WLCPq5mH5 t9Jg== X-Gm-Message-State: ALoCoQkUoLo8Ada7+lsT2J9jIHItN+5P8ij1gg8CsgjZNRTALugJBQzb6qPhH+rt9SqCxcpBGC39 X-Received: by 10.98.14.155 with SMTP id 27mr17659011pfo.92.1449191565913; Thu, 03 Dec 2015 17:12:45 -0800 (PST) Received: from xeon-e3.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id b15sm13110257pfj.7.2015.12.03.17.12.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Dec 2015 17:12:45 -0800 (PST) From: Stephen Hemminger To: huawei.xie@intel.com, yuanhan.liu@linux.intel.com Date: Thu, 3 Dec 2015 17:12:53 -0800 Message-Id: <1449191574-14629-2-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449191574-14629-1-git-send-email-stephen@networkplumber.org> References: <1449191574-14629-1-git-send-email-stephen@networkplumber.org> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH 1/2] virtio: make sure rcv mbuf initialized correctly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 01:12:46 -0000 The virtio driver was not initializing all the fields in the receive mbuf. This would cause bugs where previous usage of mbuf would leave stale TCI and offload flags. Signed-off-by: Stephen Hemminger --- drivers/net/virtio/virtio_rxtx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 5770fa2..466fee6 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -611,6 +611,8 @@ virtio_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rxm->port = rxvq->port_id; rxm->data_off = RTE_PKTMBUF_HEADROOM; + rxm->ol_flags = 0; + rxm->vlan_tci = 0; rxm->nb_segs = 1; rxm->next = NULL; @@ -731,6 +733,8 @@ virtio_recv_mergeable_pkts(void *rx_queue, rxm->data_off = RTE_PKTMBUF_HEADROOM; rxm->nb_segs = seg_num; rxm->next = NULL; + rxm->ol_flags = 0; + rxm->vlan_tci = 0; rxm->pkt_len = (uint32_t)(len[0] - hdr_size); rxm->data_len = (uint16_t)(len[0] - hdr_size); -- 2.1.4