From owner-svn-src-head@FreeBSD.ORG Tue Jun 24 20:11:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 803B8CA7; Tue, 24 Jun 2014 20:11:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60C052857; Tue, 24 Jun 2014 20:11:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5OKBNhL022569; Tue, 24 Jun 2014 20:11:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5OKBMFL022559; Tue, 24 Jun 2014 20:11:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201406242011.s5OKBMFL022559@svn.freebsd.org> From: Xin LI Date: Tue, 24 Jun 2014 20:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267839 - head/sys/dev/oce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2014 20:11:23 -0000 Author: delphij Date: Tue Jun 24 20:11:22 2014 New Revision: 267839 URL: http://svnweb.freebsd.org/changeset/base/267839 Log: Apply vendor fixes for big endian support and 20GBps/25GBps link speeds. Many thanks to Emulex for their continued support of FreeBSD! Submitted by: Venkata Duvvuru MFC after: 3 days Modified: head/sys/dev/oce/oce_hw.c head/sys/dev/oce/oce_hw.h head/sys/dev/oce/oce_if.c head/sys/dev/oce/oce_if.h head/sys/dev/oce/oce_mbox.c Modified: head/sys/dev/oce/oce_hw.c ============================================================================== --- head/sys/dev/oce/oce_hw.c Tue Jun 24 20:09:02 2014 (r267838) +++ head/sys/dev/oce/oce_hw.c Tue Jun 24 20:11:22 2014 (r267839) @@ -487,11 +487,7 @@ oce_hw_start(POCE_SOFTC sc) if_link_state_change(sc->ifp, LINK_STATE_DOWN); } - if (link.mac_speed > 0 && link.mac_speed < 5) - sc->link_speed = link.mac_speed; - else - sc->link_speed = 0; - + sc->link_speed = link.phys_port_speed; sc->qos_link_speed = (uint32_t )link.qos_link_speed * 10; rc = oce_start_mq(sc->mq); Modified: head/sys/dev/oce/oce_hw.h ============================================================================== --- head/sys/dev/oce/oce_hw.h Tue Jun 24 20:09:02 2014 (r267838) +++ head/sys/dev/oce/oce_hw.h Tue Jun 24 20:11:22 2014 (r267839) @@ -1023,7 +1023,7 @@ struct mbx_hdr { #define OCE_MBX_ADDL_STATUS(_MHDR) ((_MHDR)->u0.rsp.additional_status) #define OCE_MBX_STATUS(_MHDR) ((_MHDR)->u0.rsp.status) -/* [05] OPCODE_COMMON_QUERY_LINK_CONFIG */ +/* [05] OPCODE_COMMON_QUERY_LINK_CONFIG_V1 */ struct mbx_query_common_link_config { struct mbx_hdr hdr; union { @@ -1032,16 +1032,37 @@ struct mbx_query_common_link_config { } req; struct { - /* dw 0 */ - uint8_t physical_port; - uint8_t mac_duplex; - uint8_t mac_speed; - uint8_t mac_fault; - /* dw 1 */ - uint8_t mgmt_mac_duplex; - uint8_t mgmt_mac_speed; + #ifdef _BIG_ENDIAN + uint32_t physical_port_fault:8; + uint32_t physical_port_speed:8; + uint32_t link_duplex:8; + uint32_t pt:2; + uint32_t port_number:6; + uint16_t qos_link_speed; - uint32_t logical_link_status; + uint16_t rsvd0; + + uint32_t rsvd1:21; + uint32_t phys_fcv:1; + uint32_t phys_rxf:1; + uint32_t phys_txf:1; + uint32_t logical_link_status:8; + #else + uint32_t port_number:6; + uint32_t pt:2; + uint32_t link_duplex:8; + uint32_t physical_port_speed:8; + uint32_t physical_port_fault:8; + + uint16_t rsvd0; + uint16_t qos_link_speed; + + uint32_t logical_link_status:8; + uint32_t phys_txf:1; + uint32_t phys_rxf:1; + uint32_t phys_fcv:1; + uint32_t rsvd1:21; + #endif } rsp; } params; }; Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Tue Jun 24 20:09:02 2014 (r267838) +++ head/sys/dev/oce/oce_if.c Tue Jun 24 20:11:22 2014 (r267839) @@ -829,10 +829,21 @@ oce_media_status(struct ifnet *ifp, stru req->ifm_active |= IFM_10G_SR | IFM_FDX; sc->speed = 10000; break; + case 5: /* 20 Gbps */ + req->ifm_active |= IFM_10G_SR | IFM_FDX; + sc->speed = 20000; + break; + case 6: /* 25 Gbps */ + req->ifm_active |= IFM_10G_SR | IFM_FDX; + sc->speed = 25000; + break; case 7: /* 40 Gbps */ req->ifm_active |= IFM_40G_SR4 | IFM_FDX; sc->speed = 40000; break; + default: + sc->speed = 0; + break; } return; @@ -2217,13 +2228,16 @@ setup_max_queues_want(POCE_SOFTC sc) (sc->function_mode & FNM_UMC_MODE) || (sc->function_mode & FNM_VNIC_MODE) || (!is_rss_enabled(sc)) || - (sc->flags & OCE_FLAGS_BE2)) { + IS_BE2(sc)) { sc->nrqs = 1; sc->nwqs = 1; } else { sc->nrqs = MIN(OCE_NCPUS, sc->nrssqs) + 1; sc->nwqs = MIN(OCE_NCPUS, sc->nrssqs); } + + if (IS_BE2(sc) && is_rss_enabled(sc)) + sc->nrqs = MIN(OCE_NCPUS, sc->nrssqs) + 1; } @@ -2237,6 +2251,9 @@ update_queues_got(POCE_SOFTC sc) sc->nrqs = 1; sc->nwqs = 1; } + + if (IS_BE2(sc)) + sc->nwqs = 1; } static int Modified: head/sys/dev/oce/oce_if.h ============================================================================== --- head/sys/dev/oce/oce_if.h Tue Jun 24 20:09:02 2014 (r267838) +++ head/sys/dev/oce/oce_if.h Tue Jun 24 20:11:22 2014 (r267839) @@ -761,14 +761,9 @@ struct oce_rq { }; struct link_status { - uint8_t physical_port; - uint8_t mac_duplex; - uint8_t mac_speed; - uint8_t mac_fault; - uint8_t mgmt_mac_duplex; - uint8_t mgmt_mac_speed; + uint8_t phys_port_speed; + uint8_t logical_link_status; uint16_t qos_link_speed; - uint32_t logical_link_status; }; Modified: head/sys/dev/oce/oce_mbox.c ============================================================================== --- head/sys/dev/oce/oce_mbox.c Tue Jun 24 20:09:02 2014 (r267838) +++ head/sys/dev/oce/oce_mbox.c Tue Jun 24 20:11:22 2014 (r267839) @@ -961,9 +961,9 @@ oce_get_link_status(POCE_SOFTC sc, struc goto error; } /* interpret response */ - bcopy(&fwcmd->params.rsp, link, sizeof(struct link_status)); - link->logical_link_status = HOST_32(link->logical_link_status); - link->qos_link_speed = HOST_16(link->qos_link_speed); + link->qos_link_speed = HOST_16(fwcmd->params.rsp.qos_link_speed); + link->phys_port_speed = fwcmd->params.rsp.physical_port_speed; + link->logical_link_status = fwcmd->params.rsp.logical_link_status; error: return rc; }