linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dongdong Liu <liudongdong3@huawei.com>
Cc: helgaas@kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/4] PCI: Enable 10-Bit tag support for PCIe Endpoint devices
Date: Sat, 3 Apr 2021 10:50:28 +0100	[thread overview]
Message-ID: <20210403095028.GA2082662@infradead.org> (raw)
In-Reply-To: <1617440059-2478-3-git-send-email-liudongdong3@huawei.com>

> +	ret = pcie_capability_read_dword(dev, PCI_EXP_DEVCAP2, &cap);
> +	if (ret)
> +		return;

Wouldn't it make sense to store the devcap value in the pci_dev
structure instead of reading it multiple times?

> +	/* 10-Bit Tag Requester Enable in Device Control 2 Register is RsvdP for VF */

Please avoid the overly long lines.

> +	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ENDPOINT &&
> +	    dev->ext_10bit_tag_comp_path == 1 &&
> +	    (cap & PCI_EXP_DEVCAP2_10BIT_TAG_REQ)) {
> +		pci_info(dev, "enabling 10-Bit Tag Requester\n");

I think that printk might become a little too noisy when lots of
devices support this capability.

> +	unsigned int	ext_10bit_tag_comp_path:1; /* 10-Bit Tag Completer Supported from root to here */

Another crazy long line.  And why not just name this
10bit_tags?

Also a lot of this walk the upstream bridges until we hit the
root port code seems duplicatated for different capabilities.  Shouldn't
we have one such walk that checks all the interesting capabilities?  Or
even turn the thing around and set them on the fly while scanning
the topology?

  reply	other threads:[~2021-04-03  9:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-03  8:54 [PATCH 0/4] PCI: Enable 10-Bit tag support for PCIe devices Dongdong Liu
2021-04-03  8:54 ` [PATCH 1/4] PCI: Add 10-Bit Tag register definitions Dongdong Liu
2021-04-03  8:54 ` [PATCH 2/4] PCI: Enable 10-Bit tag support for PCIe Endpoint devices Dongdong Liu
2021-04-03  9:50   ` Christoph Hellwig [this message]
2021-04-06  2:33     ` Dongdong Liu
2021-04-03  8:54 ` [PATCH 3/4] PCI/IOV: Enable 10-Bit tag support for PCIe VF devices Dongdong Liu
2021-04-03  8:54 ` [PATCH 4/4] PCI: Enable 10-Bit tag support for PCIe RP devices Dongdong Liu
2021-04-03 10:32   ` kernel test robot
2021-04-03 12:33   ` kernel test robot
2021-04-06  2:41     ` Dongdong Liu

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=20210403095028.GA2082662@infradead.org \
    --to=hch@infradead.org \
    --cc=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=liudongdong3@huawei.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;
as well as URLs for NNTP newsgroup(s).