Skip to content

Commit

Permalink
qede: Fix internal loopback failure with jumbo mtu configuration
Browse files Browse the repository at this point in the history
Driver uses port-mtu as packet-size for the loopback traffic. This patch
limits the max packet size to 1.5K to avoid data being split over multiple
buffer descriptors (BDs) in cases where MTU > PAGE_SIZE.

Signed-off-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sudarsana Reddy Kalluru authored and David S. Miller committed Mar 7, 2019
1 parent 43d2816 commit b89869d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/ethernet/qlogic/qede/qede_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1663,8 +1663,11 @@ static int qede_selftest_run_loopback(struct qede_dev *edev, u32 loopback_mode)
/* Wait for loopback configuration to apply */
msleep_interruptible(500);

/* prepare the loopback packet */
pkt_size = edev->ndev->mtu + ETH_HLEN;
/* Setting max packet size to 1.5K to avoid data being split over
* multiple BDs in cases where MTU > PAGE_SIZE.
*/
pkt_size = (((edev->ndev->mtu < ETH_DATA_LEN) ?
edev->ndev->mtu : ETH_DATA_LEN) + ETH_HLEN);

skb = netdev_alloc_skb(edev->ndev, pkt_size);
if (!skb) {
Expand Down

0 comments on commit b89869d

Please sign in to comment.