pipeline: add check against loops
[dpdk.git] / drivers / net / virtio / virtio_rxtx_packed.h
index 77e5cb3..5361129 100644 (file)
@@ -125,13 +125,12 @@ virtqueue_enqueue_single_packed_vec(struct virtnet_tx *txvq,
         * any_layout => number of segments
         * default    => number of segments + 1
         */
-       slots = use_indirect ? 1 : (txm->nb_segs + !can_push);
        can_push = rte_mbuf_refcnt_read(txm) == 1 &&
                   RTE_MBUF_DIRECT(txm) &&
                   txm->nb_segs == 1 &&
                   rte_pktmbuf_headroom(txm) >= hdr_size;
 
-       slots = txm->nb_segs + !can_push;
+       slots = use_indirect ? 1 : (txm->nb_segs + !can_push);
        need = slots - vq->vq_free_cnt;
 
        /* Positive value indicates it need free vring descriptors */
@@ -166,7 +165,7 @@ virtio_vec_rx_offload(struct rte_mbuf *m, struct virtio_net_hdr *hdr)
                return 0;
 
        /* GSO not support in vec path, skip check */
-       m->ol_flags |= PKT_RX_IP_CKSUM_UNKNOWN;
+       m->ol_flags |= RTE_MBUF_F_RX_IP_CKSUM_UNKNOWN;
 
        ptype = rte_net_get_ptype(m, &hdr_lens, RTE_PTYPE_ALL_MASK);
        m->packet_type = ptype;
@@ -178,7 +177,7 @@ virtio_vec_rx_offload(struct rte_mbuf *m, struct virtio_net_hdr *hdr)
        if (hdr->flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
                hdrlen = hdr_lens.l2_len + hdr_lens.l3_len + hdr_lens.l4_len;
                if (hdr->csum_start <= hdrlen && l4_supported) {
-                       m->ol_flags |= PKT_RX_L4_CKSUM_NONE;
+                       m->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_NONE;
                } else {
                        /* Unknown proto or tunnel, do sw cksum. We can assume
                         * the cksum field is in the first segment since the
@@ -200,7 +199,7 @@ virtio_vec_rx_offload(struct rte_mbuf *m, struct virtio_net_hdr *hdr)
                                        off) = csum;
                }
        } else if (hdr->flags & VIRTIO_NET_HDR_F_DATA_VALID && l4_supported) {
-               m->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
+               m->ol_flags |= RTE_MBUF_F_RX_L4_CKSUM_GOOD;
        }
 
        return 0;