From: John Guzik Date: Tue, 12 Apr 2016 23:08:04 +0000 (-0700) Subject: net/vmxnet3: fix VLAN tag placed in wrong mbuf in chain X-Git-Tag: spdx-start~6569 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ce82dc6bd526bccc2d5e9e59214167c4287f049d;p=dpdk.git net/vmxnet3: fix VLAN tag placed in wrong mbuf in chain The VLAN tag information should be stored in the first mbuf of a chain of buffers, not in the last one. Fixes: 9fd5e98b62e4 ("vmxnet3: support RSS and refactor Rx offload") Signed-off-by: John Guzik Acked-by: Yong Wang --- diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index ccafc0c2ff..b74132d424 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -577,12 +577,6 @@ vmxnet3_post_rx_bufs(vmxnet3_rx_queue_t *rxq, uint8_t ring_id) static void vmxnet3_rx_offload(const Vmxnet3_RxCompDesc *rcd, struct rte_mbuf *rxm) { - /* Check for hardware stripped VLAN tag */ - if (rcd->ts) { - rxm->ol_flags |= (PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED); - rxm->vlan_tci = rte_le_to_cpu_16((uint16_t)rcd->tci); - } - /* Check for RSS */ if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE) { rxm->ol_flags |= PKT_RX_RSS_HASH; @@ -728,7 +722,15 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rxq->last_seg = rxm; if (rcd->eop) { - rx_pkts[nb_rx++] = rxq->start_seg; + struct rte_mbuf *start = rxq->start_seg; + + /* Check for hardware stripped VLAN tag */ + if (rcd->ts) { + start->ol_flags |= (PKT_RX_VLAN_PKT | PKT_RX_VLAN_STRIPPED); + start->vlan_tci = rte_le_to_cpu_16((uint16_t)rcd->tci); + } + + rx_pkts[nb_rx++] = start; rxq->start_seg = NULL; }