netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* formal way to map from pf to vfs when using VT-d?
@ 2012-06-08 20:14 Chris Friesen
  2012-06-08 20:41 ` Chris Friesen
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Friesen @ 2012-06-08 20:14 UTC (permalink / raw)
  To: netdev, e1000-devel@lists.sourceforge.net, Kirsher, Jeffrey T,
	Brandeburg, Jesse, Allan, Bruce W


Hi,

I'm using the igb/igbvf drivers.  If I set igb.max_vfs=7,7,7,7 it 
creates 7 vfs for each of my pfs.  So far so good.

Now, how do I map from a given pf to the PCI addresses for the set of 
vfs that are associated with it?  I don't have virsh installed, so is 
there a way to query this with sysfs or something?

Thanks,
Chris




-- 

Chris Friesen
Software Designer

3500 Carling Avenue
Ottawa, Ontario K2H 8E9
www.genband.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: formal way to map from pf to vfs when using VT-d?
  2012-06-08 20:14 formal way to map from pf to vfs when using VT-d? Chris Friesen
@ 2012-06-08 20:41 ` Chris Friesen
  2012-06-09  0:04   ` Greg Rose
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Friesen @ 2012-06-08 20:41 UTC (permalink / raw)
  To: netdev, e1000-devel@lists.sourceforge.net, Kirsher, Jeffrey T,
	Brandeburg, Jesse, Allan, Bruce W

On 06/08/2012 02:14 PM, Chris Friesen wrote:
>
> Hi,
>
> I'm using the igb/igbvf drivers.  If I set igb.max_vfs=7,7,7,7 it 
> creates 7 vfs for each of my pfs.  So far so good.
>
> Now, how do I map from a given pf to the PCI addresses for the set of 
> vfs that are associated with it?  I don't have virsh installed, so is 
> there a way to query this with sysfs or something?
>

I think I found it.../sys/class/net/eth0/device/ has "virtfnX" entries 
which are symlinks to the appropriate pci address.

Chris

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: formal way to map from pf to vfs when using VT-d?
  2012-06-08 20:41 ` Chris Friesen
@ 2012-06-09  0:04   ` Greg Rose
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Rose @ 2012-06-09  0:04 UTC (permalink / raw)
  To: Chris Friesen
  Cc: netdev, e1000-devel@lists.sourceforge.net, Kirsher, Jeffrey T,
	Brandeburg, Jesse, Allan, Bruce W

On Fri, 8 Jun 2012 14:41:38 -0600
Chris Friesen <chris.friesen@genband.com> wrote:

> On 06/08/2012 02:14 PM, Chris Friesen wrote:
> >
> > Hi,
> >
> > I'm using the igb/igbvf drivers.  If I set igb.max_vfs=7,7,7,7 it 
> > creates 7 vfs for each of my pfs.  So far so good.
> >
> > Now, how do I map from a given pf to the PCI addresses for the set
> > of vfs that are associated with it?  I don't have virsh installed,
> > so is there a way to query this with sysfs or something?
> >
> 
> I think I found it.../sys/class/net/eth0/device/ has "virtfnX"
> entries which are symlinks to the appropriate pci address.

Here's a script used by our validation team, inserted inline.

#!/usr/bin/perl
use strict;

if ($#ARGV <1)
{
        print " Usage: ./list_vfs.pl Nic_name (t for Twinville, n for niantic, k for kawela, p for powerville) port_numer( 1 for first port, 2 for second port..) \n";

        exit ;
}
my $nic_name=$ARGV[0];
#my $port_n=$ARGV[1]%4;
my $all_vfs;
my $vf_str;
my $mode = 2;
my $my_pf_str;

if ($nic_name eq 't') {
        $my_pf_str= "\"10 Gigabit\"";
	$vf_str="\"Intel Corporation Device 1515\"";
} elsif ($nic_name eq 'n') {
	$my_pf_str="\"82599EB\"";
	$vf_str="\"82599 Ethernet Controller Virtual\"";
} elsif ($nic_name eq 'k') {
	$my_pf_str="\"82576 Gigabit Network Connection\"";
	$vf_str="\"Intel Corporation 82576 Virtual Function\"";
} elsif ($nic_name eq 'p') {
	$my_pf_str= "\"I350\"";
	$vf_str="\"Intel Corporation Device 1520\"";
	$mode=4;
} else {
	print "No such virtual Function device, please check again\n";
}

my $port_n=$ARGV[1]%$mode;

my $my_pf=qx(lspci | grep $my_pf_str | awk '{print \$1}' | awk 'NR%$mode==$port_n');
print  "PF=$my_pf\n";
my $all_vfs=qx(lspci | grep $vf_str | awk '{print \$1}' | awk 'NR%$mode==$port_n');
print "VFs are:\n";
print "$all_vfs\n";

- Greg

> 
> Chris
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-09  0:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-08 20:14 formal way to map from pf to vfs when using VT-d? Chris Friesen
2012-06-08 20:41 ` Chris Friesen
2012-06-09  0:04   ` Greg Rose

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).