Commit 009b3876 authored by David Arinzon's avatar David Arinzon Committed by Jakub Kicinski

net: ena: Put orthogonal fields in ena_tx_buffer in a union

The skb and xdpf pointers cannot be set together in the driver
(each TX descriptor can send either an SKB or an XDP frame), and so it
makes more sense to put them both in a union.

This decreases the overall size of the ena_tx_buffer struct which
improves cache locality.
Signed-off-by: default avatarShay Agroskin <shayagr@amazon.com>
Signed-off-by: default avatarDavid Arinzon <darinzon@amazon.com>
Link: https://lore.kernel.org/r/20240101190855.18739-4-darinzon@amazon.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 39a044f4
......@@ -131,7 +131,13 @@ struct ena_napi {
};
struct ena_tx_buffer {
struct sk_buff *skb;
union {
struct sk_buff *skb;
/* XDP buffer structure which is used for sending packets in
* the xdp queues
*/
struct xdp_frame *xdpf;
};
/* num of ena desc for this specific skb
* (includes data desc and metadata desc)
*/
......@@ -139,10 +145,6 @@ struct ena_tx_buffer {
/* num of buffers used by this skb */
u32 num_of_bufs;
/* XDP buffer structure which is used for sending packets in
* the xdp queues
*/
struct xdp_frame *xdpf;
/* Indicate if bufs[0] map the linear data of the skb. */
u8 map_linear_data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment