summaryrefslogtreecommitdiff
path: root/examples/ipv4_multicast
diff options
context:
space:
mode:
authorIntel <intel.com>2013-06-03 00:00:00 +0000
committerThomas Monjalon <thomas.monjalon@6wind.com>2013-09-17 14:16:09 +0200
commit5c95261dbf79b5b03314b5477a3f3088a6934796 (patch)
treed058ee93069840f37fe80f4d15bf48d9daeb91cd /examples/ipv4_multicast
parent1c17baf48620a075caa0a2e4c19a4097cf5d9302 (diff)
downloaddpdk-5c95261dbf79b5b03314b5477a3f3088a6934796.zip
dpdk-5c95261dbf79b5b03314b5477a3f3088a6934796.tar.gz
dpdk-5c95261dbf79b5b03314b5477a3f3088a6934796.tar.xz
examples: time fixes
Signed-off-by: Intel
Diffstat (limited to 'examples/ipv4_multicast')
-rw-r--r--examples/ipv4_multicast/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 6201978..3b91011 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -113,7 +113,7 @@
#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */
#define MAX_PKT_BURST 32
-#define BURST_TX_DRAIN 200000ULL /* around 100us at 2 Ghz */
+#define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */
/* Configure how many packets ahead to prefetch, when reading packets */
#define PREFETCH_OFFSET 3
@@ -450,9 +450,10 @@ send_timeout_burst(struct lcore_queue_conf *qconf)
{
uint64_t cur_tsc;
uint8_t portid;
+ const uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1) / US_PER_S * BURST_TX_DRAIN_US;
cur_tsc = rte_rdtsc();
- if (likely (cur_tsc < qconf->tx_tsc + BURST_TX_DRAIN))
+ if (likely (cur_tsc < qconf->tx_tsc + drain_tsc))
return;
for (portid = 0; portid < MAX_PORTS; portid++) {