Skip to content

Commit cb36859

Browse files
Sergei Shtylyovdavem330
authored andcommitted
sh_eth: fix RX buffer size calculation
The RX buffer size calulation failed to account for the length granularity (which is now 32 bytes)... Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ab85791 commit cb36859

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/renesas/sh_eth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ static void sh_eth_ring_format(struct net_device *ndev)
11271127
struct sh_eth_txdesc *txdesc = NULL;
11281128
int rx_ringsize = sizeof(*rxdesc) * mdp->num_rx_ring;
11291129
int tx_ringsize = sizeof(*txdesc) * mdp->num_tx_ring;
1130-
int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN - 1;
1130+
int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN + 32 - 1;
11311131
dma_addr_t dma_addr;
11321132

11331133
mdp->cur_rx = 0;
@@ -1450,7 +1450,7 @@ static int sh_eth_rx(struct net_device *ndev, u32 intr_status, int *quota)
14501450
struct sk_buff *skb;
14511451
u16 pkt_len = 0;
14521452
u32 desc_status;
1453-
int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN - 1;
1453+
int skbuff_size = mdp->rx_buf_sz + SH_ETH_RX_ALIGN + 32 - 1;
14541454
dma_addr_t dma_addr;
14551455

14561456
boguscnt = min(boguscnt, *quota);

0 commit comments

Comments
 (0)