netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Cree <ecree.xilinx@gmail.com>
To: Roi Dayan <roid@nvidia.com>,
	ecree@xilinx.com, netdev@vger.kernel.org,
	linux-net-drivers@amd.com
Cc: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com, corbet@lwn.net, linux-doc@vger.kernel.org,
	jacob.e.keller@intel.com, jesse.brandeburg@intel.com,
	michael.chan@broadcom.com, andy@greyhouse.net, saeed@kernel.org,
	jiri@resnulli.us, snelson@pensando.io, simon.horman@corigine.com,
	alexander.duyck@gmail.com, rdunlap@infradead.org
Subject: Re: [RFC PATCH v2 net-next] docs: net: add an explanation of VF (and other) Representors
Date: Fri, 19 Aug 2022 16:18:19 +0100	[thread overview]
Message-ID: <bb31b68c-1303-0f18-eace-74bf7e05cbb1@gmail.com> (raw)
In-Reply-To: <5edbd360-7afb-2605-21ba-7337be15e235@nvidia.com>

On 18/08/2022 16:07, Roi Dayan wrote:
> On 2022-08-15 5:22 PM, ecree@xilinx.com wrote:
>> +The representor netdevice should *not* directly refer to a PCIe device (e.g.
>> +through ``net_dev->dev.parent`` / ``SET_NETDEV_DEV()``), either of the
>> +representee or of the master PF.
> 
> Hi,
> maybe I'm confused here, but why representor should not refer to pci
> device ? it does exists today for systemd renaming.
> and this is used beside of implementing the other ndos you mention
> below.

The master PF is already identified via ``phys_switch_id``, another linkage
 is not needed and only means that userland looking up netdevices by PCIe
 address has to do another step to distinguish the PF's own netdev from all
 the representors.  Allegedly[1] nfp ran into issues where OpenStack would
 sometimes use the reprs for ops that logically should have been on the PF
 because they all had the same /sys/class/net/$INTF/device and it wasn't
 smart enough to tell the difference.

Semantically, the representor is a virtual device, that's backed by the PF
 netdevice rather than the PF's hardware directly — even if it has e.g.
 dedicated queues, it's still not in administrative control of the PCIe
 function in the way that the PF driver instance is.  And compare to e.g.
 a vlan netdev stacked on top of the PF netdev — we don't put the PF in
 /sys/class/net/vlan0/device...

> $  git grep SET_NETDEV_DEV|grep rep
> drivers/net/ethernet/intel/ice/ice_repr.c: SET_NETDEV_DEV(repr->netdev, ice_pf_to_dev(vf->pf));
> drivers/net/ethernet/mellanox/mlx5/core/en_rep.c: SET_NETDEV_DEV(netdev, mdev->device);
> drivers/net/ethernet/netronome/nfp/flower/main.c: SET_NETDEV_DEV(repr, &priv->nn->pdev->dev);

Yes, several existing drivers do this[2].  IMHO they're wrong.

-ed

[1]: https://lore.kernel.org/all/20220728113231.26fdfab0@kernel.org/
[2]: https://lore.kernel.org/netdev/71af8654-ca69-c492-7e12-ed7ff455a2f1@gmail.com/

  reply	other threads:[~2022-08-19 15:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15 14:22 [RFC PATCH v2 net-next] docs: net: add an explanation of VF (and other) Representors ecree
2022-08-18  9:56 ` Marcin Szycik
2022-08-19 15:20   ` Edward Cree
2022-08-18 11:20 ` Simon Horman
2022-08-18 15:07 ` Roi Dayan
2022-08-19 15:18   ` Edward Cree [this message]
2022-08-18 16:44 ` Parav Pandit
2022-08-19 16:36   ` Edward Cree
2022-08-19 18:59     ` Parav Pandit

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=bb31b68c-1303-0f18-eace-74bf7e05cbb1@gmail.com \
    --to=ecree.xilinx@gmail.com \
    --cc=alexander.duyck@gmail.com \
    --cc=andy@greyhouse.net \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=ecree@xilinx.com \
    --cc=edumazet@google.com \
    --cc=jacob.e.keller@intel.com \
    --cc=jesse.brandeburg@intel.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-net-drivers@amd.com \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=roid@nvidia.com \
    --cc=saeed@kernel.org \
    --cc=simon.horman@corigine.com \
    --cc=snelson@pensando.io \
    /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).