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>
This commit is contained in:
Shinas Rasheed 2023-11-14 05:45:32 -08:00 committed by David S. Miller
parent 56eddc3cb1
commit 5827fe2bc9

View File

@ -820,6 +820,9 @@ static netdev_tx_t octep_start_xmit(struct sk_buff *skb,
u16 nr_frags, si;
u16 q_no, wi;
if (skb_put_padto(skb, ETH_ZLEN))
return NETDEV_TX_OK;
q_no = skb_get_queue_mapping(skb);
if (q_no >= oct->num_iqs) {
netdev_err(netdev, "Invalid Tx skb->queue_mapping=%d\n", q_no);