aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHaiyang Zhang <[email protected]>2023-04-12 14:16:02 -0700
committerDavid S. Miller <[email protected]>2023-04-14 08:56:19 +0100
commit2fbbd712baf1c60996554326728bbdbef5616e12 (patch)
treeb074988c51c3192313d53c613d6a0e96dc1a4193 /include
parenta2917b23497e4205db32271e4e06e142a9f8a6aa (diff)
net: mana: Enable RX path to handle various MTU sizes
Update RX data path to allocate and use RX queue DMA buffers with proper size based on potentially various MTU sizes. Signed-off-by: Haiyang Zhang <[email protected]> Reviewed-by: Jesse Brandeburg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/net/mana/mana.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
index 037bcabf6b98..fee99d704281 100644
--- a/include/net/mana/mana.h
+++ b/include/net/mana/mana.h
@@ -291,6 +291,11 @@ struct mana_recv_buf_oob {
struct gdma_posted_wqe_info wqe_inf;
};
+#define MANA_RXBUF_PAD (SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) \
+ + ETH_HLEN)
+
+#define MANA_XDP_MTU_MAX (PAGE_SIZE - MANA_RXBUF_PAD - XDP_PACKET_HEADROOM)
+
struct mana_rxq {
struct gdma_queue *gdma_rq;
/* Cache the gdma receive queue id */
@@ -300,6 +305,8 @@ struct mana_rxq {
u32 rxq_idx;
u32 datasize;
+ u32 alloc_size;
+ u32 headroom;
mana_handle_t rxobj;