mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-14 21:10:27 +01:00
ipq807x: Padding minimum packets before send to EDMA
The EDMA HW is unable to process packets less than MIN_PKT_SIZE(33) bytes, then the EDMA stalls. This is to pad the packets up to MIN_PKT_SIZE. Change-Id: I473831a759ad6a764fefa095cf7ab347ba95ee97 Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
This commit is contained in:
parent
a7e05d55af
commit
a5b2a4c4cb
1 changed files with 9 additions and 1 deletions
|
|
@ -436,6 +436,7 @@ static int ipq807x_edma_rx_complete(struct ipq807x_edma_common_info *c_info)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define MIN_PKT_SIZE 33
|
||||
/*
|
||||
* ipq807x_eth_snd()
|
||||
* Transmit a packet using an EDMA ring
|
||||
|
|
@ -528,7 +529,14 @@ static int ipq807x_eth_snd(struct eth_device *dev, void *packet, int length)
|
|||
* copy the packet
|
||||
*/
|
||||
memcpy(skb + IPQ807X_EDMA_TX_PREHDR_SIZE, packet, length);
|
||||
|
||||
/*
|
||||
* The EDMA HW is unable to process packets less than MIN_PKT_SIZE(33) bytes,
|
||||
* then the EDMA stalls. This is to pad the packets up to MIN_PKT_SIZE.
|
||||
*/
|
||||
if (length < MIN_PKT_SIZE) {
|
||||
memset(skb + IPQ807X_EDMA_TX_PREHDR_SIZE + length, 0x00, (MIN_PKT_SIZE - length));
|
||||
length = MIN_PKT_SIZE;
|
||||
}
|
||||
/*
|
||||
* Populate Tx descriptor
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue