From owner-freebsd-net@freebsd.org Wed Mar 30 00:27:42 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA587AE2301 for ; Wed, 30 Mar 2016 00:27:42 +0000 (UTC) (envelope-from pallav_bose@yahoo.com) Received: from nm45-vm8.bullet.mail.gq1.yahoo.com (nm45-vm8.bullet.mail.gq1.yahoo.com [67.195.87.166]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3FCA197E for ; Wed, 30 Mar 2016 00:27:42 +0000 (UTC) (envelope-from pallav_bose@yahoo.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1459297656; bh=oZRC2LieFjr9hLOYs483qDJg31iVG1Y5LI883DBaat8=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=aV+72n0gmkZgjP9vgFgGZxK5GeAuJl0SKJNN6dlOevY4/jD1MQ8K5WQ9NjiyZlMEVSpxFXz76CMNdIlmwAHU/lPOl1IF7U9IDe2MJpf3MyBhAzNsdoIbo3yN9YbjtyPVMoYtqeKhGmKwyjxvfOiaqWdOUjE+yiFfuoYVFZ7hZcIMAO1QkW5K9pQooT82u9ompjpLxwSWUAUrxNXm0DDuRxQQ+Ju61OOI8M8HTWWASmrJjtYZKUKYdGiDOi51pqPDRyposP5/ah0ZI1jkwgZChtPTaNOtmHO4fv16MwJwz37g+6kE0qR2r1AUsGXSFknqSw2B6tGuibIQZVd8tpgSZg== Received: from [127.0.0.1] by nm45.bullet.mail.gq1.yahoo.com with NNFMP; 30 Mar 2016 00:27:36 -0000 Received: from [216.39.60.182] by nm45.bullet.mail.gq1.yahoo.com with NNFMP; 30 Mar 2016 00:24:44 -0000 Received: from [98.137.12.233] by tm18.bullet.mail.gq1.yahoo.com with NNFMP; 30 Mar 2016 00:24:44 -0000 Received: from [127.0.0.1] by omp1041.mail.gq1.yahoo.com with NNFMP; 30 Mar 2016 00:24:44 -0000 X-Yahoo-Newman-Property: ymail-4 X-Yahoo-Newman-Id: 508741.12317.bm@omp1041.mail.gq1.yahoo.com X-YMail-OSG: rX6t2FgVM1nk7ZyPFuUzI_0DqCL76EYSJz_wihqXfu0SNQ5Esb4DAf90dmWRPvu Htr4IoRXa16DrBxKzrIsUchlF8WNkchX9i4Q7ZfUoKALHRJJvcKWgAQNCHElh9x9fIFMFRg8ltJX XD8JaYIiTDz3IssT701kRZcUVWgzzO4mJFjlmk6Wu4C4ct_uZlA3YC5mWiTo7CGoLTTR1vPoTC1v Rz6AhJUcw86CwcuKvxoBiPJKc8150NxiWQlfnq15PhU5nRJoRE30DSYL5Fmg5DSTWIaRpajLApkm __z8l9bPqu7CmLJPmPL9LQtl89R.546jLAWJG_DgkTJT8iaSMA3J6mGmFxruLe1e7RiMWvWrh.KT r7HvBbi.sj5zBtL9Vq9ikEM3E_TYIfsrOfAsMRPs6ImI6GujTlh7_Hv7FK5WSx1FdbdgGa4T.W7e LkNMoDHiRRhKVQmML6lGLW2K.nTOTW2h.mTorwbmaB_uYktc7rQkjo1wD8.XAq5i_NoHACoAxYEp nWO8CNkJ8emKjfFUD0H4- Received: by 216.39.60.159; Wed, 30 Mar 2016 00:24:44 +0000 Date: Wed, 30 Mar 2016 00:24:36 +0000 (UTC) From: Pallav Bose Reply-To: Pallav Bose To: John Nielsen Cc: "freebsd-net@freebsd.org" Message-ID: <149418412.2244066.1459297476897.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <7101EBFF-0D3B-4BE3-976F-06DBF76EB5B8@jnielsen.net> References: <7101EBFF-0D3B-4BE3-976F-06DBF76EB5B8@jnielsen.net> Subject: Re: Identify physical port given a network interface name on Dell PowerEdge servers? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 00:27:43 -0000 Thank you, John. Yes, dmidecode works perfectly for onboard NICs, but I was= n't able to obtain precise information about a NIC connected via a PCI slot= . All I can see is that the PCI bus is in use and its address. In the output below, there is an Intel 10G NIC in PCI slot 6. # dmidecode -t slot # dmidecode 2.10 SMBIOS 2.8 present. Handle 0x0900, DMI type 9, 17 bytes System Slot Information =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Designation: PCIe Slot 1 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Type: x8 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Current Usage: Available =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Length: Long =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Characteristics: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 3.3 V is provided =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 PME signal is supported Handle 0x0901, DMI type 9, 17 bytes System Slot Information =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Designation: PCIe Slot 2 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Type: x8 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Current Usage: Available =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Length: Long =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Characteristics: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 3.3 V is provided =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 PME signal is supported Handle 0x0902, DMI type 9, 17 bytes System Slot Information =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Designation: PCIe Slot 3 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Type: x8 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Current Usage: Available =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Length: Long =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Characteristics: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 3.3 V is provided =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 PME signal is supported Handle 0x0903, DMI type 9, 17 bytes System Slot Information =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Designation: PCIe Slot 4 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Type: x8 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Current Usage: In Use =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Length: Long =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Characteristics: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 3.3 V is provided =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 PME signal is supported =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Bus Address: 0000:82:00.0 Handle 0x0904, DMI type 9, 17 bytes System Slot Information =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Designation: PCIe Slot 5 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Type: x8 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Current Usage: Available =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Length: Long =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Characteristics: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 3.3 V is provided =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 PME signal is supported Handle 0x0905, DMI type 9, 17 bytes System Slot Information =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Designation: PCIe Slot 6 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Type: x8 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Current Usage: In Use =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Length: Long =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Characteristics: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 3.3 V is provided =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 PME signal is supported =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Bus Address: 0000:04:00.0 # pciconf -bclv | grep -E "ix|bge" ix0@pci0:4:0:0: class=3D0x020000 card=3D0x50038086 chip=3D0x15288086 rev=3D= 0x01 hdr=3D0x00 ix1@pci0:4:0:1: class=3D0x020000 card=3D0x50038086 chip=3D0x15288086 rev=3D= 0x01 hdr=3D0x00 bge0@pci0:2:0:0:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 class=3D0x020000= card=3D0x1f5b1028 chip=3D0x165f14e4 rev=3D0x00 hdr=3D0x00 bge1@pci0:2:0:1:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 class=3D0x020000= card=3D0x1f5b1028 chip=3D0x165f14e4 rev=3D0x00 hdr=3D0x00 bge2@pci0:1:0:0:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 class=3D0x020000= card=3D0x1f5b1028 chip=3D0x165f14e4 rev=3D0x00 hdr=3D0x00 bge3@pci0:1:0:1:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 class=3D0x020000= card=3D0x1f5b1028 chip=3D0x165f14e4 rev=3D0x00 hdr=3D0x00 I can't tell whether ix0@pci0:4:0:0 is the first port on the Intel card or= the second. Regards,Pallav=20 On Tuesday, March 29, 2016 3:56 PM, John Nielsen w= rote: =20 =20 > On Mar 29, 2016, at 4:44 PM, John Nielsen wrote: >=20 >=20 >> On Mar 29, 2016, at 3:42 PM, Pallav Bose via freebsd-net wrote: >>=20 >> Is there a way for me to identify which physical port corresponds to a g= iven interface name? For example, the input to my script/program is the net= work interface name, like bge0/ix0, and the output is the physical port whi= ch maps to this interface, like, LOM1/LOM2 or NIC1 port 1 (in case a NIC ca= rd is attached via the PCI bus). This program/script will run on a Dell Pow= erEdge server. >>=20 >> LOM stands for LAN On Motherboard. >=20 > It sounds like you're looking for something like Dell's biosdevname for L= inux. I don't think such a thing exists on FreeBSD, but if you can figure o= ut how to get it the same data should be available from the BIOS. I would s= tart by scrutinizing the output of "dmidecode"; if it's in there then you c= an just parse it out for your script. If not, you can always dive through t= he source of biosdevname: >=20 > http://linux.dell.com/git/biosdevname.git/ See also: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/ht= ml/Networking_Guide/sec-Consistent_Network_Device_Naming_Using_biosdevname.= html#sec-Consistent_Network_Device_Naming-System_Requirements I don't have access to a Dell box running FreeBSD but on a PowerEdge server= running CentOS 6 this command looks like it returned all the raw info you = would need to implement your own "biosdevname-lite". Specifically you could= map the NIC number from the "Reference Designation" to its PCI bus address= and then call it whatever you wanted: # dmidecode -t 41 # dmidecode 2.12 SMBIOS 2.6 present. Handle 0x2900, DMI type 41, 11 bytes Onboard Device =C2=A0=C2=A0=C2=A0 Reference Designation: Embedded NIC 1=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =20 =C2=A0=C2=A0=C2=A0 Type: Ethernet =C2=A0=C2=A0=C2=A0 Status: Enabled =C2=A0=C2=A0=C2=A0 Type Instance: 1 =C2=A0=C2=A0=C2=A0 Bus Address: 0000:01:00.0 Handle 0x2901, DMI type 41, 11 bytes Onboard Device =C2=A0=C2=A0=C2=A0 Reference Designation: Embedded NIC 2=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =20 =C2=A0=C2=A0=C2=A0 Type: Ethernet =C2=A0=C2=A0=C2=A0 Status: Enabled =C2=A0=C2=A0=C2=A0 Type Instance: 2 =C2=A0=C2=A0=C2=A0 Bus Address: 0000:01:00.1 [...] From owner-freebsd-net@freebsd.org Wed Mar 30 01:58:07 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C7E5ADF3C6 for ; Wed, 30 Mar 2016 01:58:07 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C98721553 for ; Wed, 30 Mar 2016 01:58:06 +0000 (UTC) (envelope-from fjwcash@gmail.com) Received: by mail-io0-x234.google.com with SMTP id g185so48741596ioa.2 for ; Tue, 29 Mar 2016 18:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=4uKMhf4G/XPFz+jKypdqb2egeL2nf9OIshEwDUViptc=; b=pfLRNgNankTOZWHlJxb6Nf00eWxT++Z0xu+usOYhOqCvXBf3UrCOUo8qX8O6/KOq3c oFTLJFQXigmn/z68bowHUHMXQaLP16/dE0+GBP4WgXSzKHteSKBSyo+VW0fLKguewp2H kCbC3xS0dcZe6XFojl8xcRnuAkYRSrKrOxQgCy7NQ6hwC4VE02HpIHgmsyt6IXuDqtuf 0TVRfB6QW2GBMMho65YwWbBzfOTfytmFAesbqs+7QMuJKqnb1CGO9dshc73W5fQOvqGQ B1Zrx/KWUFzzFaQ4s9z0ZRh8qqW8tZWiuA2OkdgwM6tEYkF6J4TbhWo19MwsYRs0YGnl 2KiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=4uKMhf4G/XPFz+jKypdqb2egeL2nf9OIshEwDUViptc=; b=ArY8a9enKEVvseJ3vHMMa+ulS7htuFYp19slEOGHBqro3T39XA8P+eXPzwf420yoSb d95RNxRXsvavH/sRhfWzHuYfvz/l5JxjI4Apl8FViP7UfuUGoFLC8OFikr+5rbF4GYMF VR/L5A3lCLIGQAwORhavfOzvCmMOQ/iKQtEijrsrtRz7+Rc/ENZnpqKBKAX8gIjTaFbq m29wGTC8MwDgFckwBdgf1XBv8PmmBUdGo4PDeWiOtB4Etcb1/m8pFMbnePxad5cf0Uo7 V4vzKfhYuZSJmjNN3Td9IIq3VW743hfOoLQmlwXrwlRTCg3pzJnS7MuwD8mWAMJeUs32 ENrg== X-Gm-Message-State: AD7BkJIlsmLlFEjTOsiKkV4s9pOdsS7oLTxs0JDgWEucwyu50G3VO7nAXaF262t6684KZZtRpuuQF8g+TLLRbw== MIME-Version: 1.0 X-Received: by 10.107.163.137 with SMTP id m131mr6547821ioe.1.1459303086108; Tue, 29 Mar 2016 18:58:06 -0700 (PDT) Received: by 10.107.161.6 with HTTP; Tue, 29 Mar 2016 18:58:05 -0700 (PDT) Received: by 10.107.161.6 with HTTP; Tue, 29 Mar 2016 18:58:05 -0700 (PDT) In-Reply-To: <149418412.2244066.1459297476897.JavaMail.yahoo@mail.yahoo.com> References: <7101EBFF-0D3B-4BE3-976F-06DBF76EB5B8@jnielsen.net> <149418412.2244066.1459297476897.JavaMail.yahoo@mail.yahoo.com> Date: Tue, 29 Mar 2016 18:58:05 -0700 Message-ID: Subject: Re: Identify physical port given a network interface name on Dell PowerEdge servers? From: Freddie Cash To: Pallav Bose Cc: freebsd-net , John Nielsen Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2016 01:58:07 -0000 4:0:0 vs 4:0:1 Looks to me like ix0 would be port 0, and ix1 would be port 1. On Mar 29, 2016 5:27 PM, "Pallav Bose via freebsd-net" < freebsd-net@freebsd.org> wrote: > Thank you, John. Yes, dmidecode works perfectly for onboard NICs, but I > wasn't able to obtain precise information about a NIC connected via a PCI > slot. All I can see is that the PCI bus is in use and its address. > In the output below, there is an Intel 10G NIC in PCI slot 6. > > # dmidecode -t slot > # dmidecode 2.10 > SMBIOS 2.8 present. > > Handle 0x0900, DMI type 9, 17 bytes > System Slot Information > Designation: PCIe Slot 1 > Type: x8 > Current Usage: Available > Length: Long > Characteristics: > 3.3 V is provided > PME signal is supported > > Handle 0x0901, DMI type 9, 17 bytes > System Slot Information > Designation: PCIe Slot 2 > Type: x8 > Current Usage: Available > Length: Long > Characteristics: > 3.3 V is provided > PME signal is supported > > Handle 0x0902, DMI type 9, 17 bytes > System Slot Information > Designation: PCIe Slot 3 > Type: x8 > Current Usage: Available > Length: Long > Characteristics: > 3.3 V is provided > PME signal is supported > > Handle 0x0903, DMI type 9, 17 bytes > System Slot Information > Designation: PCIe Slot 4 > Type: x8 > Current Usage: In Use > Length: Long > Characteristics: > 3.3 V is provided > PME signal is supported > Bus Address: 0000:82:00.0 > > Handle 0x0904, DMI type 9, 17 bytes > System Slot Information > Designation: PCIe Slot 5 > Type: x8 > Current Usage: Available > Length: Long > Characteristics: > 3.3 V is provided > PME signal is supported > > Handle 0x0905, DMI type 9, 17 bytes > System Slot Information > Designation: PCIe Slot 6 > Type: x8 > Current Usage: In Use > Length: Long > Characteristics: > 3.3 V is provided > PME signal is supported > Bus Address: 0000:04:00.0 > > # pciconf -bclv | grep -E "ix|bge" > ix0@pci0:4:0:0: class=0x020000 card=0x50038086 chip=0x15288086 rev=0x01 > hdr=0x00 > ix1@pci0:4:0:1: class=0x020000 card=0x50038086 chip=0x15288086 rev=0x01 > hdr=0x00 > bge0@pci0:2:0:0: class=0x020000 card=0x1f5b1028 chip=0x165f14e4 > rev=0x00 hdr=0x00 > bge1@pci0:2:0:1: class=0x020000 card=0x1f5b1028 chip=0x165f14e4 > rev=0x00 hdr=0x00 > bge2@pci0:1:0:0: class=0x020000 card=0x1f5b1028 chip=0x165f14e4 > rev=0x00 hdr=0x00 > bge3@pci0:1:0:1: class=0x020000 card=0x1f5b1028 chip=0x165f14e4 > rev=0x00 hdr=0x00 > > I can't tell whether ix0@pci0:4:0:0 is the first port on the Intel card > or the second. > > Regards,Pallav > > On Tuesday, March 29, 2016 3:56 PM, John Nielsen > wrote: > > > > > On Mar 29, 2016, at 4:44 PM, John Nielsen wrote: > > > > > >> On Mar 29, 2016, at 3:42 PM, Pallav Bose via freebsd-net < > freebsd-net@freebsd.org> wrote: > >> > >> Is there a way for me to identify which physical port corresponds to a > given interface name? For example, the input to my script/program is the > network interface name, like bge0/ix0, and the output is the physical port > which maps to this interface, like, LOM1/LOM2 or NIC1 port 1 (in case a NIC > card is attached via the PCI bus). This program/script will run on a Dell > PowerEdge server. > >> > >> LOM stands for LAN On Motherboard. > > > > It sounds like you're looking for something like Dell's biosdevname for > Linux. I don't think such a thing exists on FreeBSD, but if you can figure > out how to get it the same data should be available from the BIOS. I would > start by scrutinizing the output of "dmidecode"; if it's in there then you > can just parse it out for your script. If not, you can always dive through > the source of biosdevname: > > > > http://linux.dell.com/git/biosdevname.git/ > > See also: > > https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec-Consistent_Network_Device_Naming_Using_biosdevname.html#sec-Consistent_Network_Device_Naming-System_Requirements > > I don't have access to a Dell box running FreeBSD but on a PowerEdge > server running CentOS 6 this command looks like it returned all the raw > info you would need to implement your own "biosdevname-lite". Specifically > you could map the NIC number from the "Reference Designation" to its PCI > bus address and then call it whatever you wanted: > > # dmidecode -t 41 > # dmidecode 2.12 > SMBIOS 2.6 present. > > Handle 0x2900, DMI type 41, 11 bytes > Onboard Device > Reference Designation: Embedded NIC 1 > Type: Ethernet > Status: Enabled > Type Instance: 1 > Bus Address: 0000:01:00.0 > > Handle 0x2901, DMI type 41, 11 bytes > Onboard Device > Reference Designation: Embedded NIC 2 > Type: Ethernet > Status: Enabled > Type Instance: 2 > Bus Address: 0000:01:00.1 > [...] > > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"