-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001-Fixing-Pktgen-issue-at-lower-rates.patch
44 lines (36 loc) · 1.33 KB
/
0001-Fixing-Pktgen-issue-at-lower-rates.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 3b6c3c05a7c5dee92bc1fdac8105ff6348c73e93 Mon Sep 17 00:00:00 2001
From: Ashish Kashinath <[email protected]>
Date: Wed, 1 May 2019 20:57:38 +0000
Subject: [PATCH 1/3] Fixing Pktgen issue at lower rates
Pktgen is giving variabilities in timing measurements
at low rates(~10Mbps) and seems more reliable at high rates(~80Mbps).
This seems to be an aritfact of the hrtimer implementation at
different packet delays.
Signed-off-by: Ashish Kashinath <[email protected]>
---
net/core/pktgen.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 6e1e10ff4..33ff023ad 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3382,6 +3382,7 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
struct netdev_queue *txq;
struct sk_buff *skb;
int ret;
+ __u64 temp;
/* If device is offline, then don't send */
if (unlikely(!netif_running(odev) || !netif_carrier_ok(odev))) {
@@ -3490,7 +3491,11 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
refcount_add(burst, &pkt_dev->skb->users);
xmit_more:
- ret = netdev_start_xmit(pkt_dev->skb, odev, txq, --burst > 0);
+ temp = pkt_dev->sofar;
+ if(do_div(temp,11)==0)
+ ret = netdev_start_xmit(pkt_dev->skb, odev, txq, --burst > 0);
+ else
+ ret = NETDEV_TX_OK;
switch (ret) {
case NETDEV_TX_OK:
--
2.11.0