summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/tx_pkt.c
diff options
context:
space:
mode:
authorXavier Simonart <xavier.simonart@intel.com>2020-04-29 01:22:10 +0200
committerXavier Simonart <xavier.simonart@intel.com>2020-05-29 23:28:44 +0200
commit9e0c77ef5b6569b8db31269916102f5219bffdc9 (patch)
treef61fe61e20dbd0bfe255d62c5290088bb015c9f2 /VNFs/DPPD-PROX/tx_pkt.c
parentca250755c6ecad89fc30507a4c6707eedc658f5d (diff)
Improve ctrlplane performance
The crlplane performance has been improved. This is necessary when handling many IP in L3 mode (i.e. many ARP Requests/Replies). Before this change, arp timer was updated as soon as an arp request was tentativaly sent to the master. This means that, if the request failed to be sent (e.g. ring full) we had to wait arp_update_time (default 1sec) before trying again. Now arp_update_time is only used when an arp reply is received. If a request has been successfully sent, then the arp timer is updated by 1 second (i.e. we will not send any arp reuest for this IP within this second) If we failed to send the request, then the timer is updated by 100 msec which means we will wait 100 msec before trying again. A too high value here would have meant that we have to wait a long time before trying again. A too short value overload the master ring with request to transmit ARP requests, so that master is unable to handle arp replies. arp_update_time is now also partly randomized to avoid all IPs to request arp request at the beginning of the test. So if arp_update_time is 10 sec then the configuration sets it to 5 to 15 sec. As a final note the following parameter (already implemented before) can be changed to improve ctrlplane performance (at the cost of dataplane) ctrl path polling frequency=10000 Change-Id: I9660458a22e7442eaa0c83aaa0c9893a15069f98 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.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/VNFs/DPPD-PROX/tx_pkt.c b/VNFs/DPPD-PROX/tx_pkt.c
index e789d305..8bf501f6 100644
--- a/VNFs/DPPD-PROX/tx_pkt.c
+++ b/VNFs/DPPD-PROX/tx_pkt.c
@@ -56,11 +56,12 @@ int tx_pkt_l3(struct task_base *tbase, struct rte_mbuf **mbufs, uint16_t n_pkts,
int first = 0, ret, ok = 0, rc;
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;
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)) != SEND_MBUF)) {
+ if (unlikely((rc = write_dst_mac(tbase, mbufs[j], &ip_dst, &time)) != SEND_MBUF)) {
if (j - first) {
ret = tbase->aux->tx_pkt_l2(tbase, mbufs + first, j - first, out);
ok += ret;
@@ -70,14 +71,20 @@ int tx_pkt_l3(struct task_base *tbase, struct rte_mbuf **mbufs, uint16_t n_pkts,
case SEND_ARP:
// We re-use the mbuf - no need to create a arp_mbuf and delete the existing mbuf
mbufs[j]->port = tbase->l3.reachable_port_id;
- tx_ring_cti(tbase, tbase->l3.ctrl_plane_ring, REQ_MAC_TO_CTRL, mbufs[j], tbase->l3.core_id, tbase->l3.task_id, ip_dst);
+ if (tx_ring_cti(tbase, tbase->l3.ctrl_plane_ring, REQ_MAC_TO_CTRL, mbufs[j], tbase->l3.core_id, tbase->l3.task_id, ip_dst) == 0)
+ update_arp_update_time(&tbase->l3, time, 1000);
+ else
+ update_arp_update_time(&tbase->l3, time, 100);
break;
case SEND_MBUF_AND_ARP:
// We send the mbuf and an ARP - we need to allocate another mbuf for ARP
ret = rte_mempool_get(tbase->l3.arp_pool, (void **)&arp_mbuf);
if (likely(ret == 0)) {
arp_mbuf->port = tbase->l3.reachable_port_id;
- tx_ring_cti(tbase, tbase->l3.ctrl_plane_ring, REQ_MAC_TO_CTRL, arp_mbuf, tbase->l3.core_id, tbase->l3.task_id, ip_dst);
+ if (tx_ring_cti(tbase, tbase->l3.ctrl_plane_ring, REQ_MAC_TO_CTRL, arp_mbuf, tbase->l3.core_id, tbase->l3.task_id, ip_dst) == 0)
+ update_arp_update_time(&tbase->l3, time, 1000);
+ else
+ update_arp_update_time(&tbase->l3, time, 100);
} else {
plog_err("Failed to get a mbuf from arp mempool\n");
// We still send the initial mbuf
@@ -805,7 +812,7 @@ static inline int tx_ring_all(struct task_base *tbase, struct rte_ring *ring, ui
return rte_ring_enqueue(ring, mbuf);
}
-void tx_ring_cti(struct task_base *tbase, struct rte_ring *ring, uint16_t command, struct rte_mbuf *mbuf, uint8_t core_id, uint8_t task_id, uint32_t ip)
+int tx_ring_cti(struct task_base *tbase, struct rte_ring *ring, uint16_t command, struct rte_mbuf *mbuf, uint8_t core_id, uint8_t task_id, uint32_t ip)
{
plogx_dbg("\tSending command %s with ip %d.%d.%d.%d to ring %p using mbuf %p, core %d and task %d - ring size now %d\n", actions_string[command], IP4(ip), ring, mbuf, core_id, task_id, rte_ring_free_count(ring));
int ret = tx_ring_all(tbase, ring, command, mbuf, core_id, task_id, ip);
@@ -814,6 +821,7 @@ void tx_ring_cti(struct task_base *tbase, struct rte_ring *ring, uint16_t comman
TASK_STATS_ADD_DROP_DISCARD(&tbase->aux->stats, 1);
rte_pktmbuf_free(mbuf);
}
+ return ret;
}
void tx_ring_ip(struct task_base *tbase, struct rte_ring *ring, uint16_t command, struct rte_mbuf *mbuf, uint32_t ip)