Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
36f288e8
Commit
36f288e8
authored
Feb 15, 2005
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/davem/net-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
6840804e
6c7baa52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
24 deletions
+18
-24
net/core/pktgen.c
net/core/pktgen.c
+18
-24
No files found.
net/core/pktgen.c
View file @
36f288e8
...
...
@@ -148,7 +148,7 @@
#include <asm/timex.h>
#define VERSION "pktgen v2.5
4
: Packet Generator for packet performance testing.\n"
#define VERSION "pktgen v2.5
6
: Packet Generator for packet performance testing.\n"
/* #define PG_DEBUG(a) a */
#define PG_DEBUG(a)
...
...
@@ -167,9 +167,6 @@
#define F_TXSIZE_RND (1<<6)
/* Transmit size is random */
#define F_IPV6 (1<<7)
/* Interface in IPV6 Mode */
#define L_PUSH(t, i) {i->next = t; t=i;}
#define L_POP(t, i) {i=t; if(i) t = i->next;}
/* Thread control flag bits */
#define T_TERMINATE (1<<0)
#define T_STOP (1<<1)
/* Stop run */
...
...
@@ -1366,19 +1363,15 @@ static int proc_thread_read(char *buf , char **start, off_t offset,
p
+=
sprintf
(
p
,
"Running: "
);
if_lock
(
t
);
pkt_dev
=
t
->
if_list
;
while
(
pkt_dev
&&
pkt_dev
->
running
)
{
p
+=
sprintf
(
p
,
"%s "
,
pkt_dev
->
ifname
);
pkt_dev
=
pkt_dev
->
next
;
}
for
(
pkt_dev
=
t
->
if_list
;
pkt_dev
;
pkt_dev
=
pkt_dev
->
next
)
if
(
pkt_dev
->
running
)
p
+=
sprintf
(
p
,
"%s "
,
pkt_dev
->
ifname
);
p
+=
sprintf
(
p
,
"
\n
Stopped: "
);
pkt_dev
=
t
->
if_list
;
while
(
pkt_dev
&&
!
pkt_dev
->
running
)
{
p
+=
sprintf
(
p
,
"%s "
,
pkt_dev
->
ifname
);
pkt_dev
=
pkt_dev
->
next
;
}
for
(
pkt_dev
=
t
->
if_list
;
pkt_dev
;
pkt_dev
=
pkt_dev
->
next
)
if
(
!
pkt_dev
->
running
)
p
+=
sprintf
(
p
,
"%s "
,
pkt_dev
->
ifname
);
if
(
t
->
result
[
0
])
p
+=
sprintf
(
p
,
"
\n
Result: %s
\n
"
,
t
->
result
);
...
...
@@ -2393,7 +2386,7 @@ static void pktgen_stop_all_threads_ifs(void)
thread_unlock
();
}
static
int
running
(
struct
pktgen_thread
*
t
)
static
int
thread_is_
running
(
struct
pktgen_thread
*
t
)
{
struct
pktgen_dev
*
next
;
int
res
=
0
;
...
...
@@ -2415,7 +2408,7 @@ static int pktgen_wait_thread_run(struct pktgen_thread *t )
if_lock
(
t
);
while
(
running
(
t
))
{
while
(
thread_is_
running
(
t
))
{
if_unlock
(
t
);
interruptible_sleep_on_timeout
(
&
queue
,
HZ
/
10
);
...
...
@@ -2520,13 +2513,15 @@ static int pktgen_stop_device(struct pktgen_dev *pkt_dev)
return
-
EINVAL
;
}
if
(
pkt_dev
->
skb
)
kfree_skb
(
pkt_dev
->
skb
);
pkt_dev
->
stopped_at
=
getCurUs
();
pkt_dev
->
running
=
0
;
show_results
(
pkt_dev
,
skb_shinfo
(
pkt_dev
->
skb
)
->
nr_frags
);
if
(
pkt_dev
->
skb
)
kfree_skb
(
pkt_dev
->
skb
);
pkt_dev
->
skb
=
NULL
;
return
0
;
}
...
...
@@ -2860,10 +2855,10 @@ static struct pktgen_dev *pktgen_find_dev(struct pktgen_thread *t, const char* i
for
(
pkt_dev
=
t
->
if_list
;
pkt_dev
;
pkt_dev
=
pkt_dev
->
next
)
{
if
(
strcmp
(
pkt_dev
->
ifname
,
ifname
)
==
0
)
{
goto
out
;
break
;
}
}
out:
if_unlock
(
t
);
PG_DEBUG
(
printk
(
"pktgen: find_dev(%s) returning %p
\n
"
,
ifname
,
pkt_dev
));
return
pkt_dev
;
...
...
@@ -2884,8 +2879,7 @@ static int add_dev_to_thread(struct pktgen_thread *t, struct pktgen_dev *pkt_dev
rv
=
-
EBUSY
;
goto
out
;
}
L_PUSH
(
t
->
if_list
,
pkt_dev
);
pkt_dev
->
next
=
t
->
if_list
;
t
->
if_list
=
pkt_dev
;
pkt_dev
->
pg_thread
=
t
;
pkt_dev
->
running
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment