Skip to contentSkip to conversation

Pktgen for 2.5.44

PATCH In review Lucio Maciel 5 participants 7 messages Oct 29, 2002 – Nov 2, 2002

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

PATCH 1/1 Pktgen for 2.5.44

Hello...

I have ported (integrated sounds better i think...) pktgen from 2.4.20-rc1 to 2.5.44...

I only need to change current->need_resched to need_resched() in the source... works fine for me....

I also correct the documentation changing multiskb to clone_skb

best regards

Signature · 4 lines
::: Lucio F. Maciel
::: [email protected]
::: icq 93065464
::: Absoluta.net
Documentation/networking/pktgen.txt +77 -0
diff -Naur -X /root/dontdiff linux-2.5.44-ori/Documentation/networking/pktgen.txt linux-2.5.44/Documentation/networking/pktgen.txt
@@ -0,0 +1,77 @@
+How to use the Linux packet generator module.
+
+1. Enable CONFIG_NET_PKTGEN to compile and build pktgen.o, install it
+   in the place where insmod may find it.
+2. Cut script "ipg" (see below).
+3. Edit script to set preferred device and destination IP address.
+3a.  Create more scripts for different interfaces.  Up to thirty-two
+     pktgen processes can be configured and run at once by using the
+     32 /proc/net/pktgen/pg* files.
+4. Run in shell: ". ipg"
+5. After this two commands are defined:
+   A. "pg" to start generator and to get results.
+   B. "pgset" to change generator parameters. F.e.
+      pgset "clone_skb 100"   sets the number of coppies of the same packet 
+                              will be sent before a new packet is allocated
+      pgset "clone_skb 0"     use multiple SKBs for packet generation
+      pgset "pkt_size 9014"   sets packet size to 9014
+      pgset "frags 5"         packet will consist of 5 fragments
+      pgset "count 200000"    sets number of packets to send, set to zero
+                              for continious sends untill explicitly
+                              stopped.
+      pgset "ipg 5000"        sets artificial gap inserted between packets
+                              to 5000 nanoseconds
+      pgset "dst 10.0.0.1"    sets IP destination address
+                              (BEWARE! This generator is very aggressive!)
+      pgset "dst_min 10.0.0.1"            Same as dst
+      pgset "dst_max 10.0.0.254"          Set the maximum destination IP.
+      pgset "src_min 10.0.0.1"            Set the minimum (or only) source IP.
+      pgset "src_max 10.0.0.254"          Set the maximum source IP.
+      pgset "dstmac 00:00:00:00:00:00"    sets MAC destination address
+      pgset "srcmac 00:00:00:00:00:00"    sets MAC source address
+      pgset "src_mac_count 1" Sets the number of MACs we'll range through.  The
+                              'minimum' MAC is what you set with srcmac.
+      pgset "dst_mac_count 1" Sets the number of MACs we'll range through.  The
+                              'minimum' MAC is what you set with dstmac.
+      pgset "flag [name]"     Set a flag to determine behaviour.  Current flags
+                              are: IPSRC_RND #IP Source is random (between min/max),
+                                   IPDST_RND, UDPSRC_RND,
+                                   UDPDST_RND, MACSRC_RND, MACDST_RND 
+      pgset "udp_src_min 9"   set UDP source port min, If < udp_src_max, then
+                              cycle through the port range.
+      pgset "udp_src_max 9"   set UDP source port max.
+      pgset "udp_dst_min 9"   set UDP destination port min, If < udp_dst_max, then
+                              cycle through the port range.
+      pgset "udp_dst_max 9"   set UDP destination port max.
+      pgset stop    	      aborts injection
+      
+  Also, ^C aborts generator.
+
+---- cut here
+
+#! /bin/sh
+
+modprobe pktgen
+
+PGDEV=/proc/net/pktgen/pg0
+
+function pgset() {
+    local result
+
+    echo $1 > $PGDEV
+
+    result=`cat $PGDEV | fgrep "Result: OK:"`
+    if [ "$result" = "" ]; then
+         cat $PGDEV | fgrep Result:
+    fi
+}
+
+function pg() {
+    echo inject > $PGDEV
+    cat $PGDEV
+}
+
+pgset "odev eth0"
+pgset "dst 0.0.0.0"
+
+---- cut here
arch/i386/defconfig +5 -0
diff -Naur -X /root/dontdiff linux-2.5.44-ori/arch/i386/defconfig linux-2.5.44/arch/i386/defconfig
@@ -443,6 +443,11 @@
 # CONFIG_NET_SCHED is not set
 
 #
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+
+#
 # Network device support
 #
 CONFIG_NETDEVICES=y
net/Config.help +15 -0
diff -Naur -X /root/dontdiff linux-2.5.44-ori/net/Config.help linux-2.5.44/net/Config.help
@@ -512,3 +512,18 @@
   performance will be written to /proc/net/profile. If you don't know
   what it is about, you don't need it: say N.
 
+CONFIG_NET_PKTGEN
+  This module will inject preconfigured packets, at a configurable
+  rate, out of a given interface.  It is used for network interface
+  stress testing and performance analysis.  If you don't understand
+  what was just said, you don't need it: say N.
+
+  Documentation on how to use the packet generator can be found
+  at <file:Documentation/networking/pktgen.txt>.
+
+  This code is also available as a module called pktgen.o ( = code
+  which can be inserted in and removed from the running kernel
+  whenever you want).  If you want to compile it as a module, say M
+  here and read <file:Documentation/modules.txt>.
+
+
net/Config.in +6 -0
diff -Naur -X /root/dontdiff linux-2.5.44-ori/net/Config.in linux-2.5.44/net/Config.in
@@ -93,4 +93,10 @@
 #bool 'Network code profiler' CONFIG_NET_PROFILE
 endmenu
 
+mainmenu_option next_comment
+comment 'Network testing'
+tristate 'Packet Generator (USE WITH CAUTION)' CONFIG_NET_PKTGEN
+endmenu
+
+
 endmenu
net/core/Makefile +1 -0
diff -Naur -X /root/dontdiff linux-2.5.44-ori/net/core/Makefile linux-2.5.44/net/core/Makefile
@@ -17,6 +17,7 @@
 obj-$(CONFIG_NETFILTER) += netfilter.o
 obj-$(CONFIG_NET_DIVERT) += dv.o
 obj-$(CONFIG_NET_PROFILE) += profile.o
+obj-$(CONFIG_NET_PKTGEN) += pktgen.o
 obj-$(CONFIG_NET_RADIO) += wireless.o
 # Ugly. I wish all wireless drivers were moved in drivers/net/wireless
 obj-$(CONFIG_NET_PCMCIA_RADIO) += wireless.o
net/core/pktgen.c +1388 -0

1,388 lines not on this page · raw message

#1 lore raw

PATCH 1/1 Pktgen for 2.5.44

Quoted 11 lines

Hello...

I have ported (integrated sounds better i think...) pktgen from 2.4.20-rc1 to 2.5.44...

I only need to change current->need_resched to need_resched() in the source... works fine for me....

I also correct the documentation changing multiskb to clone_skb best regards

Thanks!

There is also work going on with a "threaded" version with one process per CPU a la ksoftirqd. And to each thread/CPU you can add single or multiple devices.

But this work needs some more time. So your patch should be fine now.

Cheers.

						--ro
#2 lore raw

Kernel bug in 2.4.7-10smp...

Hi:

I'm using RH Linux 7.2 (kernel 2.4.7-10smp) in one Compaq Proliant ML570 with 4 Xeon procesors at 900MHz and one Compaq Smart Array 5300 Controller with 6x73 GB SCSI disk with ext3 filesystem.

It was working OK, but I have one trouble, description below, and the computer it's stopped. Could someone help me? How could I fix it?

Oct 20 04:13:24 virtual3 kernel: Unable to handle kernel paging request
at virtual address a5e7ba0b
Oct 20 04:13:24 virtual3 kernel: printing eip:
Oct 20 04:13:24 virtual3 kernel: c0144d00
Oct 20 04:13:24 virtual3 kernel: *pde = 00000000
Oct 20 04:13:24 virtual3 kernel: Oops: 0000
Oct 20 04:13:24 virtual3 kernel: CPU: 0
Oct 20 04:13:24 virtual3 kernel: EIP: 0010:[cdfind+16/48]
Oct 20 04:13:24 virtual3 kernel: EIP: 0010:[]
Oct 20 04:13:24 virtual3 kernel: EFLAGS: 00010287
Oct 20 04:13:24 virtual3 kernel: eax: a5e7b9ff ebx: f5c898c0 ecx:
00004402 edx: c0313630
Oct 20 04:13:24 virtual3 kernel: esi: f5c898c0 edi: 00004402 ebp:
c0313630 esp: d80dbe04
Oct 20 04:13:24 virtual3 kernel: ds: 0018 es: 0018 ss: 0018
Oct 20 04:13:24 virtual3 kernel: Process updatedb (pid: 30973,
stackpage=d80db000)
Oct 20 04:13:24 virtual3 kernel: Stack: c0144d60 00004402 c0313630
000000b0 f5c898c0 f5c898c0 00004402 f6a7dc00
Oct 20 04:13:24 virtual3 kernel: c013d079 00004402 00000000 f88573a3
f5c898c0 00002180 00004402 f67a1de0
Oct 20 04:13:24 virtual3 kernel: f679e354 00000282 00000000 c09aec60
d934ad80 00000002 c0152fbf 00000000
Oct 20 04:13:24 virtual3 kernel: Call Trace: [cdget+64/224]

[init_special_inode+57/192] [eepro100:__insmod_eepro100_O/lib/modules/2.4.7-10smp/kernel/drivers/+-62166 1/96]
[get_new_inode+79/384] [get_new_inode+227/384]

Oct 20 04:13:24 virtual3 kernel: Call Trace: [] [] [] [] []
Oct 20 04:13:24 virtual3 kernel: [iget4+217/240]

[eepro100:__insmod_eepro100_O/lib/modules/2.4.7-10smp/kernel/drivers/+-61714 4/96]
[real_lookup+115/272] [path_walk+1646/2288] [__user_walk+58/96] [sys_lstat64+19/112]

Oct 20 04:13:24 virtual3 kernel: [] [] [] [] [] []
Oct 20 04:13:24 virtual3 kernel: [error_code+56/64] [system_call+51/56]
Oct 20 04:13:24 virtual3 kernel: [] []
Oct 20 04:13:24 virtual3 kernel:
Oct 20 04:13:24 virtual3 kernel: Code: 66 39 48 0c 75 0a f0 ff 40 08 c3
90 8d 74 26 00 8b 00 39 d0
Oct 20 15:21:11 virtual3 kernel: <5>ENOMEM in
journal_get_undo_access_Rsmp_b86db3be, retrying.
Oct 20 15:58:12 virtual3 kernel: ENOMEM in
journal_get_undo_access_Rsmp_b86db3be, retrying.
Oct 20 15:59:33 virtual3 kernel: ENOMEM in do_get_write_access,
retrying.
Oct 20 16:09:35 virtual3 kernel: ENOMEM in
journal_get_undo_access_Rsmp_b86db3be, retrying.
Oct 20 17:33:15 virtual3 kernel: ENOMEM in
journal_get_undo_access_Rsmp_b86db3be, retrying.
Oct 20 17:59:53 virtual3 kernel: ENOMEM in
journal_get_undo_access_Rsmp_b86db3be, retrying.
Oct 20 18:28:11 virtual3 kernel: ENOMEM in do_get_write_access,
retrying.
Oct 20 19:02:55 virtual3 kernel: ENOMEM in
journal_get_undo_access_Rsmp_b86db3be, retrying.
Oct 20 20:37:57 virtual3 kernel: ENOMEM in

journal_get_undo_access_Rsmp_b86db3be, retrying.

Best regards,

-Adriano (bryam)
--
Adriano M. Galano Diez
System & Network Engineer
http://www.satec.es
Phone: (+34) 917 089 000
Sourceforge.NET Linux Kernel Foundry Guide http://sf.net/foundry/linuxkernel

#3 lore raw

Re: Kernel bug in 2.4.7-10smp...

Quoted 8 lines · Adriano Galano

Hi:

I'm using RH Linux 7.2 (kernel 2.4.7-10smp) in one Compaq Proliant ML570 with 4 Xeon procesors at 900MHz and one Compaq Smart Array 5300 Controller with 6x73 GB SCSI disk with ext3 filesystem.

It was working OK, but I have one trouble, description below, and the computer it's stopped. Could someone help me? How could I fix it?

Well you could try one of the kernel updates that Red Hat put out for this release.

#4 lore raw

RE: Kernel bug in 2.4.7-10smp...

Quoted 3 lines · Adriano Galano
Quoted 2 lines

Hi:

Hi Alan:

Quoted 4 lines
Quoted 1 line

I'm using RH Linux 7.2 (kernel 2.4.7-10smp) in one Compaq

Proliant ML570

Quoted 1 line

with 4 Xeon procesors at 900MHz and one Compaq Smart Array

5300 Controller

Quoted 9 lines
Quoted 3 lines

with 6x73 GB SCSI disk with ext3 filesystem.

It was working OK, but I have one trouble, description

below, and the

Quoted 1 line

computer it's stopped. Could someone help me? How could I fix it?

Well you could try one of the kernel updates that Red Hat put out for this release.

I don't apply the patches for possible incompatibility with Compaq Remote Insight Manager card, the drivers of this card are for 2.4.7
(http://www.compaq.com/support/files/server/us/download/15084.html). Now I'm trying to make one upgrade to 2.4.18 recompiling the drivers source... Why happen this errors in 2.4.7?

Best regards,

-Adriano (bryam)
--
Adriano M. Galano Diez
System & Network Engineer
http://www.satec.es
Phone: (+34) 917 089 000
Sourceforge.NET Linux Kernel Foundry Guide http://sf.net/foundry/linuxkernel

#5 lore raw

RE: Kernel bug in 2.4.7-10smp...

Quoted 5 lines · Adriano Galano

I don't apply the patches for possible incompatibility with Compaq Remote Insight Manager card, the drivers of this card are for 2.4.7
(http://www.compaq.com/support/files/server/us/download/15084.html). Now I'm trying to make one upgrade to 2.4.18 recompiling the drivers source... Why happen this errors in 2.4.7?

2.4.7 had various bugs that got fixed, like any other software. The old kernel you are running also has security holes fixed which is a very good reason to upgrade