diff options
author | gh162552 <none@none> | 2008-05-03 18:59:55 -0700 |
---|---|---|
committer | gh162552 <none@none> | 2008-05-03 18:59:55 -0700 |
commit | dca582a1fd21ee1874dd859d3bf680b96de8f153 (patch) | |
tree | edf3368e002c28dd84208b19c511f34da172476d | |
parent | a7ad85b06e706f87df7a2eb41e1fe85a13352d71 (diff) | |
download | illumos-gate-dca582a1fd21ee1874dd859d3bf680b96de8f153.tar.gz |
6503431 aggregation could not attach with on b100x
6533009 The spurious interrupt caused by bge under PCI Express lane x1
6536390 bge interface takes down entire network when brought to the OK prompt
6648555 bge link still flaps at initialization, breaking ipmp test suite
6659919 S10U4 X2200 bge1 VLAN IPv6 ndp fails unless snoop is running
6673634 bge driver need to support new device id "pci14e4,1673"
-rw-r--r-- | usr/src/pkgdefs/SUNWbge/postinstall | 1 | ||||
-rw-r--r-- | usr/src/uts/common/io/bge/bge.conf | 4 | ||||
-rw-r--r-- | usr/src/uts/common/io/bge/bge_chip2.c | 44 | ||||
-rw-r--r-- | usr/src/uts/common/io/bge/bge_hw.h | 3 | ||||
-rw-r--r-- | usr/src/uts/common/io/bge/bge_impl.h | 5 | ||||
-rw-r--r-- | usr/src/uts/common/io/bge/bge_kstats.c | 71 | ||||
-rw-r--r-- | usr/src/uts/common/io/bge/bge_main2.c | 7 | ||||
-rw-r--r-- | usr/src/uts/common/io/bge/bge_ndd.c | 4 |
8 files changed, 105 insertions, 34 deletions
diff --git a/usr/src/pkgdefs/SUNWbge/postinstall b/usr/src/pkgdefs/SUNWbge/postinstall index 4409b22319..60981ead43 100644 --- a/usr/src/pkgdefs/SUNWbge/postinstall +++ b/usr/src/pkgdefs/SUNWbge/postinstall @@ -161,6 +161,7 @@ then "pciex14e4,1677" "pci14e4,1678" "pci14e4,1679" + "pciex14e4,1673" "pciex14e4,167a" "pciex14e4,167b" "pci14e4,167d" diff --git a/usr/src/uts/common/io/bge/bge.conf b/usr/src/uts/common/io/bge/bge.conf index adcf60a8cf..efe66bcfc1 100644 --- a/usr/src/uts/common/io/bge/bge.conf +++ b/usr/src/uts/common/io/bge/bge.conf @@ -20,7 +20,7 @@ # ######################################################################### # -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -105,7 +105,7 @@ # adv_10fdx_cap = 1; # adv_10hdx_cap = 1; # adv_asym_pause_cap = 0; -# adv_pause_cap = 1; +# adv_pause_cap = 0; # # All of these parameters can can also be queried and modified at run-time # by use of the ndd(1m) command. diff --git a/usr/src/uts/common/io/bge/bge_chip2.c b/usr/src/uts/common/io/bge/bge_chip2.c index 8b104ea9e0..51c5cc3cab 100644 --- a/usr/src/uts/common/io/bge/bge_chip2.c +++ b/usr/src/uts/common/io/bge/bge_chip2.c @@ -799,6 +799,28 @@ bge_mbx_put(bge_t *bgep, bge_regno_t regno, uint64_t data) BGE_PCICHK(bgep); } +uint32_t bge_mbx_get(bge_t *bgep, bge_regno_t regno); +#pragma inline(bge_mbx_get) + +uint32_t +bge_mbx_get(bge_t *bgep, bge_regno_t regno) +{ + uint32_t val32; + + BGE_TRACE(("bge_mbx_get($%p, 0x%lx)", + (void *)bgep, regno)); + +#ifdef _BIG_ENDIAN + val32 = ddi_get32(bgep->io_handle, PIO_ADDR(bgep, regno+4)); +#else + val32 = ddi_get32(bgep->io_handle, PIO_ADDR(bgep, regno)); +#endif /* _BIG_ENDIAN */ + BGE_PCICHK(bgep); + + return (val32); +} + + #if BGE_DEBUGGING void bge_led_mark(bge_t *bgep); @@ -1857,6 +1879,7 @@ bge_nvmem_id(bge_t *bgep) case DEVICE_ID_5752M: case DEVICE_ID_5754: case DEVICE_ID_5755: + case DEVICE_ID_5755M: case DEVICE_ID_5721: case DEVICE_ID_5714C: case DEVICE_ID_5714S: @@ -2061,6 +2084,7 @@ bge_chip_id_init(bge_t *bgep) break; case DEVICE_ID_5755: + case DEVICE_ID_5755M: cidp->chip_label = 5755; cidp->pci_type = BGE_PCI_E; cidp->mbuf_lo_water_rdma = RDMA_MBUF_LOWAT_5705; @@ -2788,6 +2812,9 @@ bge_chip_sync(bge_t *bgep) * Reprogram the hashed multicast address table ... */ for (i = 0; i < BGE_HASH_TABLE_SIZE/32; ++i) + bge_reg_put32(bgep, MAC_HASH_REG(i), 0); + + for (i = 0; i < BGE_HASH_TABLE_SIZE/32; ++i) bge_reg_put32(bgep, MAC_HASH_REG(i), bgep->mcast_hash[i] | fill); @@ -4069,6 +4096,8 @@ bge_intr(caddr_t arg1, caddr_t arg2) */ bge_mbx_put(bgep, INTERRUPT_MBOX_0_REG, INTERRUPT_MBOX_ENABLE(flags)); + if (bgep->chipid.pci_type == BGE_PCI_E) + (void) bge_mbx_get(bgep, INTERRUPT_MBOX_0_REG); bgep->missed_dmas = 0; } @@ -4504,8 +4533,17 @@ bge_chip_factotum(caddr_t arg) * If the link state changed, tell the world about it. * Note: can't do this while still holding the mutex. */ - if (linkchg) + if (bgep->link_update_timer == BGE_LINK_UPDATE_TIMEOUT && + bgep->link_state != LINK_STATE_UNKNOWN) + linkchg = B_TRUE; + else if (bgep->link_update_timer < BGE_LINK_UPDATE_TIMEOUT && + bgep->link_state == LINK_STATE_DOWN) + linkchg = B_FALSE; + + if (linkchg) { mac_link_update(bgep->mh, bgep->link_state); + bgep->link_update_timer = BGE_LINK_UPDATE_DONE; + } if (bgep->manual_reset) { bgep->manual_reset = B_FALSE; } @@ -4539,6 +4577,10 @@ bge_chip_cyclic(void *arg) if (bge_check_acc_handle(bgep, bgep->io_handle) != DDI_FM_OK) ddi_fm_service_impact(bgep->devinfo, DDI_SERVICE_UNAFFECTED); + + if (bgep->link_update_timer < BGE_LINK_UPDATE_TIMEOUT) + bgep->link_update_timer++; + break; case BGE_CHIP_FAULT: diff --git a/usr/src/uts/common/io/bge/bge_hw.h b/usr/src/uts/common/io/bge/bge_hw.h index 8a5186fdc1..457b9826ce 100644 --- a/usr/src/uts/common/io/bge/bge_hw.h +++ b/usr/src/uts/common/io/bge/bge_hw.h @@ -20,7 +20,7 @@ */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -80,6 +80,7 @@ extern "C" { #define DEVICE_ID_5753 0x16fd #define DEVICE_ID_5754 0x167a #define DEVICE_ID_5755 0x167b +#define DEVICE_ID_5755M 0x1673 #define DEVICE_ID_5721 0x1659 #define DEVICE_ID_5714C 0x1668 #define DEVICE_ID_5714S 0x1669 diff --git a/usr/src/uts/common/io/bge/bge_impl.h b/usr/src/uts/common/io/bge/bge_impl.h index f801f7f305..53cf329e12 100644 --- a/usr/src/uts/common/io/bge/bge_impl.h +++ b/usr/src/uts/common/io/bge/bge_impl.h @@ -934,6 +934,8 @@ typedef struct bge { uint64_t param_link_speed; link_duplex_t param_link_duplex; + + uint32_t link_update_timer; } bge_t; /* @@ -1252,6 +1254,9 @@ uint32_t bge_atomic_shl32(uint32_t *sp, uint_t count); #define BGE_ASF_HEARTBEAT_INTERVAL 1500000 +#define BGE_LINK_UPDATE_TIMEOUT 10 /* ~ 5 sec */ +#define BGE_LINK_UPDATE_DONE (BGE_LINK_UPDATE_TIMEOUT+1) + #ifdef __cplusplus } #endif diff --git a/usr/src/uts/common/io/bge/bge_kstats.c b/usr/src/uts/common/io/bge/bge_kstats.c index 32af1a2b13..2da60f96f9 100644 --- a/usr/src/uts/common/io/bge/bge_kstats.c +++ b/usr/src/uts/common/io/bge/bge_kstats.c @@ -669,14 +669,6 @@ bge_m_stat(void *arg, uint_t stat, uint64_t *val) return (EINVAL); } - /* - * The MII/GMII physical layer 802.3 stats are not supported by the - * bge optical interface. - */ - if ((bgep->chipid.flags & CHIP_FLAG_SERDES) && ETHER_STAT_ISMII(stat)) { - return (ENOTSUP); - } - if (bgep->chipid.statistic_type == BGE_STAT_BLK) bstp = DMA_VPTR(bgep->statistics); else { @@ -950,7 +942,10 @@ bge_m_stat(void *arg, uint_t stat, uint64_t *val) break; case ETHER_STAT_XCVR_INUSE: - *val = XCVR_1000T; + if (bgep->chipid.flags & CHIP_FLAG_SERDES) + *val = XCVR_1000X; + else + *val = XCVR_1000T; break; case ETHER_STAT_CAP_1000FDX: @@ -962,19 +957,31 @@ bge_m_stat(void *arg, uint_t stat, uint64_t *val) break; case ETHER_STAT_CAP_100FDX: - *val = 1; + if (bgep->chipid.flags & CHIP_FLAG_SERDES) + *val = 0; + else + *val = 1; break; case ETHER_STAT_CAP_100HDX: - *val = 1; + if (bgep->chipid.flags & CHIP_FLAG_SERDES) + *val = 0; + else + *val = 1; break; case ETHER_STAT_CAP_10FDX: - *val = 1; + if (bgep->chipid.flags & CHIP_FLAG_SERDES) + *val = 0; + else + *val = 1; break; case ETHER_STAT_CAP_10HDX: - *val = 1; + if (bgep->chipid.flags & CHIP_FLAG_SERDES) + *val = 0; + else + *val = 1; break; case ETHER_STAT_CAP_ASMPAUSE: @@ -1030,14 +1037,19 @@ bge_m_stat(void *arg, uint_t stat, uint64_t *val) break; case ETHER_STAT_ADV_REMFAULT: - mutex_enter(bgep->genlock); - *val = bge_mii_get16(bgep, MII_AN_ADVERT) & - MII_AN_ADVERT_REMFAULT ? 1 : 0; - if (bge_check_acc_handle(bgep, bgep->io_handle) != DDI_FM_OK) { - ddi_fm_service_impact(bgep->devinfo, - DDI_SERVICE_UNAFFECTED); + if (bgep->chipid.flags & CHIP_FLAG_SERDES) + *val = 0; + else { + mutex_enter(bgep->genlock); + *val = bge_mii_get16(bgep, MII_AN_ADVERT) & + MII_AN_ADVERT_REMFAULT ? 1 : 0; + if (bge_check_acc_handle(bgep, bgep->io_handle) != + DDI_FM_OK) { + ddi_fm_service_impact(bgep->devinfo, + DDI_SERVICE_UNAFFECTED); + } + mutex_exit(bgep->genlock); } - mutex_exit(bgep->genlock); break; case ETHER_STAT_LP_CAP_1000FDX: @@ -1077,14 +1089,19 @@ bge_m_stat(void *arg, uint_t stat, uint64_t *val) break; case ETHER_STAT_LP_REMFAULT: - mutex_enter(bgep->genlock); - *val = bge_mii_get16(bgep, MII_AN_LPABLE) & - MII_AN_ADVERT_REMFAULT ? 1 : 0; - if (bge_check_acc_handle(bgep, bgep->io_handle) != DDI_FM_OK) { - ddi_fm_service_impact(bgep->devinfo, - DDI_SERVICE_UNAFFECTED); + if (bgep->chipid.flags & CHIP_FLAG_SERDES) + *val = 0; + else { + mutex_enter(bgep->genlock); + *val = bge_mii_get16(bgep, MII_AN_LPABLE) & + MII_AN_ADVERT_REMFAULT ? 1 : 0; + if (bge_check_acc_handle(bgep, bgep->io_handle) != + DDI_FM_OK) { + ddi_fm_service_impact(bgep->devinfo, + DDI_SERVICE_UNAFFECTED); + } + mutex_exit(bgep->genlock); } - mutex_exit(bgep->genlock); break; case ETHER_STAT_LINK_ASMPAUSE: diff --git a/usr/src/uts/common/io/bge/bge_main2.c b/usr/src/uts/common/io/bge/bge_main2.c index a5ec142b25..55c5b1df44 100644 --- a/usr/src/uts/common/io/bge/bge_main2.c +++ b/usr/src/uts/common/io/bge/bge_main2.c @@ -34,7 +34,7 @@ * This is the string displayed by modinfo, etc. * Make sure you keep the version ID up to date! */ -static char bge_ident[] = "Broadcom Gb Ethernet"; +static char bge_ident[] = "Broadcom Gb Ethernet v0.62"; /* * Property names @@ -499,6 +499,11 @@ bge_m_stop(void *arg) return; } bge_stop(bgep); + + bgep->link_update_timer = 0; + bgep->link_state = LINK_STATE_UNKNOWN; + mac_link_update(bgep->mh, bgep->link_state); + /* * Free the possible tx buffers allocated in tx process. */ diff --git a/usr/src/uts/common/io/bge/bge_ndd.c b/usr/src/uts/common/io/bge/bge_ndd.c index e70b894d2b..0a17782086 100644 --- a/usr/src/uts/common/io/bge/bge_ndd.c +++ b/usr/src/uts/common/io/bge/bge_ndd.c @@ -98,8 +98,8 @@ bge_nd_param_init(bge_t *bgep) BGE_INIT_PROP("adv_autoneg_cap", param_adv_autoneg, 1); BGE_INIT_PROP("adv_1000fdx_cap", param_adv_1000fdx, 1); BGE_INIT_PROP("adv_1000hdx_cap", param_adv_1000hdx, 1); - BGE_INIT_PROP("adv_pause_cap", param_adv_pause, 1); - BGE_INIT_PROP("adv_asym_pause_cap", param_adv_asym_pause, 1); + BGE_INIT_PROP("adv_pause_cap", param_adv_pause, 0); + BGE_INIT_PROP("adv_asym_pause_cap", param_adv_asym_pause, 0); if (flags & CHIP_FLAG_SERDES) { bgep->param_adv_100fdx = 0; |