Skip to content

Commit 5827fe2

Browse files
shinas-marvelldavem330
authored andcommitted
octeon_ep: add padding for small packets
Pad small packets to ETH_ZLEN before transmit, as hardware cannot pad and requires software padding to ensure minimum ethernet frame length. Signed-off-by: Shinas Rasheed <srasheed@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 56eddc3 commit 5827fe2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/marvell/octeon_ep/octep_main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,9 @@ static netdev_tx_t octep_start_xmit(struct sk_buff *skb,
820820
u16 nr_frags, si;
821821
u16 q_no, wi;
822822

823+
if (skb_put_padto(skb, ETH_ZLEN))
824+
return NETDEV_TX_OK;
825+
823826
q_no = skb_get_queue_mapping(skb);
824827
if (q_no >= oct->num_iqs) {
825828
netdev_err(netdev, "Invalid Tx skb->queue_mapping=%d\n", q_no);

0 commit comments

Comments
 (0)