提交 18b46810 编写于 作者: A Alexandre TORGUE 提交者: David S. Miller

net: ethernet: stmmac: GMAC4.xx: Fix TX descriptor preparation

On GMAC4.xx each descriptor contains 2 buffers of 16KB (each).
Initially, those 2 buffers was filled in dwmac4_rd_prepare_tx_desc but
it is actually not needed. Indeed, stmmac driver supports frame up to
9000 bytes (jumbo). So only one buffer is needed.
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NAlexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 fbf405e8
......@@ -254,14 +254,7 @@ static void dwmac4_rd_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
{
unsigned int tdes3 = p->des3;
if (unlikely(len > BUF_SIZE_16KiB)) {
p->des2 |= (((len - BUF_SIZE_16KiB) <<
TDES2_BUFFER2_SIZE_MASK_SHIFT)
& TDES2_BUFFER2_SIZE_MASK)
| (BUF_SIZE_16KiB & TDES2_BUFFER1_SIZE_MASK);
} else {
p->des2 |= (len & TDES2_BUFFER1_SIZE_MASK);
}
p->des2 |= (len & TDES2_BUFFER1_SIZE_MASK);
if (is_fs)
tdes3 |= TDES3_FIRST_DESCRIPTOR;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册