diff mbox series

[net,1/1] qede: Fix internal loopback failure with jumbo mtu configuration

Message ID 20190307155635.13968-1-skalluru@marvell.com
State Accepted
Delegated to: David Miller
Headers show
Series [net,1/1] qede: Fix internal loopback failure with jumbo mtu configuration | expand

Commit Message

Sudarsana Reddy Kalluru March 7, 2019, 3:56 p.m. UTC
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>
---
 drivers/net/ethernet/qlogic/qede/qede_ethtool.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

David Miller March 7, 2019, 5:43 p.m. UTC | #1
From: Sudarsana Reddy Kalluru <skalluru@marvell.com>
Date: Thu, 7 Mar 2019 07:56:35 -0800

> 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>

Applied.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c
index 16331c6..3ec2de4 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_ethtool.c
@@ -1654,8 +1654,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) {