X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FDPPD-PROX%2Fhandle_mirror.c;h=73a5242cfc816272aa59fea552d97ca646a2d98c;hb=809edd5270e8a22f2c29d711203d579fdf7addfb;hp=8e6eb6d4ed0bec9d3f72f24d4efe8cc8d226ca71;hpb=b7541865102edde8377d3965df658da8bd638a62;p=samplevnf.git diff --git a/VNFs/DPPD-PROX/handle_mirror.c b/VNFs/DPPD-PROX/handle_mirror.c index 8e6eb6d4..73a5242c 100644 --- a/VNFs/DPPD-PROX/handle_mirror.c +++ b/VNFs/DPPD-PROX/handle_mirror.c @@ -61,17 +61,17 @@ static int handle_mirror_bulk(struct task_base *tbase, struct rte_mbuf **mbufs, rte_memcpy(mbufs2, mbufs, sizeof(mbufs[0]) * n_pkts); /* prefetch for optimization */ prox_rte_ether_hdr * hdr[MAX_PKT_BURST]; - //for (uint16_t i = 0; i < n_pkts; ++i) { - // PREFETCH0(mbufs2[i]); - //} + for (uint16_t j = 0; j < n_pkts; ++j) { + PREFETCH0(mbufs2[j]); + } for (uint16_t j = 0; j < n_pkts; ++j) { hdr[j] = rte_pktmbuf_mtod(mbufs2[j], prox_rte_ether_hdr *); PREFETCH0(hdr[j]); } for (uint16_t j = 0; j < n_pkts; ++j) { - rte_pktmbuf_refcnt_update(mbufs2[j], (task->n_dests - 1) * task->multiplier); + rte_pktmbuf_refcnt_update(mbufs2[j], task->n_dests * task->multiplier - 1); prox_rte_ipv4_hdr *pip = (prox_rte_ipv4_hdr *) (hdr[j] + 1); - if ((task->mirror_size != 0) && (hdr[j]->ether_type == RTE_ETHER_TYPE_IPV4) && ((pip->next_proto_id == IPPROTO_UDP) || (pip->next_proto_id == IPPROTO_TCP))) { + if ((task->mirror_size != 0) && (hdr[j]->ether_type == ETYPE_IPv4) && ((pip->next_proto_id == IPPROTO_UDP) || (pip->next_proto_id == IPPROTO_TCP))) { rte_pktmbuf_pkt_len(mbufs2[j]) = task->mirror_size; rte_pktmbuf_data_len(mbufs2[j]) = task->mirror_size; pip->total_length = rte_bswap16(task->mirror_size-sizeof(prox_rte_ether_hdr));