Skip to contentSkip to conversation

Constant errors with pktgen

DISCUSSION Applied cliff white 3 participants 4 messages Mar 14, 2005 – Mar 16, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Robert.

I am doing some wrapper scripts for pktgen for some testing purposes.

My test rig is two machines with an e100 card, connected by crossover cable.

When i run pktgen, the error counter == packet count, always.

Adding printk's, i see the error is coming from this bit past line 2688:
----------

                now = getCurUs();
                if (now > pkt_dev->next_tx_us) {
                        /* TODO: this code is slightly wonky.  */
                        pkt_dev->errors++;
                        pkt_dev->next_tx_us = now - pkt_dev->delay_us;
                        pkt_dev->next_tx_ns = 0;
                }

----------------
Any suggestions? More info if needed..
cliffw

Signature · 2 lines
"Ive always gone through periods where I bolt upright at four in the morning; 
now at least theres a reason." -Michael Feldman
#1 lore raw
Quoted 4 lines · cliff white

My test rig is two machines with an e100 card, connected by crossover cable.

When i run pktgen, the error counter == packet count, always.

I see. Try the patch patch below it cleans up the code a bit and restores the old meaning of error. It also has the minor fix from Adrian Bunk

						--ro
core/pktgen.c renamed from core/pktgen.c.050315 +6 -13
@@ -151,7 +151,7 @@
 #include <asm/timex.h>
 
 
-#define VERSION  "pktgen v2.60: Packet Generator for packet performance testing.\n"
+#define VERSION  "pktgen v2.61: Packet Generator for packet performance testing.\n"
 
 /* #define PG_DEBUG(a) a */
 #define PG_DEBUG(a) 
@@ -2590,7 +2590,7 @@
         thread_unlock();
 }
 
-__inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
+static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
 {
 	struct net_device *odev = NULL;
 	__u64 idle_start = 0;
@@ -2654,7 +2654,6 @@
 	
 	spin_lock_bh(&odev->xmit_lock);
 	if (!netif_queue_stopped(odev)) {
-		u64 now;
 
 		atomic_inc(&(pkt_dev->skb->users));
 retry_now:
@@ -2678,24 +2677,18 @@
 			
 			pkt_dev->errors++;
 			pkt_dev->last_ok = 0;
-			pkt_dev->next_tx_us = getCurUs(); /* TODO */
-			pkt_dev->next_tx_ns = 0;
 		}
 
+		pkt_dev->next_tx_us = getCurUs();
+		pkt_dev->next_tx_ns = 0;
+
 		pkt_dev->next_tx_us += pkt_dev->delay_us;
 		pkt_dev->next_tx_ns += pkt_dev->delay_ns;
+
 		if (pkt_dev->next_tx_ns > 1000) {
 			pkt_dev->next_tx_us++;
 			pkt_dev->next_tx_ns -= 1000;
 		}
-
-		now = getCurUs();
-		if (now > pkt_dev->next_tx_us) {
-			/* TODO: this code is slightly wonky.  */
-			pkt_dev->errors++;
-			pkt_dev->next_tx_us = now - pkt_dev->delay_us;
-			pkt_dev->next_tx_ns = 0;
-		}
 	} 
 
 	else {  /* Retry it next time */
#2 lore raw
Quoted 12 lines · On Tue, 15 Mar 2005 16:39:18 +0100 Robert Olsson <[email protected]>…
Quoted 4 lines · cliff white

My test rig is two machines with an e100 card, connected by crossover cable.

When i run pktgen, the error counter == packet count, always.

I see. Try the patch patch below it cleans up the code a bit and restores the old meaning of error. It also has the minor fix from Adrian Bunk

Works for me
Current:

     pkts-sofar: 7400227  errors: 0

( now i have to force some errors... )
cliffw

Quoted 60 lines
						--ro
core/pktgen.c renamed from core/pktgen.c.050315 +6 -13
@@ -151,7 +151,7 @@
 #include <asm/timex.h>
 
 
-#define VERSION  "pktgen v2.60: Packet Generator for packet performance testing.\n"
+#define VERSION  "pktgen v2.61: Packet Generator for packet performance testing.\n"
 
 /* #define PG_DEBUG(a) a */
 #define PG_DEBUG(a) 
@@ -2590,7 +2590,7 @@
         thread_unlock();
 }
 
-__inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
+static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
 {
 	struct net_device *odev = NULL;
 	__u64 idle_start = 0;
@@ -2654,7 +2654,6 @@
 
 	spin_lock_bh(&odev->xmit_lock);
 	if (!netif_queue_stopped(odev)) {
-		u64 now;
 
 		atomic_inc(&(pkt_dev->skb->users));
 retry_now:
@@ -2678,24 +2677,18 @@
 
 			pkt_dev->errors++;
 			pkt_dev->last_ok = 0;
-			pkt_dev->next_tx_us = getCurUs(); /* TODO */
-			pkt_dev->next_tx_ns = 0;
 		}
 
+		pkt_dev->next_tx_us = getCurUs();
+		pkt_dev->next_tx_ns = 0;
+
 		pkt_dev->next_tx_us += pkt_dev->delay_us;
 		pkt_dev->next_tx_ns += pkt_dev->delay_ns;
+
 		if (pkt_dev->next_tx_ns > 1000) {
 			pkt_dev->next_tx_us++;
 			pkt_dev->next_tx_ns -= 1000;
 		}
-
-		now = getCurUs();
-		if (now > pkt_dev->next_tx_us) {
-			/* TODO: this code is slightly wonky.  */
-			pkt_dev->errors++;
-			pkt_dev->next_tx_us = now - pkt_dev->delay_us;
-			pkt_dev->next_tx_ns = 0;
-		}
 	} 
 
 	else {  /* Retry it next time */
Signature · 2 lines
"Ive always gone through periods where I bolt upright at four in the morning; 
now at least theres a reason." -Michael Feldman
maintainer Applied
#3 lore raw
In reply to Robert Olsson
Quoted 11 lines · On Tue, 15 Mar 2005 16:39:18 +0100 Robert Olsson <[email protected]>…
Quoted 4 lines · cliff white

My test rig is two machines with an e100 card, connected by crossover cable.

When i run pktgen, the error counter == packet count, always.

I see. Try the patch patch below it cleans up the code a bit and restores the old meaning of error. It also has the minor fix from Adrian Bunk

Applied, thanks Robert.