Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Aya Levin <ayal@mellanox.com>
To: Ding Tianhong <dingtianhong@huawei.com>,
	Bjorn Helgaas <bhelgaas@google.com>
Cc: Tariq Toukan <tariqt@mellanox.com>,
	Tal Gilboa <talgi@mellanox.com>,
	linux-pci@vger.kernel.org
Subject: Adding support for Relaxed ordering on a non-root device
Date: Thu,  4 Jun 2020 15:35:48 +0300	[thread overview]
Message-ID: <1591274148-12230-1-git-send-email-ayal@mellanox.com> (raw)

Hi

I am writing to you regarding your commits titled: 
1. a99b646afa8a PCI: Disable PCIe Relaxed Ordering if unsupported 
2. 87e09cdec4da PCI: Disable Relaxed Ordering for some Intel processors

While adding support to relaxed ordering on Mellanox Ethernet driver I
tried to avoid the Intel's bug with pcie_relaxed_ordering_enabled.
Expecting this to return False on Haswell and Broadwell CPU. I run
this API on: Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz (I think it is
a Haswell, right?) and the API returned True. What am I missing?

In addition, I saw your comment in pci_configure_relaxed_ordering
(pasted below) the non-root ports are not handled since Peer-to-Peer
DMA is another can of warms. Could you elaborate on the complexity?
What is the effort to extend this to non-root ports?

Thanks,
Aya

---------------------------------------------------------------------
static void pci_configure_relaxed_ordering(struct pci_dev *dev)
{
	struct pci_dev *root;

	/* PCI_EXP_DEVICE_RELAX_EN is RsvdP in VFs */
	if (dev->is_virtfn)
		return;

	if (!pcie_relaxed_ordering_enabled(dev))
		return;

	/*
	 * For now, we only deal with Relaxed Ordering issues with Root
	 * Ports. Peer-to-Peer DMA is another can of worms.
	 */
	root = pci_find_pcie_root_port(dev);
	if (!root)
		return;

	if (root->dev_flags & PCI_DEV_FLAGS_NO_RELAXED_ORDERING) {
		pcie_capability_clear_word(dev, PCI_EXP_DEVCTL,
					   PCI_EXP_DEVCTL_RELAX_EN);
		pci_info(dev, "Relaxed Ordering disabled because the Root Port didn't support it\n");
	}
}



             reply	other threads:[~2020-06-04 12:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 12:35 Aya Levin [this message]
2020-06-05 19:08 ` Adding support for Relaxed ordering on a non-root device Bjorn Helgaas
2020-06-08 12:44   ` Aya Levin
2020-06-11 22:36     ` Bjorn Helgaas
2020-06-14  7:56       ` Aya Levin

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=1591274148-12230-1-git-send-email-ayal@mellanox.com \
    --to=ayal@mellanox.com \
    --cc=bhelgaas@google.com \
    --cc=dingtianhong@huawei.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=talgi@mellanox.com \
    --cc=tariqt@mellanox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox