Subject: Re: [PATCH net-next] bnx2x: Add Nic partitioning mode (57712 devices)

From: Dimitris Michailidis <[email-masked]>
Date: Mon, 06 Dec 2010 10:21:50 -0800

Matt Domsch wrote:
> For SR-IOV, biosdevname follows the physfn and virtfn* pointers to map
> VFs to the PF.

This gives the PF a VF maps to but in general doesn't say anything about the 
port the VF maps to, unless you make additional assumptions as below.

> But it assumes 1 PF -> 1 port.  For the Intel 1GbE and
> 10GbE cards I have, this is true, but nothing says it has to be true.

Yes, there are devices for which this isn't true.  You can have several PFs 
mapping to 1 port, 1 PF mapping to several ports, a PF mapping to some 
port(s) but its VFs mapping to different port(s), ...

> Maybe something like:
> 
> /sys/class/net_port/<port_name>/<ifname> -> /sys/class/net/<ifname>
> 
> /sys/class/net/<ifname>/port -> /sys/class/net_port/<port_name>
> 
> This introduces the idea of ports, though adds the complication of
> needing to name them somehow.  But it would expose the relationship of
> each net interface to a specific port, as well as allow multiple
> interfaces per port, conceptually independent of the PCI device
> mapping.  That way, each driver, which must know the mapping somehow,
> could fill these links out?

/sys/class/net/<ifname>/dev_id indicates the physical port <ifname> is 
associated with.  At least a few drivers set up dev_id this way.