From nobody@FreeBSD.org  Thu Jan 13 14:23:31 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 44ACD1065670
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 13 Jan 2011 14:23:31 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 1957E8FC18
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 13 Jan 2011 14:23:31 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p0DENUoE097813
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 13 Jan 2011 14:23:30 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p0DENUNu097802;
	Thu, 13 Jan 2011 14:23:30 GMT
	(envelope-from nobody)
Message-Id: <201101131423.p0DENUNu097802@red.freebsd.org>
Date: Thu, 13 Jan 2011 14:23:30 GMT
From: Steinar Haug <sthaug@nethelp.no>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Intel 10GBase-LR Ethernet card detected as 10GBase-SR
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         153951
>Category:       kern
>Synopsis:       [ixgbe] Intel 10GBase-LR Ethernet card detected as 10GBase-SR
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-net
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 13 14:30:10 UTC 2011
>Closed-Date:    Mon Feb 07 15:13:47 UTC 2011
>Last-Modified:  Mon Feb 07 15:13:47 UTC 2011
>Originator:     Steinar Haug
>Release:        8.2-RC1
>Organization:
Nethelp Consulting
>Environment:
FreeBSD sniffy.lab.ventelo.net 8.2-RC1 FreeBSD 8.2-RC1 #0: Thu Jan 13 14:41:42 CET 2011     sthaug@sniffy.lab.ventelo.net:/usr/src/sys/amd64/compile/GENERIC  amd64

>Description:
I have a server with an Intel X520-LR1 Ethernet card, which is a
10GBase-LR card:

  http://ark.intel.com/Product.aspx?id=41164

The card contains the Intel 82599ES controller:

  http://ark.intel.com/Product.aspx?id=41282

pciconf -lv shows:

ix0@pci0:28:0:0:        class=0x020000 card=0x00068086 chip=0x10fb8086 rev=0x01 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = network
    subclass   = ethernet

where /sys/dev/ixgbe/ixgbe_type.h has the PCI ID definition:

#define IXGBE_DEV_ID_82599_SFP  0x10FB

The problem is that this card is shown by ifconfig as a 10GBase-SR card:

% ifconfig ix0
ix0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=1bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4>
        ether 00:1b:21:7c:7b:94
        media: Ethernet autoselect (10Gbase-SR <full-duplex>)
        status: active

I believe this is due to the following code in /sys/dev/ixgbe/ixgbe.c
line 423, routine ixgbe_attach():

                case IXGBE_DEV_ID_82599_SFP:
                        adapter->optics = IFM_10G_SR;

I'm looking at version 1.17.2.12.2.1, from 8.2-RC1, but I see this code
is the same in version 1.45, from HEAD:

  http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/ixgbe/ixgbe.c?rev=1.45;content-type=text/plain

>How-To-Repeat:
Insert Intel X520-LR1 Ethernet card into server, compile kernel with ixgbe driver, reboot, type ifconfig, look at the values for the detected ixN card.
>Fix:
Fix pasted in so space/tabs won't be correct:


--- ixgbe.c.orig        2010-12-21 18:09:25.000000000 +0100
+++ ixgbe.c     2011-01-13 14:31:14.000000000 +0100
@@ -421,7 +421,7 @@
                        adapter->optics = IFM_10G_LR;
                        break;
                case IXGBE_DEV_ID_82599_SFP:
-                       adapter->optics = IFM_10G_SR;
+                       adapter->optics = IFM_10G_LR;
                        ixgbe_num_segs = IXGBE_82599_SCATTER;
                        break;
                case IXGBE_DEV_ID_82598_DA_DUAL_PORT :


>Release-Note:
>Audit-Trail:

From: sthaug@nethelp.no
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/153951: Intel 10GBase-LR Ethernet card detected as
 10GBase-SR
Date: Thu, 13 Jan 2011 22:08:09 +0100 (CET)

 Checking some more I find that the same Intel 82599ES controller based
 card is also available in 10GBase-SR versions - it simply depends on
 the type of SFP+ used in the card. See for instance
 
   http://ark.intel.com/Product.aspx?id=39773
   http://ark.intel.com/Product.aspx?id=39774
 
 Thus the *correct* solution to my problem is probably to retrieve the
 optics type from the SFP+, instead of setting it statically in the
 driver. Until such a solution is available, my 1-line patch works for
 me...
 
 Steinar Haug, Nethelp consulting, sthaug@nethelp.no
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Jan 14 01:27:27 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153951 

From: sthaug@nethelp.no
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/153951: Intel 10GBase-LR Ethernet card detected as
 10GBase-SR
Date: Sun, 06 Feb 2011 18:19:37 +0100 (CET)

 > Checking some more I find that the same Intel 82599ES controller based
 > card is also available in 10GBase-SR versions - it simply depends on
 > the type of SFP+ used in the card. See for instance
 > 
 >   http://ark.intel.com/Product.aspx?id=39773
 >   http://ark.intel.com/Product.aspx?id=39774
 > 
 > Thus the *correct* solution to my problem is probably to retrieve the
 > optics type from the SFP+, instead of setting it statically in the
 > driver. Until such a solution is available, my 1-line patch works for
 > me...
 
 It looks like dynamic dection of optics type has been incorporated
 into the newest version if ixgbe.c, 1.17.2.12.2.2, with description
 
  217713  - Make phy detection dynamic so adapters that support multiple
  types of media can be properly identified by the interface layer
 
 Thus I believe kern/153951 should be closed.
 
 Steinar Haug, Nethelp consulting, sthaug@nethelp.no
State-Changed-From-To: open->closed 
State-Changed-By: jhb 
State-Changed-When: Mon Feb 7 15:13:30 UTC 2011 
State-Changed-Why:  
Submitter reports issue resolved. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153951 
>Unformatted:
