From patchwork Tue May 24 08:56:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 12859870 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A5E3C4332F for ; Tue, 24 May 2022 08:58:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233771AbiEXI6A (ORCPT ); Tue, 24 May 2022 04:58:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234078AbiEXI4c (ORCPT ); Tue, 24 May 2022 04:56:32 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3A4776C57F; Tue, 24 May 2022 01:56:31 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id 13CEA20B8955; Tue, 24 May 2022 01:56:31 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 13CEA20B8955 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1653382591; bh=LmeUd3HzlFEV9uqUAPx3qEVgppMIqrk1rWw5FyI79rk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:Reply-To:From; b=IepS4nFHRmtOLM3Wd4t64JpVOcKEeXVR0Hjz1+q/qlgqokz6V+T3ZKKjjKhRPrya9 TflWVk6VszgDkgh7AoKPmXi5P55UQ0UJe7xEEpHEMtndM9Hg7/nNNiiKuQRMRY5dof Z8FxFcwzBYr+KSCMxjRANdoaf4US1eFnYbQPAki0= From: longli@linuxonhyperv.com To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Jason Gunthorpe , Leon Romanovsky , Ajay Sharma Cc: linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Long Li Subject: [Patch v2 05/12] net: mana: Set the DMA device max segment size Date: Tue, 24 May 2022 01:56:05 -0700 Message-Id: <1653382572-14788-6-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1653382572-14788-1-git-send-email-longli@linuxonhyperv.com> References: <1653382572-14788-1-git-send-email-longli@linuxonhyperv.com> Reply-To: longli@microsoft.com Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Ajay Sharma MANA hardware doesn't have any restrictions on the DMA segment size, set it to the max allowed value. Signed-off-by: Ajay Sharma Signed-off-by: Long Li --- Change log: v2: Use the max allowed value as the hardware doesn't have any limit drivers/net/ethernet/microsoft/mana/gdma_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c index 86ffe0e39df0..3cf69874ef18 100644 --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c @@ -1385,6 +1385,12 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (err) goto release_region; + err = dma_set_max_seg_size(&pdev->dev, UINT_MAX); + if (err) { + dev_err(&pdev->dev, "Failed to set dma device segment size\n"); + goto release_region; + } + err = -ENOMEM; gc = vzalloc(sizeof(*gc)); if (!gc)