From: Didier Pallard Date: Wed, 28 Mar 2018 15:43:45 +0000 (+0200) Subject: net/vmxnet3: fix Rx offload information in multiseg packets X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d08e3c90d4e0a37618a5174c712dee1bf3cb73a3;p=dpdk.git net/vmxnet3: fix Rx offload information in multiseg packets In case we are working on a multisegment buffer, most bit are set in last segment of the buffer. Correctly look at those bits in eop part of the rx_offload function. Fixes: 2fdd835f992c ("vmxnet3: support jumbo frames") Cc: stable@dpdk.org Signed-off-by: Didier Pallard Acked-by: Yong Wang --- diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index 84f348fa05..c0dad2d6c0 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -656,12 +656,19 @@ vmxnet3_rx_offload(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd, /* Offloads set in sop */ if (sop) { + } else { /* Offloads set in eop */ /* Check for RSS */ if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE) { rxm->ol_flags |= PKT_RX_RSS_HASH; rxm->hash.rss = rcd->rssHash; } + /* Check for hardware stripped VLAN tag */ + if (rcd->ts) { + rxm->ol_flags |= (PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED); + rxm->vlan_tci = rte_le_to_cpu_16((uint16_t)rcd->tci); + } + /* Check packet type, checksum errors. Only IPv4 for now. */ if (rcd->v4) { rxm->packet_type = RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; @@ -676,12 +683,6 @@ vmxnet3_rx_offload(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd, } else { rxm->packet_type = RTE_PTYPE_UNKNOWN; } - } else { /* Offloads set in eop */ - /* Check for hardware stripped VLAN tag */ - if (rcd->ts) { - rxm->ol_flags |= (PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED); - rxm->vlan_tci = rte_le_to_cpu_16((uint16_t)rcd->tci); - } } }