By default, each device is assumed to be able only handle 64 KB chunks during DMA. By giving the segment size a larger value, the block layer will coalesce more S/G entries together for SRP, allowing larger requests with the same sg_tablesize setting.
This ups the value on Mellanox hardware to 1 GB, corresponding to reported firmware limits on mlx4. Signed-off-by: David Dillow <dillo...@ornl.gov> -- On Tue, 2011-03-22 at 10:01 +0200, Or Gerlitz wrote: > David Dillow wrote: > > This ups the value on Mellanox hardware to 2 GB, though there is no HW > > limit. > > You've expressed intention to reduce that value to 1GB as of HW > limitations, it would also let you get rid from the warnings on the > current version > > > CC [M] drivers/infiniband/hw/mthca/mthca_main.o > > drivers/infiniband/hw/mthca/mthca_main.c: In function ‘__mthca_init_one’: > > drivers/infiniband/hw/mthca/mthca_main.c:1047: warning: integer overflow in > > expression Well, that's embarrassing. I don't recall seeing those when I tested, but I don't see how the compiler could have not complained... here's an updated patch -- against Linus's tree as of a few days ago; work is currently blocking my git access on wireless. :/ diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c index 8a40cd5..f24b79b 100644 --- a/drivers/infiniband/hw/mthca/mthca_main.c +++ b/drivers/infiniband/hw/mthca/mthca_main.c @@ -1043,6 +1043,9 @@ static int __mthca_init_one(struct pci_dev *pdev, int hca_type) } } + /* We can handle large RDMA requests, so allow larger segments. */ + dma_set_max_seg_size(&pdev->dev, 1024 * 1024 * 1024); + mdev = (struct mthca_dev *) ib_alloc_device(sizeof *mdev); if (!mdev) { dev_err(&pdev->dev, "Device struct alloc failed, " diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c index 2765a3c..c835011 100644 --- a/drivers/net/mlx4/main.c +++ b/drivers/net/mlx4/main.c @@ -1109,6 +1109,9 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) } } + /* Allow large DMA segments, up to the firmware limit of 1 GB */ + dma_set_max_seg_size(&pdev->dev, 1024 * 1024 * 1024); + priv = kzalloc(sizeof *priv, GFP_KERNEL); if (!priv) { dev_err(&pdev->dev, "Device struct alloc failed, " -- Dave Dillow National Center for Computational Science Oak Ridge National Laboratory (865) 241-6602 office -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html