summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2019-03-06 16:36:15 +0100
committerXavier Simonart <xavier.simonart@intel.com>2019-03-06 17:17:16 +0100
commit224aad3ead4be1aa86d4af653c4c0ffff783d2ff (patch)
tree74ec2ba028023c54cee8185a3eaa900da3d85f16
parent22d1e458389ae6c6eb98d9c14c4f1cd8e2009f3d (diff)
PROX generator: performance optimization (3/4)
The Signature is now written in the pkt template instead of being written in each packet Change-Id: I58ca99ff47260b82ce9471b7a47a11edbd14c582 Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
-rw-r--r--VNFs/DPPD-PROX/handle_gen.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/VNFs/DPPD-PROX/handle_gen.c b/VNFs/DPPD-PROX/handle_gen.c
index 643c61c5..fcdbcd62 100644
--- a/VNFs/DPPD-PROX/handle_gen.c
+++ b/VNFs/DPPD-PROX/handle_gen.c
@@ -353,9 +353,10 @@ static void task_gen_apply_accur_pos(struct task_gen *task, uint8_t *pkt_hdr, ui
*(uint32_t *)(pkt_hdr + task->accur_pos) = accuracy;
}
-static void task_gen_apply_sig(struct task_gen *task, uint8_t *pkt_hdr)
+static void task_gen_apply_sig(struct task_gen *task, struct pkt_template *dst)
{
- *(uint32_t *)(pkt_hdr + task->sig_pos) = task->sig;
+ if (task->sig_pos)
+ *(uint32_t *)(dst->buf + task->sig_pos) = task->sig;
}
static void task_gen_apply_all_accur_pos(struct task_gen *task, struct rte_mbuf **mbufs, uint8_t **pkt_hdr, uint32_t count)
@@ -372,16 +373,6 @@ static void task_gen_apply_all_accur_pos(struct task_gen *task, struct rte_mbuf
}
}
-static void task_gen_apply_all_sig(struct task_gen *task, struct rte_mbuf **mbufs, uint8_t **pkt_hdr, uint32_t count)
-{
- if (!task->sig_pos)
- return;
-
- for (uint16_t j = 0; j < count; ++j) {
- task_gen_apply_sig(task, pkt_hdr[j]);
- }
-}
-
static void task_gen_apply_unique_id(struct task_gen *task, uint8_t *pkt_hdr, const struct unique_id *id)
{
struct unique_id *dst = (struct unique_id *)(pkt_hdr + task->packet_id_pos);
@@ -670,7 +661,6 @@ static int handle_gen_bulk(struct task_base *tbase, struct rte_mbuf **mbufs, uin
task_gen_build_packets(task, new_pkts, pkt_hdr, send_bulk);
task_gen_apply_all_random_fields(task, pkt_hdr, send_bulk);
task_gen_apply_all_accur_pos(task, new_pkts, pkt_hdr, send_bulk);
- task_gen_apply_all_sig(task, new_pkts, pkt_hdr, send_bulk);
task_gen_apply_all_unique_id(task, new_pkts, pkt_hdr, send_bulk);
uint64_t tsc_before_tx;
@@ -908,6 +898,7 @@ static void task_gen_reset_pkt_templates_content(struct task_gen *task)
src = &task->pkt_template_orig[i];
dst = &task->pkt_template[i];
memcpy(dst->buf, src->buf, dst->len);
+ task_gen_apply_sig(task, dst);
}
}