svn commit: r268046 - stable/10/sys/dev/oce
Xin LI
delphij at FreeBSD.org
Mon Jun 30 16:23:33 UTC 2014
Author: delphij
Date: Mon Jun 30 16:23:31 2014
New Revision: 268046
URL: http://svnweb.freebsd.org/changeset/base/268046
Log:
MFC r267839:
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 <VenkatKumar.Duvvuru Emulex.Com>
Modified:
stable/10/sys/dev/oce/oce_hw.c
stable/10/sys/dev/oce/oce_hw.h
stable/10/sys/dev/oce/oce_if.c
stable/10/sys/dev/oce/oce_if.h
stable/10/sys/dev/oce/oce_mbox.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/oce/oce_hw.c
==============================================================================
--- stable/10/sys/dev/oce/oce_hw.c Mon Jun 30 16:18:38 2014 (r268045)
+++ stable/10/sys/dev/oce/oce_hw.c Mon Jun 30 16:23:31 2014 (r268046)
@@ -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: stable/10/sys/dev/oce/oce_hw.h
==============================================================================
--- stable/10/sys/dev/oce/oce_hw.h Mon Jun 30 16:18:38 2014 (r268045)
+++ stable/10/sys/dev/oce/oce_hw.h Mon Jun 30 16:23:31 2014 (r268046)
@@ -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: stable/10/sys/dev/oce/oce_if.c
==============================================================================
--- stable/10/sys/dev/oce/oce_if.c Mon Jun 30 16:18:38 2014 (r268045)
+++ stable/10/sys/dev/oce/oce_if.c Mon Jun 30 16:23:31 2014 (r268046)
@@ -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: stable/10/sys/dev/oce/oce_if.h
==============================================================================
--- stable/10/sys/dev/oce/oce_if.h Mon Jun 30 16:18:38 2014 (r268045)
+++ stable/10/sys/dev/oce/oce_if.h Mon Jun 30 16:23:31 2014 (r268046)
@@ -759,14 +759,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: stable/10/sys/dev/oce/oce_mbox.c
==============================================================================
--- stable/10/sys/dev/oce/oce_mbox.c Mon Jun 30 16:18:38 2014 (r268045)
+++ stable/10/sys/dev/oce/oce_mbox.c Mon Jun 30 16:23:31 2014 (r268046)
@@ -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;
}
More information about the svn-src-stable-10
mailing list