IT Community - Software Programming, Web Development and Technical Support

pci slot mappings in Linux

This is a discussion on pci slot mappings in Linux within the Operating Systems forums, part of the Computer Hardware/Software and Networking category; Hello friends Is there any reliable way to map PCI slot to device names in Linux - that is given ethN ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Computer Hardware/Software and Networking > Operating Systems

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-25-2008, 08:57 PM
satheesh satheesh is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 95
satheesh is on a distinguished road
Default pci slot mappings in Linux

Hello friends

Is there any reliable way to map PCI slot to device names in Linux - that is given ethN I am trying to map it to phisical location in the server - its been a long standing problem for me ..... especially if the server has different varieties of chipsets installed (broadcom,intel,etc) --
i am looking for this to actually make sure the drivers are attaching
corrrectly .......

For example to do this in solaris -

I would do a 'grep bgeNN /etc/path_to_inst'

#for the bge chipset and lookup the hardware adress in sun site..........to identify the slot #

Hope to find reply
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-25-2008, 09:27 PM
JSureshkumar JSureshkumar is offline
D-Web Sr.Programmer
 
Join Date: Feb 2007
Location: in someone's heart
Posts: 139
JSureshkumar is on a distinguished road
Send a message via Skype™ to JSureshkumar
Default Re: pci slot mappings in Linux

What could be the need for doing such a thing?

PCI has been a plug and play bus for years now. And newer versions viz
PCI-e and PCI-X are going to be even more easy.

Why do you want to manually figure out the PCI slot?

All that a driver needs in the PCI world are three things.

a) PCI device number
b) PCI function number
c) PCI bus number (Usually this is just 0)

Anyway to answer your question

#lspci -v -v |grep Ethernet


should get you what you want.

good luck
__________________
J Suresh Kumar
Google Hacks
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-25-2008, 09:34 PM
satheesh satheesh is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 95
satheesh is on a distinguished road
Default Re: pci slot mappings in Linux

right - i am looking to find a way how the device names are assigned - and
in what particular order the onbaord , pci nics are scanned in linux ....if
i have no physical access to the server and if someone tells me PCI slot 4
(labeled on the server) is connected to switch A....
how can i figure out which ethN it is .....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-25-2008, 09:37 PM
satheesh satheesh is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 95
satheesh is on a distinguished road
Default Re: pci slot mappings in Linux

to clarify my woes a bit further -
if i add a new pci device (lets assume a
SCSI controller or even another NIC) ..the device names get reordered and/or
renamed - so one has to redo the
ifcfg-ethNN files
..check if the drivers are attaching to the right NICs ...
reconfigure modules.conf/modprobe.conf(distro specific).......

doing a search on the web , few folks have suggested to have a
udev rule(kernel version >=2.6.*) to bind mac adresss or device adresss to the
device logical name --
hmm - there must be a simpler way to do this - especially in 2.4 kernels .............
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-25-2008, 09:39 PM
nnraja nnraja is offline
D-Web Programmer
 
Join Date: May 2007
Posts: 94
nnraja is on a distinguished road
Default Re: pci slot mappings in Linux

Use nameif command to name network interfaces based on MAC addresses.

Thanks
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-25-2008, 09:47 PM
shaalini shaalini is offline
D-Web Analyst
 
Join Date: Apr 2007
Posts: 342
shaalini is on a distinguished road
Default Re: pci slot mappings in Linux

Quote:
Originally Posted by satheesh View Post
Hello friends

Is there any reliable way to map PCI slot to device names in Linux - that is given ethN I am trying to map it to phisical location in the server - its been a long standing problem for me ..... especially if the server has different varieties of chipsets installed (broadcom,intel,etc) --
i am looking for this to actually make sure the drivers are attaching
corrrectly .......

For example to do this in solaris -

I would do a 'grep bgeNN /etc/path_to_inst'

#for the bge chipset and lookup the hardware adress in sun site..........to identify the slot #

Hope to find reply
Long time back (2.4.x), in /etc/modules.conf one could force it like so
alias <driver1> eth0
alias <driver2> eth1

IIRC, some drivers took interrupt no. as an option to separate the NICs
that used the same driver.

I have not done this on the 2.6.y kernel.
__________________
Shaalini.S
Be the Best of Whatever you are...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-25-2008, 09:49 PM
nnraja nnraja is offline
D-Web Programmer
 
Join Date: May 2007
Posts: 94
nnraja is on a distinguished road
Default Re: pci slot mappings in Linux

Quote:
Originally Posted by shaalini View Post
Long time back (2.4.x), in /etc/modules.conf one could force it like so
alias <driver1> eth0
alias <driver2> eth1
..
.....
.
if both are identical card, then 'nameif' help us to set the order
based on the mac addr.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 03-26-2008, 08:58 PM
satheesh satheesh is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 95
satheesh is on a distinguished road
Default Re: pci slot mappings in Linux

Quote:
Originally Posted by nnraja View Post
if both are identical card, then 'nameif' help us to set the order
based on the mac addr.
the issue i see with using nameif is..
if you replace the card.....u need to remember to do this again ....
but a useful solution ..

Thanks
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 03-26-2008, 09:02 PM
arjkhanna arjkhanna is offline
D-Web Genius
 
Join Date: Mar 2007
Posts: 1,102
arjkhanna is on a distinguished road
Default Re: pci slot mappings in Linux

Quote:
Originally Posted by satheesh View Post
to clarify my woes a bit further -
if i add a new pci device (lets assume a
SCSI controller or even another NIC) ..the device names get reordered and/or
renamed - so one has to redo the
ifcfg-ethNN files
..check if the drivers are attaching to the right NICs ...
reconfigure modules.conf/modprobe.conf(distro specific).......

doing a search on the web , few folks have suggested to have a
udev rule(kernel version >=2.6.*) to bind mac adresss or device adresss to the
device logical name --
hmm - there must be a simpler way to do this .............
That is the right way for 2.6 kernels. What is not simple in it? Add
to udev rules (for example):

# PCI device 0x1317:0x0985 (tulip)
SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="00:50:bf:99:ce:9e",
NAME="eth1"

Quote:
Originally Posted by satheesh View Post
- especially in 2.4 kernels ..
For 2.4, you can use hotplug scripts:
Linux Hotplugging

Thank you
__________________
A.Rajesh Khanna
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get IE for linux? shaalini Operating Systems 4 03-28-2008 10:42 PM
How to install Linux in my PC? $enthil Operating Systems 1 01-09-2008 10:17 PM
Notes of Linux vigneshgets Operating Systems 0 11-16-2007 06:13 AM
Linux installers swoosh The Lounge 0 03-14-2007 10:14 PM
Linux anyone? drecko The Lounge 8 03-08-2007 08:00 PM


All times are GMT -7. The time now is 03:39 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0