summaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorHaiyang Zhang <haiyangz@microsoft.com>2023-09-29 22:42:27 +0200
committerPaolo Abeni <pabeni@redhat.com>2023-10-05 11:45:06 +0200
commita43e8e9ffa0d1de058964edf1a0622cbb7e27cfe (patch)
treea122076af85b024b209c10110afce9dcc9e1dde7 /include/net
parentnet: mana: Fix the tso_bytes calculation (diff)
downloadlinux-a43e8e9ffa0d1de058964edf1a0622cbb7e27cfe.tar.xz
linux-a43e8e9ffa0d1de058964edf1a0622cbb7e27cfe.zip
net: mana: Fix oversized sge0 for GSO packets
Handle the case when GSO SKB linear length is too large. MANA NIC requires GSO packets to put only the header part to SGE0, otherwise the TX queue may stop at the HW level. So, use 2 SGEs for the skb linear part which contains more than the packet header. Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)") Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Shradha Gupta <shradhagupta@linux.microsoft.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/mana/mana.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h
index 9f70b4332238..4d43adf18606 100644
--- a/include/net/mana/mana.h
+++ b/include/net/mana/mana.h
@@ -103,9 +103,10 @@ struct mana_txq {
/* skb data and frags dma mappings */
struct mana_skb_head {
- dma_addr_t dma_handle[MAX_SKB_FRAGS + 1];
+ /* GSO pkts may have 2 SGEs for the linear part*/
+ dma_addr_t dma_handle[MAX_SKB_FRAGS + 2];
- u32 size[MAX_SKB_FRAGS + 1];
+ u32 size[MAX_SKB_FRAGS + 2];
};
#define MANA_HEADROOM sizeof(struct mana_skb_head)