summaryrefslogtreecommitdiffstats
path: root/include/net/mana/mana.h
diff options
context:
space:
mode:
authorHaiyang Zhang <haiyangz@microsoft.com>2023-04-12 23:16:02 +0200
committerDavid S. Miller <davem@davemloft.net>2023-04-14 09:56:19 +0200
commit2fbbd712baf1c60996554326728bbdbef5616e12 (patch)
treeb074988c51c3192313d53c613d6a0e96dc1a4193 /include/net/mana/mana.h
parentnet: mana: Refactor RX buffer allocation code to prepare for various MTU (diff)
downloadlinux-2fbbd712baf1c60996554326728bbdbef5616e12.tar.xz
linux-2fbbd712baf1c60996554326728bbdbef5616e12.zip
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 <haiyangz@microsoft.com> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/mana/mana.h')
-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;