Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
fe55f6d5
Commit
fe55f6d5
authored
Aug 30, 2008
by
Vegard Nossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net: use kmemcheck bitfields API for skbuff
Signed-off-by:
Vegard Nossum
<
vegard.nossum@gmail.com
>
parent
fc7d0c9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
include/linux/skbuff.h
include/linux/skbuff.h
+7
-0
net/core/skbuff.c
net/core/skbuff.c
+8
-0
No files found.
include/linux/skbuff.h
View file @
fe55f6d5
...
...
@@ -15,6 +15,7 @@
#define _LINUX_SKBUFF_H
#include <linux/kernel.h>
#include <linux/kmemcheck.h>
#include <linux/compiler.h>
#include <linux/time.h>
#include <linux/cache.h>
...
...
@@ -346,6 +347,7 @@ struct sk_buff {
};
};
__u32
priority
;
kmemcheck_bitfield_begin
(
flags1
);
__u8
local_df
:
1
,
cloned:
1
,
ip_summed:
2
,
...
...
@@ -356,6 +358,7 @@ struct sk_buff {
ipvs_property:
1
,
peeked:
1
,
nf_trace:
1
;
kmemcheck_bitfield_end
(
flags1
);
__be16
protocol
;
void
(
*
destructor
)(
struct
sk_buff
*
skb
);
...
...
@@ -375,6 +378,8 @@ struct sk_buff {
__u16
tc_verd
;
/* traffic control verdict */
#endif
#endif
kmemcheck_bitfield_begin
(
flags2
);
#ifdef CONFIG_IPV6_NDISC_NODETYPE
__u8
ndisc_nodetype
:
2
;
#endif
...
...
@@ -382,6 +387,8 @@ struct sk_buff {
__u8
do_not_encrypt
:
1
;
__u8
requeue
:
1
;
#endif
kmemcheck_bitfield_end
(
flags2
);
/* 0/13/14 bit hole */
#ifdef CONFIG_NET_DMA
...
...
net/core/skbuff.c
View file @
fe55f6d5
...
...
@@ -39,6 +39,7 @@
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/kmemcheck.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/in.h>
...
...
@@ -201,6 +202,8 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
skb
->
data
=
data
;
skb_reset_tail_pointer
(
skb
);
skb
->
end
=
skb
->
tail
+
size
;
kmemcheck_annotate_bitfield
(
skb
,
flags1
);
kmemcheck_annotate_bitfield
(
skb
,
flags2
);
/* make sure we initialize shinfo sequentially */
shinfo
=
skb_shinfo
(
skb
);
atomic_set
(
&
shinfo
->
dataref
,
1
);
...
...
@@ -217,6 +220,8 @@ struct sk_buff *__alloc_skb(unsigned int size, gfp_t gfp_mask,
struct
sk_buff
*
child
=
skb
+
1
;
atomic_t
*
fclone_ref
=
(
atomic_t
*
)
(
child
+
1
);
kmemcheck_annotate_bitfield
(
child
,
flags1
);
kmemcheck_annotate_bitfield
(
child
,
flags2
);
skb
->
fclone
=
SKB_FCLONE_ORIG
;
atomic_set
(
fclone_ref
,
1
);
...
...
@@ -633,6 +638,9 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
n
=
kmem_cache_alloc
(
skbuff_head_cache
,
gfp_mask
);
if
(
!
n
)
return
NULL
;
kmemcheck_annotate_bitfield
(
n
,
flags1
);
kmemcheck_annotate_bitfield
(
n
,
flags2
);
n
->
fclone
=
SKB_FCLONE_UNAVAILABLE
;
}
...
...
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