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
98166b95
Commit
98166b95
authored
Aug 31, 2003
by
Christoph Hellwig
Committed by
David S. Miller
Aug 31, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Convert netdev_rx_stat to per-cpu data.
parent
13b3cc3e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
+11
-12
include/linux/netdevice.h
include/linux/netdevice.h
+2
-2
net/core/dev.c
net/core/dev.c
+8
-9
net/sched/sch_generic.c
net/sched/sch_generic.c
+1
-1
No files found.
include/linux/netdevice.h
View file @
98166b95
...
...
@@ -168,9 +168,9 @@ struct netif_rx_stats
unsigned
fastroute_deferred_out
;
unsigned
fastroute_latency_reduction
;
unsigned
cpu_collision
;
}
____cacheline_aligned
;
};
extern
struct
netif_rx_stats
netdev_rx_stat
[]
;
DECLARE_PER_CPU
(
struct
netif_rx_stats
,
netdev_rx_stat
)
;
/*
...
...
net/core/dev.c
View file @
98166b95
...
...
@@ -1210,7 +1210,7 @@ int no_cong = 20;
int
lo_cong
=
100
;
int
mod_cong
=
290
;
struct
netif_rx_stats
netdev_rx_stat
[
NR_CPUS
]
;
DEFINE_PER_CPU
(
struct
netif_rx_stats
,
netdev_rx_stat
)
=
{
0
,
}
;
#ifdef CONFIG_NET_HW_FLOWCONTROL
...
...
@@ -1359,7 +1359,7 @@ int netif_rx(struct sk_buff *skb)
this_cpu
=
smp_processor_id
();
queue
=
&
__get_cpu_var
(
softnet_data
);
netdev_rx_stat
[
this_cpu
]
.
total
++
;
__get_cpu_var
(
netdev_rx_stat
)
.
total
++
;
if
(
queue
->
input_pkt_queue
.
qlen
<=
netdev_max_backlog
)
{
if
(
queue
->
input_pkt_queue
.
qlen
)
{
if
(
queue
->
throttle
)
...
...
@@ -1389,14 +1389,14 @@ int netif_rx(struct sk_buff *skb)
if
(
!
queue
->
throttle
)
{
queue
->
throttle
=
1
;
netdev_rx_stat
[
this_cpu
]
.
throttled
++
;
__get_cpu_var
(
netdev_rx_stat
)
.
throttled
++
;
#ifdef CONFIG_NET_HW_FLOWCONTROL
atomic_inc
(
&
netdev_dropping
);
#endif
}
drop:
netdev_rx_stat
[
this_cpu
]
.
dropped
++
;
__get_cpu_var
(
netdev_rx_stat
)
.
dropped
++
;
local_irq_restore
(
flags
);
kfree_skb
(
skb
);
...
...
@@ -1537,11 +1537,11 @@ int netif_receive_skb(struct sk_buff *skb)
skb_bond
(
skb
);
netdev_rx_stat
[
smp_processor_id
()]
.
total
++
;
__get_cpu_var
(
netdev_rx_stat
)
.
total
++
;
#ifdef CONFIG_NET_FASTROUTE
if
(
skb
->
pkt_type
==
PACKET_FASTROUTE
)
{
netdev_rx_stat
[
smp_processor_id
()]
.
fastroute_deferred_out
++
;
__get_cpu_var
(
netdev_rx_stat
)
.
fastroute_deferred_out
++
;
return
dev_queue_xmit
(
skb
);
}
#endif
...
...
@@ -1672,7 +1672,6 @@ static int process_backlog(struct net_device *backlog_dev, int *budget)
static
void
net_rx_action
(
struct
softirq_action
*
h
)
{
int
this_cpu
=
smp_processor_id
();
struct
softnet_data
*
queue
=
&
__get_cpu_var
(
softnet_data
);
unsigned
long
start_time
=
jiffies
;
int
budget
=
netdev_max_backlog
;
...
...
@@ -1711,7 +1710,7 @@ static void net_rx_action(struct softirq_action *h)
return
;
softnet_break:
netdev_rx_stat
[
this_cpu
]
.
time_squeeze
++
;
__get_cpu_var
(
netdev_rx_stat
)
.
time_squeeze
++
;
__raise_softirq_irqoff
(
NET_RX_SOFTIRQ
);
goto
out
;
}
...
...
@@ -1912,7 +1911,7 @@ static struct netif_rx_stats *softnet_get_online(loff_t *pos)
while
(
*
pos
<
NR_CPUS
)
if
(
cpu_online
(
*
pos
))
{
rc
=
&
netdev_rx_stat
[
*
pos
]
;
rc
=
&
per_cpu
(
netdev_rx_stat
,
*
pos
)
;
break
;
}
else
++*
pos
;
...
...
net/sched/sch_generic.c
View file @
98166b95
...
...
@@ -121,7 +121,7 @@ int qdisc_restart(struct net_device *dev)
printk
(
KERN_DEBUG
"Dead loop on netdevice %s, fix it urgently!
\n
"
,
dev
->
name
);
return
-
1
;
}
netdev_rx_stat
[
smp_processor_id
()]
.
cpu_collision
++
;
__get_cpu_var
(
netdev_rx_stat
)
.
cpu_collision
++
;
}
/* Device kicked us out :(
...
...
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