Apply vendor improvements to oce(4) driver:
- Add support to 40Gbps devices; - Add support to control adaptive interrupt coalescing (AIC) via sysctl; - Improve support of BE3 devices; Many thanks to Emulex for their continued support of FreeBSD. Submitted by: Venkata Duvvuru <VenkatKumar.Duvvuru Emulex Com> MFC after: 3 days
This commit is contained in:
parent
a1e8527fd1
commit
b41206d84a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=258941
@ -829,6 +829,10 @@ oce_media_status(struct ifnet *ifp, struct ifmediareq *req)
|
||||
req->ifm_active |= IFM_10G_SR | IFM_FDX;
|
||||
sc->speed = 10000;
|
||||
break;
|
||||
case 7: /* 40 Gbps */
|
||||
req->ifm_active |= IFM_40G_SR4 | IFM_FDX;
|
||||
sc->speed = 40000;
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
@ -1953,7 +1957,6 @@ oce_eqd_set_periodic(POCE_SOFTC sc)
|
||||
/* Is there atleast one eq that needs to be modified? */
|
||||
if(num)
|
||||
oce_mbox_eqd_modify_periodic(sc, set_eqd, num);
|
||||
|
||||
}
|
||||
|
||||
static void oce_detect_hw_error(POCE_SOFTC sc)
|
||||
@ -2153,11 +2156,6 @@ process_link_state(POCE_SOFTC sc, struct oce_async_cqe_link_state *acqe)
|
||||
sc->link_status = ASYNC_EVENT_LINK_DOWN;
|
||||
if_link_state_change(sc->ifp, LINK_STATE_DOWN);
|
||||
}
|
||||
|
||||
/* Update speed */
|
||||
sc->link_speed = acqe->u0.s.speed;
|
||||
sc->qos_link_speed = (uint32_t) acqe->u0.s.qos_link_speed * 10;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2342,18 +2340,17 @@ oce_get_config(POCE_SOFTC sc)
|
||||
max_rss = OCE_MAX_RSS;
|
||||
|
||||
if (!IS_BE(sc)) {
|
||||
rc = oce_get_func_config(sc);
|
||||
rc = oce_get_profile_config(sc, max_rss);
|
||||
if (rc) {
|
||||
sc->nwqs = OCE_MAX_WQ;
|
||||
sc->nrssqs = max_rss;
|
||||
sc->nrqs = sc->nrssqs + 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
rc = oce_get_profile_config(sc);
|
||||
else { /* For BE3 don't rely on fw for determining the resources */
|
||||
sc->nrssqs = max_rss;
|
||||
sc->nrqs = sc->nrssqs + 1;
|
||||
if (rc)
|
||||
sc->nwqs = OCE_MAX_WQ;
|
||||
sc->nwqs = OCE_MAX_WQ;
|
||||
sc->max_vlans = MAX_VLANFILTER_SIZE;
|
||||
}
|
||||
}
|
||||
|
@ -884,8 +884,8 @@ typedef struct oce_softc {
|
||||
uint8_t hw_error;
|
||||
uint16_t qnq_debug_event;
|
||||
uint16_t qnqid;
|
||||
uint16_t pvid;
|
||||
uint16_t max_vlans;
|
||||
uint32_t pvid;
|
||||
uint32_t max_vlans;
|
||||
|
||||
} OCE_SOFTC, *POCE_SOFTC;
|
||||
|
||||
@ -1057,7 +1057,7 @@ int oce_mbox_cq_create(struct oce_cq *cq, uint32_t ncoalesce,
|
||||
int oce_mbox_read_transrecv_data(POCE_SOFTC sc, uint32_t page_num);
|
||||
void oce_mbox_eqd_modify_periodic(POCE_SOFTC sc, struct oce_set_eqd *set_eqd,
|
||||
int num);
|
||||
int oce_get_profile_config(POCE_SOFTC sc);
|
||||
int oce_get_profile_config(POCE_SOFTC sc, uint32_t max_rss);
|
||||
int oce_get_func_config(POCE_SOFTC sc);
|
||||
void mbx_common_req_hdr_init(struct mbx_hdr *hdr,
|
||||
uint8_t dom,
|
||||
@ -1101,6 +1101,9 @@ extern uint32_t oce_max_rsp_handled; /* max responses */
|
||||
#define OCE_ONE_PORT_EXT_LOOPBACK 0x2
|
||||
#define OCE_NO_LOOPBACK 0xff
|
||||
|
||||
#undef IFM_40G_SR4
|
||||
#define IFM_40G_SR4 28
|
||||
|
||||
#define atomic_inc_32(x) atomic_add_32(x, 1)
|
||||
#define atomic_dec_32(x) atomic_subtract_32(x, 1)
|
||||
|
||||
|
@ -935,7 +935,7 @@ oce_get_link_status(POCE_SOFTC sc, struct link_status *link)
|
||||
|
||||
bzero(&mbx, sizeof(struct oce_mbx));
|
||||
|
||||
IS_XE201(sc) ? (version = OCE_MBX_VER_V1) : (version = OCE_MBX_VER_V0);
|
||||
IS_BE2(sc) ? (version = OCE_MBX_VER_V0) : (version = OCE_MBX_VER_V1);
|
||||
|
||||
fwcmd = (struct mbx_query_common_link_config *)&mbx.payload;
|
||||
mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0,
|
||||
@ -2025,7 +2025,7 @@ oce_mbox_eqd_modify_periodic(POCE_SOFTC sc, struct oce_set_eqd *set_eqd,
|
||||
}
|
||||
|
||||
int
|
||||
oce_get_profile_config(POCE_SOFTC sc)
|
||||
oce_get_profile_config(POCE_SOFTC sc, uint32_t max_rss)
|
||||
{
|
||||
struct oce_mbx mbx;
|
||||
struct mbx_common_get_profile_config *fwcmd;
|
||||
@ -2050,7 +2050,7 @@ oce_get_profile_config(POCE_SOFTC sc)
|
||||
fwcmd = OCE_DMAPTR(&dma, struct mbx_common_get_profile_config);
|
||||
bzero(fwcmd, sizeof(struct mbx_common_get_profile_config));
|
||||
|
||||
if (IS_BE3(sc))
|
||||
if (!IS_XE201(sc))
|
||||
version = OCE_MBX_VER_V1;
|
||||
else
|
||||
version = OCE_MBX_VER_V0;
|
||||
@ -2102,13 +2102,20 @@ oce_get_profile_config(POCE_SOFTC sc)
|
||||
goto error;
|
||||
}
|
||||
else {
|
||||
sc->max_vlans = nic_desc->vlan_count;
|
||||
sc->nwqs = HOST_32(nic_desc->txq_count);
|
||||
sc->max_vlans = HOST_16(nic_desc->vlan_count);
|
||||
sc->nwqs = HOST_16(nic_desc->txq_count);
|
||||
if (sc->nwqs)
|
||||
sc->nwqs = MIN(sc->nwqs, OCE_MAX_WQ);
|
||||
else
|
||||
sc->nwqs = OCE_MAX_WQ;
|
||||
|
||||
sc->nrssqs = HOST_16(nic_desc->rssq_count);
|
||||
if (sc->nrssqs)
|
||||
sc->nrssqs = MIN(sc->nrssqs, max_rss);
|
||||
else
|
||||
sc->nrssqs = max_rss;
|
||||
sc->nrqs = sc->nrssqs + 1; /* 1 for def RX */;
|
||||
|
||||
}
|
||||
error:
|
||||
oce_dma_free(sc, &dma);
|
||||
|
@ -44,6 +44,7 @@ static void copy_stats_to_sc_xe201(POCE_SOFTC sc);
|
||||
static void copy_stats_to_sc_be3(POCE_SOFTC sc);
|
||||
static void copy_stats_to_sc_be2(POCE_SOFTC sc);
|
||||
static int oce_sysctl_loopback(SYSCTL_HANDLER_ARGS);
|
||||
static int oce_sys_aic_enable(SYSCTL_HANDLER_ARGS);
|
||||
static int oce_be3_fwupgrade(POCE_SOFTC sc, const struct firmware *fw);
|
||||
static int oce_skyhawk_fwupgrade(POCE_SOFTC sc, const struct firmware *fw);
|
||||
static int oce_sys_fwupgrade(SYSCTL_HANDLER_ARGS);
|
||||
@ -131,6 +132,10 @@ oce_add_sysctls(POCE_SOFTC sc)
|
||||
CTLTYPE_STRING | CTLFLAG_RW, (void *)sc, 0,
|
||||
oce_sys_fwupgrade, "A", "Firmware ufi file");
|
||||
|
||||
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "aic_enable",
|
||||
CTLTYPE_INT | CTLFLAG_RW, (void *)sc, 1,
|
||||
oce_sys_aic_enable, "I", "aic flags");
|
||||
|
||||
/*
|
||||
* Dumps Transceiver data
|
||||
* "sysctl dev.oce.0.sfp_vpd_dump=0"
|
||||
@ -169,6 +174,35 @@ oce_loopback_test(struct oce_softc *sc, uint8_t loopback_type)
|
||||
return status;
|
||||
}
|
||||
|
||||
static int
|
||||
oce_sys_aic_enable(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int value = 0;
|
||||
uint32_t status, vector;
|
||||
POCE_SOFTC sc = (struct oce_softc *)arg1;
|
||||
struct oce_aic_obj *aic;
|
||||
|
||||
status = sysctl_handle_int(oidp, &value, 0, req);
|
||||
if (status || !req->newptr)
|
||||
return status;
|
||||
|
||||
for (vector = 0; vector < sc->intr_count; vector++) {
|
||||
aic = &sc->aic_obj[vector];
|
||||
|
||||
if (value == 0){
|
||||
aic->max_eqd = aic->min_eqd = aic->et_eqd = 0;
|
||||
aic->enable = 0;
|
||||
}
|
||||
else {
|
||||
aic->max_eqd = OCE_MAX_EQD;
|
||||
aic->min_eqd = OCE_MIN_EQD;
|
||||
aic->et_eqd = OCE_MIN_EQD;
|
||||
aic->enable = TRUE;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
oce_sysctl_loopback(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user