Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Sat Aug 19, 2017 2:44 am


System administration, processes administration, jobs, cron, resources, limits, shells, ssh, telnet.

Author Message
mandrei99
Post  Post subject: Linux network interface pci slot information - lspci / Intel or Broadcom  |  Posted: Fri Jan 16, 2015 7:58 pm

Joined: Tue Aug 04, 2009 9:16 am
Posts: 245

Offline
 

Linux network interface pci slot information - lspci / Intel or Broadcom

How to determine PCI slot information of your Linux server's network interface cards.
Network card manufacturers provide interface cards with more than one port and in some situations you can have both an Intel chip based card and Broadcome one.
Linux "ifconfig" and "iproute2" utilies show ethernet card information like IP address, kernel flags, state, counters, but it does not show manufacturer information nor kernel driver information for that interface.

How to determine if an eth interface is Intel or Broadcom in Linux based on their PCI slot address.

Method one: the ethtool way (short) to find out driver information on ethernet card.
Code:
# ethtool -i eth0       
driver: bnx2
version: 2.2.5f
firmware-version: 5.0.9 bc 5.0.6 NCSI 2.0.3
bus-info: 0000:01:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no

# modinfo bnx2
filename:       /lib/modules/3.10.0-5-pve/kernel/drivers/net/ethernet/broadcom/bnx2.ko
version:        2.2.5f
license:        GPL
description:    Broadcom NetXtreme II BCM5706/5708/5709/5716 Driver
author:         Michael Chan <mchan@broadcom.com>
srcversion:     FB6AE382ED134433CE0E4A7
alias:          pci:v000014E4d0000163Csv*sd*bc*sc*i*
alias:          pci:v000014E4d0000163Bsv*sd*bc*sc*i*
alias:          pci:v000014E4d0000163Asv*sd*bc*sc*i*
alias:          pci:v000014E4d00001639sv*sd*bc*sc*i*
alias:          pci:v000014E4d000016ACsv*sd*bc*sc*i*
alias:          pci:v000014E4d000016AAsv*sd*bc*sc*i*
alias:          pci:v000014E4d000016AAsv0000103Csd00003102bc*sc*i*
alias:          pci:v000014E4d0000164Csv*sd*bc*sc*i*
alias:          pci:v000014E4d0000164Asv*sd*bc*sc*i*
alias:          pci:v000014E4d0000164Asv0000103Csd00003106bc*sc*i*
alias:          pci:v000014E4d0000164Asv0000103Csd00003101bc*sc*i*
depends:       
vermagic:       3.10.0-5-pve SMP mod_unload modversions
parm:           disable_msi:Disable Message Signaled Interrupt (MSI) (int)
parm:           stop_on_tx_timeout:For debugging purposes, prevent a chip  reset when a tx timeout occurs (int)

Quote from "man ethtool":
Quote:
-i --driver
Queries the specified network device for associated driver information.


There you have it: Broadcom.

Method two: Using lspci and the linux kernel mapped /sys filesystem:
For this, lspci is queried to map server pci bus information. We're interested in "-tv" switches:
Quote:
...
DESCRIPTION
lspci is a utility for displaying information about PCI buses in the system and devices connected to them.

By default, it shows a brief list of devices. Use the options described below to request either a more verbose output or output intended for parsing by
other programs.

If you are going to report bugs in PCI device drivers or in lspci itself, please include output of "lspci -vvx" or even better "lspci -vvxxx" (however, see
below for possible caveats).

Some parts of the output, especially in the highly verbose modes, are probably intelligible only to experienced PCI hackers. For exact definitions of the
fields, please consult either the PCI specifications or the header.h and /usr/include/linux/pci.h include files.

Access to some parts of the PCI configuration space is restricted to root on many operating systems, so the features of lspci available to normal users are
limited. However, lspci tries its best to display as much as available and mark all other information with <access denied> text.
...
-t Show a tree-like diagram containing all buses, bridges, devices and connections between them.
...
-v Be verbose and display detailed information about all devices.
[/quote]
Code:
# lspci -tv
...
  \-[0000:00]-+-00.0  Intel Corporation 5520 I/O Hub to ESI Port
             +-01.0-[01]--+-00.0  Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
             |            \-00.1  Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
             +-03.0-[02]--+-00.0  Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
             |            \-00.1  Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
             +-04.0-[03]----00.0  LSI Logic / Symbios Logic MegaRAID SAS 1078
...


So we have a Broadcom card with four ports. Which one is which ?
Code:
# find /sys/ | grep eth0
...
:~# find /sys/devices/ -name device | grep eth
/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/net/eth0/device
/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.1/net/eth1/device
/sys/devices/pci0000:00/0000:00:03.0/0000:02:00.0/net/eth2/device
/sys/devices/pci0000:00/0000:00:03.0/0000:02:00.1/net/eth3/device
...

Between the two outputs above, we can see which interface port belongs to which interface card (eth0 to eth3 are part of a quad port BCM5709 card).

An there is also dmesg way to find out your card is Intel or Broadcom:
Code:
# dmesg | grep eth0
[    1.062475] bnx2 0000:01:00.0 eth0: Broadcom NetXtreme II BCM5709 1000Base-T (C0) PCI Express found at mem d6000000, IRQ 36, node addr 00:26:a1:4e:1c:2c





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "Linux network interface pci slot information - lspci / Intel or Broadcom"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. How to list PCI devices in Linux - lspci

mandrei99

0

1268

Mon Jul 22, 2013 10:03 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to print filesystem super block information in Linux

mandrei99

0

6905

Mon Jul 08, 2013 6:56 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to identify each ethX device in Linux to what dual or quad port interface card it belongs to

mandrei99

0

713

Mon Jul 22, 2013 10:08 am

mandrei99 View the latest post

There are no new unread posts for this topic. How to read UFS filesystem super block information in FreeBSD

mandrei99

0

1379

Mon Jul 22, 2013 9:52 am

mandrei99 View the latest post

There are no new unread posts for this topic. Linux clear screen / terminal

mandrei99

2

4575

Wed Mar 04, 2015 8:52 am

Guest View the latest post

There are no new unread posts for this topic. Linux: List kernel supported filesystems

debuser

0

434

Tue Mar 10, 2015 5:45 pm

debuser View the latest post

There are no new unread posts for this topic. Linux: list block devices UUID

debuser

0

783

Tue Mar 10, 2015 5:46 pm

debuser View the latest post

There are no new unread posts for this topic. How to prevent Linux SSH client from disconnecting using ServerAliveInterval

mandrei99

0

14503

Fri Jan 09, 2015 8:26 pm

mandrei99 View the latest post

There are no new unread posts for this topic. Change default editor to VI in Debian Linux

mandrei99

0

631

Fri Jan 16, 2015 6:59 pm

mandrei99 View the latest post

There are no new unread posts for this topic. How to list the largest files in a directory in Linux/FreeBSD

mandrei99

0

536

Thu Jan 22, 2015 5:14 pm

mandrei99 View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO