Skip to content

Commit

Permalink
net: Change the layout of structure trace_event_raw_fib_table_lookup
Browse files Browse the repository at this point in the history
There is an unalignment access about the structure
'trace_event_raw_fib_table_lookup'.

In include/trace/events/fib.h, there is a memory operation which casting
the 'src' data member to a pointer, and then store a value to this
pointer point to.

p32 = (__be32 *) __entry->src;
*p32 = flp->saddr;

The offset of 'src' in structure trace_event_raw_fib_table_lookup is not
four bytes alignment. On some architectures, they don't permit the
unalignment access, it need to pay the price to handle this situation in
exception handler.

Adjust the layout of structure to avoid this case.

Fixes: 9f32397 ("net/ipv4: Udate fib_table_lookup tracepoint")
Signed-off-by: Zong Li <[email protected]>
Acked-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Zong Li authored and davem330 committed Aug 13, 2018
1 parent a72ce9a commit 0192e7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/trace/events/fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ TRACE_EVENT(fib_table_lookup,
__field( int, err )
__field( int, oif )
__field( int, iif )
__field( u8, proto )
__field( __u8, tos )
__field( __u8, scope )
__field( __u8, flags )
Expand All @@ -31,7 +32,6 @@ TRACE_EVENT(fib_table_lookup,
__array( __u8, saddr, 4 )
__field( u16, sport )
__field( u16, dport )
__field( u8, proto )
__dynamic_array(char, name, IFNAMSIZ )
),

Expand Down

0 comments on commit 0192e7d

Please sign in to comment.