All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: David Awogbemila <awogbemila@google.com>
Cc: netdev@vger.kernel.org, Catherine Sullivan <csully@google.com>,
	Yangchun Fu <yangchun@google.com>
Subject: Re: [PATCH net-next v3 4/9] gve: Add support for dma_mask register
Date: Tue, 8 Sep 2020 12:14:57 -0700	[thread overview]
Message-ID: <20200908121457.0dc67f75@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <20200908183909.4156744-5-awogbemila@google.com>

On Tue,  8 Sep 2020 11:39:04 -0700 David Awogbemila wrote:
> +	dma_mask = readb(&reg_bar->dma_mask);
> +	// Default to 64 if the register isn't set
> +	if (!dma_mask)
> +		dma_mask = 64;
>  	gve_write_version(&reg_bar->driver_version);
>  	/* Get max queues to alloc etherdev */
>  	max_rx_queues = ioread32be(&reg_bar->max_tx_queues);
>  	max_tx_queues = ioread32be(&reg_bar->max_rx_queues);
> +
> +	err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));

You use the constant 64, not dma_mask?

You jump through hoops to get GFP_DMA allocations yet you don't set the
right DMA mask. Why would swiotlb become an issue to you if there never
was any reasonable mask set?

> +	if (err) {
> +		dev_err(&pdev->dev, "Failed to set dma mask: err=%d\n", err);
> +		goto abort_with_reg_bar;
> +	}
> +
> +	err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));

dma_set_mask_and_coherent()

> +	if (err) {
> +		dev_err(&pdev->dev,
> +			"Failed to set consistent dma mask: err=%d\n", err);
> +		goto abort_with_reg_bar;
> +	}

  reply	other threads:[~2020-09-08 19:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08 18:39 [PATCH net-next v3 0/9] Add GVE Features David Awogbemila
2020-09-08 18:39 ` [PATCH net-next v3 1/9] gve: Get and set Rx copybreak via ethtool David Awogbemila
2020-09-08 18:39 ` [PATCH net-next v3 2/9] gve: Add stats for gve David Awogbemila
2020-09-08 18:39 ` [PATCH net-next v3 3/9] gve: Use dev_info/err instead of netif_info/err David Awogbemila
2020-09-08 18:39 ` [PATCH net-next v3 4/9] gve: Add support for dma_mask register David Awogbemila
2020-09-08 19:14   ` Jakub Kicinski [this message]
2020-09-09 22:12     ` David Awogbemila
2020-09-08 18:39 ` [PATCH net-next v3 5/9] gve: Add Gvnic stats AQ command and ethtool show/set-priv-flags David Awogbemila
2020-09-08 19:17   ` Jakub Kicinski
2020-09-08 19:24   ` Jakub Kicinski
2020-09-09 22:12     ` David Awogbemila
2020-09-08 18:39 ` [PATCH net-next v3 6/9] gve: NIC stats for report-stats and for ethtool David Awogbemila
2020-09-08 18:39 ` [PATCH net-next v3 7/9] gve: Batch AQ commands for creating and destroying queues David Awogbemila
2020-09-08 18:39 ` [PATCH net-next v3 8/9] gve: Use link status register to report link status David Awogbemila
2020-09-08 19:27   ` Jakub Kicinski
2020-09-09 22:12     ` David Awogbemila
2020-09-08 18:39 ` [PATCH net-next v3 9/9] gve: Enable Link Speed Reporting in the driver David Awogbemila

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200908121457.0dc67f75@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=awogbemila@google.com \
    --cc=csully@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=yangchun@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.