All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net/mlx4_en: Advertise HIGH DMA support only if dma mask is 64 bit
@ 2013-08-12  8:30 Amir Vadai
  2013-08-12 16:32 ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: Amir Vadai @ 2013-08-12  8:30 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Amir Vadai, Or Gerlitz, Alexander Guller

Need to check that the pci device DMA mask was set to 64 bit support
(done by mlx4_core) before advertising HIGH DMA support in higher drivers.
Otherwise, may run into an issue that skb/frag/data is in high memory
and can't dma map it, thus packets are dropped.


Signed-off-by: Alexander Guller <alexg@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index fa37b7a..9568b77 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -2317,9 +2317,13 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 	dev->vlan_features = dev->hw_features;
 
 	dev->hw_features |= NETIF_F_RXCSUM | NETIF_F_RXHASH;
-	dev->features = dev->hw_features | NETIF_F_HIGHDMA |
+	dev->features = dev->hw_features |
 			NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
 			NETIF_F_HW_VLAN_CTAG_FILTER;
+
+	if (mdev->dev->pdev->dma_mask == DMA_BIT_MASK(64))
+		dev->features |= NETIF_F_HIGHDMA;
+
 	dev->hw_features |= NETIF_F_LOOPBACK;
 
 	if (mdev->dev->caps.steering_mode ==
-- 
1.8.3.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-13 11:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-12  8:30 [PATCH net-next] net/mlx4_en: Advertise HIGH DMA support only if dma mask is 64 bit Amir Vadai
2013-08-12 16:32 ` Ben Hutchings
2013-08-13 11:19   ` Amir Vadai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.