summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/tx_pkt.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2020-05-10 21:04:08 +0200
committerXavier Simonart <xavier.simonart@intel.com>2020-05-29 23:34:46 +0200
commit1614130d60abfaa89a41ba8eed5f9bbf41d9a4f4 (patch)
treea25af2c624a87aa850faa38a663f4554b0d498c7 /VNFs/DPPD-PROX/tx_pkt.c
parent08fee9c5d2e1d1f3fe14d00683c2a4b7a17e7876 (diff)
Improve performance in l3 submode
Two cases where performance has been improved - When using a gateway from a routing table (l3 submode), store the mac within the next hop table, to avoid a hash_lookup. This gives ~10% improvement. - Read tsc only once per bulk (of up to 64 packets). This gives ~10% improvement to swap, 4% to gen. In addition a small fix has been added, preventig "No route" Error to be written too aften. Change-Id: I8a7ab74a32f09c8ff47f751ee91e84afee1b2147 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/tx_pkt.c')
-rw-r--r--VNFs/DPPD-PROX/tx_pkt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/VNFs/DPPD-PROX/tx_pkt.c b/VNFs/DPPD-PROX/tx_pkt.c
index 2a4f53b2..51c1afa7 100644
--- a/VNFs/DPPD-PROX/tx_pkt.c
+++ b/VNFs/DPPD-PROX/tx_pkt.c
@@ -57,11 +57,12 @@ int tx_pkt_l3(struct task_base *tbase, struct rte_mbuf **mbufs, uint16_t n_pkts,
const struct port_queue *port_queue = &tbase->tx_params_hw.tx_port_queue[0];
struct rte_mbuf *arp_mbuf = NULL; // used when one need to send both an ARP and a mbuf
uint64_t *time;
+ uint64_t tsc = rte_rdtsc();
for (int j = 0; j < n_pkts; j++) {
if ((out) && (out[j] >= OUT_HANDLED))
continue;
- if (unlikely((rc = write_dst_mac(tbase, mbufs[j], &ip_dst, &time)) != SEND_MBUF)) {
+ if (unlikely((rc = write_dst_mac(tbase, mbufs[j], &ip_dst, &time, tsc)) != SEND_MBUF)) {
if (j - first) {
ret = tbase->aux->tx_pkt_l2(tbase, mbufs + first, j - first, out);
ok += ret;