From: Jakub Kicinski <kuba@kernel.org>
To: Martin Habets <habetsm.xilinx@gmail.com>
Cc: Bjorn Helgaas <helgaas@kernel.org>,
davem@davemloft.net, pabeni@redhat.com, edumazet@google.com,
netdev@vger.kernel.org, ecree.xilinx@gmail.com,
linux-pci@vger.kernel.org,
virtualization@lists.linux-foundation.org
Subject: Re: [PATCH net-next v2 0/2] sfc: Add EF100 BAR config support
Date: Mon, 11 Jul 2022 11:48:06 -0700 [thread overview]
Message-ID: <20220711114806.2724b349@kernel.org> (raw)
In-Reply-To: <Yswn7p+OWODbT7AR@gmail.com>
On Mon, 11 Jul 2022 14:38:54 +0100 Martin Habets wrote:
> > Normally drivers rely on the PCI Vendor and Device ID to learn the
> > number of BARs and their layouts. I guess this series implies that
> > doesn't work on this device? And the user needs to manually specify
> > what kind of device this is?
>
> When a new PCI device is added (like a VF) it always starts of with
> the register layout for an EF100 network device. This is hardcoded,
> i.e. it cannot be customised.
> The layout can be changed after bootup, and only after the sfc driver has
> bound to the device.
> The PCI Vendor and Device ID do not change when the layout is changed.
>
> For vDPA specifically we return the Xilinx PCI Vendor and our device ID
> to the vDPA framework via struct vdpa_config_opts.
So it's switching between ethernet and vdpa? Isn't there a general
problem for configuring vdpa capabilities (net vs storage etc) and
shouldn't we seek to solve your BAR format switch in a similar fashion
rather than adding PCI device attrs, which I believe is not done for
anything vDPA-related?
> > I'm confused about how this is supposed to work. What if the driver
> > is built-in and claims a device before the user can specify the
> > register layout?
>
> The bar_config file will only exist once the sfc driver has bound to
> the device. So in fact we count on that driver getting loaded.
> When a new value is written to bar_config it is the sfc driver that
> instructs the NIC to change the register layout.
When you say "driver bound" you mean the VF driver, right?
> > What if the user specifies the wrong layout and the
> > driver writes to the wrong registers?
>
> We have specific hardware and driver requirements for this sort of
> situation. For example, the register layouts must have some common
> registers (to ensure some compatibility).
> A layout that is too different will require a separate device ID.
> A driver that writes to the wrong register is a bug.
>
> Maybe the name "bar_config" is causing most of the confusion here.
> Internally we also talk about "function profiles" or "personalities",
> but we thought such a name would be too vague.
next prev parent reply other threads:[~2022-07-11 18:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 13:07 [PATCH net-next v2 0/2] sfc: Add EF100 BAR config support Martin Habets
2022-07-07 13:07 ` [PATCH net-next v2 1/2] " Martin Habets
2022-07-07 13:07 ` [PATCH net-next v2 2/2] sfc: Implement change of BAR configuration Martin Habets
2022-07-07 15:55 ` [PATCH net-next v2 0/2] sfc: Add EF100 BAR config support Bjorn Helgaas
2022-07-11 13:38 ` Martin Habets
2022-07-11 18:48 ` Jakub Kicinski [this message]
2022-07-13 8:40 ` Martin Habets
2022-07-13 18:48 ` Jakub Kicinski
2022-07-14 11:32 ` Martin Habets
2022-07-14 16:05 ` Jakub Kicinski
2022-08-03 7:57 ` Jason Wang
2022-08-12 9:38 ` Martin Habets
2022-08-12 19:18 ` Jakub Kicinski
2022-07-11 22:00 ` Bjorn Helgaas
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=20220711114806.2724b349@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=habetsm.xilinx@gmail.com \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/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).