Skip to content

Commit

Permalink
mctp: Reorder fields in 'struct mctp_route'
Browse files Browse the repository at this point in the history
Group some variables based on their sizes to reduce hole and avoid padding.
On x86_64, this shrinks the size of 'struct mctp_route'
from 72 to 64 bytes.

It saves a few bytes of memory and is more cache-line friendly.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/393ad1a5aef0aa28d839eeb3d7477da0e0eeb0b0.1687080803.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Christophe JAILLET authored and Jakub Kicinski committed Jun 21, 2023
1 parent 857922b commit 066768b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/net/mctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ struct mctp_flow {
struct mctp_route {
mctp_eid_t min, max;

struct mctp_dev *dev;
unsigned int mtu;
unsigned char type;
unsigned int mtu;
struct mctp_dev *dev;
int (*output)(struct mctp_route *route,
struct sk_buff *skb);

Expand Down

0 comments on commit 066768b

Please sign in to comment.