Skip to content

Commit 95d1d24

Browse files
committed
netdevice: move xdp_rxq within netdev_rx_queue
Both struct netdev_rx_queue and struct xdp_rxq_info are cacheline aligned. This causes extra padding before and after the xdp_rxq member. Move the member upfront, so that it's naturally aligned. Before: /* size: 256, cachelines: 4, members: 6 */ /* sum members: 160, holes: 1, sum holes: 40 */ /* padding: 56 */ /* paddings: 1, sum paddings: 36 */ /* forced alignments: 1, forced holes: 1, sum forced holes: 40 */ After: /* size: 192, cachelines: 3, members: 6 */ /* padding: 32 */ /* paddings: 1, sum paddings: 36 */ /* forced alignments: 1 */ Acked-by: Jesper Dangaard Brouer <brouer@redhat.com> Link: https://lore.kernel.org/r/20210823180135.1153608-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 18a9eae commit 95d1d24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/netdevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,13 +722,13 @@ bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
722722

723723
/* This structure contains an instance of an RX queue. */
724724
struct netdev_rx_queue {
725+
struct xdp_rxq_info xdp_rxq;
725726
#ifdef CONFIG_RPS
726727
struct rps_map __rcu *rps_map;
727728
struct rps_dev_flow_table __rcu *rps_flow_table;
728729
#endif
729730
struct kobject kobj;
730731
struct net_device *dev;
731-
struct xdp_rxq_info xdp_rxq;
732732
#ifdef CONFIG_XDP_SOCKETS
733733
struct xsk_buff_pool *pool;
734734
#endif

0 commit comments

Comments
 (0)