X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fl3fwd%2Fl3fwd_common.h;h=8e4c27218fef87d6154cd6538f686ab6bc18b0f8;hb=3cc977704be6d4db3655da5afb2e87f114cd42d3;hp=7d83ff641a242bc56932e49aaea8ce45f2df37e6;hpb=a7c528e5d71ff3f569898d268f9de129fdfc152b;p=dpdk.git diff --git a/examples/l3fwd/l3fwd_common.h b/examples/l3fwd/l3fwd_common.h index 7d83ff641a..8e4c27218f 100644 --- a/examples/l3fwd/l3fwd_common.h +++ b/examples/l3fwd/l3fwd_common.h @@ -51,7 +51,7 @@ rfc1812_process(struct rte_ipv4_hdr *ipv4_hdr, uint16_t *dp, uint32_t ptype) #endif /* DO_RFC_1812_CHECKS */ /* - * We group consecutive packets with the same destionation port into one burst. + * We group consecutive packets with the same destination port into one burst. * To avoid extra latency this is done together with some other packet * processing, but after we made a final decision about packet's destination. * To do this we maintain: @@ -76,7 +76,7 @@ rfc1812_process(struct rte_ipv4_hdr *ipv4_hdr, uint16_t *dp, uint32_t ptype) static const struct { uint64_t pnum; /* prebuild 4 values for pnum[]. */ - int32_t idx; /* index for new last updated elemnet. */ + int32_t idx; /* index for new last updated element. */ uint16_t lpv; /* add value to the last updated element. */ } gptbl[GRPSZ] = { { @@ -236,6 +236,9 @@ send_packetsx4(struct lcore_conf *qconf, uint16_t port, struct rte_mbuf *m[], /* copy rest of the packets into the TX buffer. */ len = num - n; + if (len == 0) + goto exit; + j = 0; switch (len % FWDSTEP) { while (j < len) { @@ -258,6 +261,7 @@ send_packetsx4(struct lcore_conf *qconf, uint16_t port, struct rte_mbuf *m[], } } +exit: qconf->tx_mbufs[port].len = len; }