virtio: use soft vlan strip with mergeable Rx packets
authorOuyang Changchun <changchun.ouyang@intel.com>
Mon, 9 Feb 2015 01:14:11 +0000 (09:14 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 20 Feb 2015 18:18:56 +0000 (19:18 +0100)
To keep the consistent logic with normal Rx path, the mergeable
Rx path also needs software vlan strip/decap if it is enabled.

Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
lib/librte_pmd_virtio/virtio_rxtx.c

index adda2a8..9026cdd 100644 (file)
@@ -537,6 +537,7 @@ virtio_recv_mergeable_pkts(void *rx_queue,
                        uint16_t nb_pkts)
 {
        struct virtqueue *rxvq = rx_queue;
+       struct virtio_hw *hw = rxvq->hw;
        struct rte_mbuf *rxm, *new_mbuf;
        uint16_t nb_used, num, nb_rx = 0;
        uint32_t len[VIRTIO_MBUF_BURST_SZ];
@@ -643,6 +644,9 @@ virtio_recv_mergeable_pkts(void *rx_queue,
                        seg_res -= rcv_cnt;
                }
 
+               if (hw->vlan_strip)
+                       rte_vlan_strip(rx_pkts[nb_rx]);
+
                VIRTIO_DUMP_PACKET(rx_pkts[nb_rx],
                        rx_pkts[nb_rx]->data_len);