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
Kirill Smelkov
linux
Commits
5d8666eb
Commit
5d8666eb
authored
Oct 02, 2003
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Consolidate skb delivery.
parent
280a827a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
36 deletions
+21
-36
net/core/dev.c
net/core/dev.c
+21
-36
No files found.
net/core/dev.c
View file @
5d8666eb
...
...
@@ -1488,6 +1488,18 @@ static void net_tx_action(struct softirq_action *h)
}
}
static
__inline__
int
deliver_skb
(
struct
sk_buff
*
skb
,
struct
packet_type
*
pt_prev
,
int
last
)
{
if
(
unlikely
(
!
pt_prev
->
data
))
return
deliver_to_old_ones
(
pt_prev
,
skb
,
last
);
else
{
atomic_inc
(
&
skb
->
users
);
return
pt_prev
->
func
(
skb
,
skb
->
dev
,
pt_prev
);
}
}
#if defined(CONFIG_BRIDGE) || defined (CONFIG_BRIDGE_MODULE)
int
(
*
br_handle_frame_hook
)(
struct
sk_buff
*
skb
);
...
...
@@ -1495,15 +1507,8 @@ static __inline__ int handle_bridge(struct sk_buff *skb,
struct
packet_type
*
pt_prev
)
{
int
ret
=
NET_RX_DROP
;
if
(
pt_prev
)
{
if
(
!
pt_prev
->
data
)
ret
=
deliver_to_old_ones
(
pt_prev
,
skb
,
0
);
else
{
atomic_inc
(
&
skb
->
users
);
ret
=
pt_prev
->
func
(
skb
,
skb
->
dev
,
pt_prev
);
}
}
if
(
pt_prev
)
ret
=
deliver_skb
(
skb
,
pt_prev
,
0
);
return
ret
;
}
...
...
@@ -1551,16 +1556,8 @@ int netif_receive_skb(struct sk_buff *skb)
rcu_read_lock
();
list_for_each_entry_rcu
(
ptype
,
&
ptype_all
,
list
)
{
if
(
!
ptype
->
dev
||
ptype
->
dev
==
skb
->
dev
)
{
if
(
pt_prev
)
{
if
(
!
pt_prev
->
data
)
{
ret
=
deliver_to_old_ones
(
pt_prev
,
skb
,
0
);
}
else
{
atomic_inc
(
&
skb
->
users
);
ret
=
pt_prev
->
func
(
skb
,
skb
->
dev
,
pt_prev
);
}
}
if
(
pt_prev
)
ret
=
deliver_skb
(
skb
,
pt_prev
,
0
);
pt_prev
=
ptype
;
}
}
...
...
@@ -1573,27 +1570,15 @@ int netif_receive_skb(struct sk_buff *skb)
list_for_each_entry_rcu
(
ptype
,
&
ptype_base
[
ntohs
(
type
)
&
15
],
list
)
{
if
(
ptype
->
type
==
type
&&
(
!
ptype
->
dev
||
ptype
->
dev
==
skb
->
dev
))
{
if
(
pt_prev
)
{
if
(
!
pt_prev
->
data
)
{
ret
=
deliver_to_old_ones
(
pt_prev
,
skb
,
0
);
}
else
{
atomic_inc
(
&
skb
->
users
);
ret
=
pt_prev
->
func
(
skb
,
skb
->
dev
,
pt_prev
);
}
}
if
(
pt_prev
)
ret
=
deliver_skb
(
skb
,
pt_prev
,
0
);
pt_prev
=
ptype
;
}
}
if
(
pt_prev
)
{
if
(
!
pt_prev
->
data
)
{
ret
=
deliver_to_old_ones
(
pt_prev
,
skb
,
1
);
}
else
{
ret
=
pt_prev
->
func
(
skb
,
skb
->
dev
,
pt_prev
);
}
}
else
{
if
(
pt_prev
)
ret
=
deliver_skb
(
skb
,
pt_prev
,
1
);
else
{
kfree_skb
(
skb
);
/* Jamal, now you will not able to escape explaining
* me how you were going to use this. :-)
...
...
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