net/vmxnet3: fix Rx offload information in multiseg packets
authorDidier Pallard <didier.pallard@6wind.com>
Wed, 28 Mar 2018 15:43:45 +0000 (17:43 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 27 Apr 2018 16:34:41 +0000 (17:34 +0100)
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 <didier.pallard@6wind.com>
Acked-by: Yong Wang <yongwang@vmware.com>
drivers/net/vmxnet3/vmxnet3_rxtx.c

index 84f348f..c0dad2d 100644 (file)
@@ -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);
-               }
        }
 }