diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/libdladm/common/linkprop.c | 14 | ||||
-rw-r--r-- | usr/src/uts/common/io/mac/plugins/mac_ether.c | 18 | ||||
-rw-r--r-- | usr/src/uts/common/io/softmac/softmac_stat.c | 63 | ||||
-rw-r--r-- | usr/src/uts/common/sys/mac.h | 2 | ||||
-rw-r--r-- | usr/src/uts/common/sys/mac_ether.h | 10 | ||||
-rw-r--r-- | usr/src/uts/i86pc/ml/amd64.il | 25 | ||||
-rw-r--r-- | usr/src/uts/i86pc/ml/ia32.il | 32 | ||||
-rw-r--r-- | usr/src/uts/i86xpv/ml/amd64.il | 25 | ||||
-rw-r--r-- | usr/src/uts/i86xpv/ml/ia32.il | 31 | ||||
-rw-r--r-- | usr/src/uts/intel/asm/cpu.h | 39 | ||||
-rw-r--r-- | usr/src/uts/intel/ia32/ml/ia32.il | 8 |
11 files changed, 115 insertions, 152 deletions
diff --git a/usr/src/lib/libdladm/common/linkprop.c b/usr/src/lib/libdladm/common/linkprop.c index 2d01238431..f0d84379eb 100644 --- a/usr/src/lib/libdladm/common/linkprop.c +++ b/usr/src/lib/libdladm/common/linkprop.c @@ -241,6 +241,10 @@ static link_attr_t link_attr[] = { { MAC_PROP_AUTOPUSH, sizeof (struct dlautopush), "autopush"}, + { MAC_PROP_ADV_10GFDX_CAP, sizeof (uint8_t), "adv_10gfdx_cap"}, + + { MAC_PROP_EN_10GFDX_CAP, sizeof (uint8_t), "en_10gfdx_cap"}, + { MAC_PROP_ADV_1000FDX_CAP, sizeof (uint8_t), "adv_1000fdx_cap"}, { MAC_PROP_EN_1000FDX_CAP, sizeof (uint8_t), "en_1000fdx_cap"}, @@ -426,6 +430,16 @@ static prop_desc_t prop_table[] = { i_dladm_set_public_prop, NULL, i_dladm_flowctl_get, NULL, 0, DATALINK_CLASS_PHYS, DL_ETHER }, + { "adv_10gfdx_cap", { "", 0 }, + link_01_vals, VALCNT(link_01_vals), + NULL, NULL, i_dladm_binary_get, NULL, + 0, DATALINK_CLASS_PHYS, DL_ETHER }, + + { "en_10gfdx_cap", { "", 0 }, + link_01_vals, VALCNT(link_01_vals), + i_dladm_set_public_prop, NULL, i_dladm_binary_get, NULL, + 0, DATALINK_CLASS_PHYS, DL_ETHER }, + { "adv_1000fdx_cap", { "", 0 }, link_01_vals, VALCNT(link_01_vals), NULL, NULL, i_dladm_binary_get, NULL, diff --git a/usr/src/uts/common/io/mac/plugins/mac_ether.c b/usr/src/uts/common/io/mac/plugins/mac_ether.c index abaab66add..c7e6a33880 100644 --- a/usr/src/uts/common/io/mac/plugins/mac_ether.c +++ b/usr/src/uts/common/io/mac/plugins/mac_ether.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -63,6 +63,7 @@ static mac_stat_info_t ether_stats[] = { { ETHER_STAT_XCVR_ADDR, "xcvr_addr", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_XCVR_ID, "xcvr_id", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_XCVR_INUSE, "xcvr_inuse", KSTAT_DATA_UINT32, 0 }, + { ETHER_STAT_CAP_10GFDX, "cap_10gfdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_CAP_1000FDX, "cap_1000fdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_CAP_1000HDX, "cap_1000hdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_CAP_100T4, "cap_100T4", KSTAT_DATA_UINT32, 0 }, @@ -74,6 +75,7 @@ static mac_stat_info_t ether_stats[] = { { ETHER_STAT_CAP_PAUSE, "cap_pause", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_CAP_AUTONEG, "cap_autoneg", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_CAP_REMFAULT, "cap_rem_fault", KSTAT_DATA_UINT32, 0 }, + { ETHER_STAT_ADV_CAP_10GFDX, "adv_cap_10gfdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_ADV_CAP_1000FDX, "adv_cap_1000fdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_ADV_CAP_1000HDX, "adv_cap_1000hdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_ADV_CAP_100T4, "adv_cap_100T4", KSTAT_DATA_UINT32, 0 }, @@ -86,6 +88,7 @@ static mac_stat_info_t ether_stats[] = { { ETHER_STAT_ADV_CAP_PAUSE, "adv_cap_pause", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_ADV_CAP_AUTONEG, "adv_cap_autoneg", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_ADV_REMFAULT, "adv_rem_fault", KSTAT_DATA_UINT32, 0 }, + { ETHER_STAT_LP_CAP_10GFDX, "lp_cap_10gfdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_LP_CAP_1000FDX, "lp_cap_1000fdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_LP_CAP_1000HDX, "lp_cap_1000hdx", KSTAT_DATA_UINT32, 0 }, { ETHER_STAT_LP_CAP_100T4, "lp_cap_100T4", KSTAT_DATA_UINT32, 0 }, @@ -117,8 +120,11 @@ static struct modlinkage mac_ether_modlinkage = { static mactype_ops_t mac_ether_type_ops; static mac_ndd_mapping_t mac_ether_mapping[] = { - {"adv_autoneg_cap", MAC_PROP_AUTONEG, 0, 1, sizeof (uint8_t), - MAC_PROP_PERM_RW}, + {"adv_autoneg_cap", MAC_PROP_AUTONEG, 0, 1, + sizeof (uint8_t), MAC_PROP_PERM_RW}, + + {"adv_10gfdx_cap", MAC_PROP_EN_10GFDX_CAP, 0, 1, + sizeof (uint8_t), MAC_PROP_PERM_RW}, {"adv_1000fdx_cap", MAC_PROP_EN_1000FDX_CAP, 0, 1, sizeof (uint8_t), MAC_PROP_PERM_RW}, @@ -159,6 +165,9 @@ static mac_ndd_mapping_t mac_ether_mapping[] = { {"asym_pause_cap", ETHER_STAT_CAP_ASMPAUSE, 0, 1, sizeof (long), MAC_PROP_FLAGS_RK}, + {"10gfdx_cap", ETHER_STAT_CAP_10GFDX, 0, 1, + sizeof (long), MAC_PROP_FLAGS_RK}, + {"1000fdx_cap", ETHER_STAT_CAP_1000FDX, 0, 1, sizeof (long), MAC_PROP_FLAGS_RK}, @@ -189,6 +198,9 @@ static mac_ndd_mapping_t mac_ether_mapping[] = { {"lp_asym_pause_cap", ETHER_STAT_LP_CAP_ASMPAUSE, 0, 1, sizeof (long), MAC_PROP_FLAGS_RK}, + {"lp_10gfdx_cap", ETHER_STAT_LP_CAP_10GFDX, 0, 1, + sizeof (long), MAC_PROP_FLAGS_RK}, + {"lp_1000hdx_cap", ETHER_STAT_LP_CAP_1000HDX, 0, 1, sizeof (long), MAC_PROP_FLAGS_RK}, diff --git a/usr/src/uts/common/io/softmac/softmac_stat.c b/usr/src/uts/common/io/softmac/softmac_stat.c index 78b5306c86..a4017a5edc 100644 --- a/usr/src/uts/common/io/softmac/softmac_stat.c +++ b/usr/src/uts/common/io/softmac/softmac_stat.c @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/kstat.h> #include <sys/mac.h> @@ -60,6 +58,9 @@ static i_softmac_stat_info_t i_softmac_driver_si[] = { { MAC_STAT_OVERFLOWS, "oflo", NULL } }; +#define SOFTMAC_DRIVER_SI_SZ \ + (sizeof (i_softmac_driver_si) / sizeof (i_softmac_driver_si[0])) + /* * Must be the same order as ether_stat. */ @@ -128,9 +129,16 @@ static i_softmac_stat_info_t i_softmac_ether_si[] = { { ETHER_STAT_JABBER_ERRORS, "jabber_errors", NULL }, { ETHER_STAT_CAP_100T4, "cap_100T4", NULL }, { ETHER_STAT_ADV_CAP_100T4, "adv_cap_100T4", NULL }, - { ETHER_STAT_LP_CAP_100T4, "lp_cap_100T4", NULL } + { ETHER_STAT_LP_CAP_100T4, "lp_cap_100T4", NULL }, + + { ETHER_STAT_CAP_10GFDX, "cap_10gfdx", NULL }, + { ETHER_STAT_ADV_CAP_10GFDX, "adv_cap_10gfdx", NULL }, + { ETHER_STAT_LP_CAP_1000FDX, "lp_cap_10gfdx", NULL } }; +#define SOFTMAC_ETHER_SI_SZ \ + (sizeof (i_softmac_ether_si) / sizeof (i_softmac_ether_si[0])) + static kstat_t *softmac_hold_dev_kstat(softmac_t *); static void softmac_rele_dev_kstat(kstat_t *); static int softmac_get_kstat(kstat_t *, char *, uint64_t *); @@ -241,24 +249,49 @@ softmac_m_stat(void *arg, uint_t stat, uint64_t *val) return (ENOTSUP); if (IS_MAC_STAT(stat)) { - index = stat - MAC_STAT_MIN; - if ((ret = softmac_get_kstat(ksp, - i_softmac_driver_si[index].ssi_name, val)) != 0) { - ret = softmac_get_kstat(ksp, - i_softmac_driver_si[index].ssi_alias, val); + i_softmac_stat_info_t *ssip = NULL; + + for (index = 0; index < SOFTMAC_DRIVER_SI_SZ; index++) { + if (stat == i_softmac_driver_si[index].ssi_stat) { + ssip = &i_softmac_driver_si[index]; + break; + } + } + + if (ssip == NULL) { + ret = ENOTSUP; + } else { + if ((ret = softmac_get_kstat(ksp, ssip->ssi_name, + val)) != 0) + ret = softmac_get_kstat(ksp, ssip->ssi_alias, + val); } } else { ASSERT(IS_MACTYPE_STAT(stat)); - index = stat - MACTYPE_STAT_MIN; switch (softmac->smac_media) { - case DL_ETHER: - if ((ret = softmac_get_kstat(ksp, - i_softmac_ether_si[index].ssi_name, val)) != 0) { - ret = softmac_get_kstat(ksp, - i_softmac_ether_si[index].ssi_alias, val); + case DL_ETHER: { + i_softmac_stat_info_t *ssip = NULL; + + for (index = 0; index < SOFTMAC_ETHER_SI_SZ; index++) { + if (stat == + i_softmac_ether_si[index].ssi_stat) { + ssip = &i_softmac_ether_si[index]; + break; + } } + + if (ssip == NULL) { + ret = ENOTSUP; + } else { + if ((ret = softmac_get_kstat(ksp, + ssip->ssi_name, val)) != 0) + ret = softmac_get_kstat(ksp, + ssip->ssi_alias, val); + } + break; + } default: ret = ENOTSUP; break; diff --git a/usr/src/uts/common/sys/mac.h b/usr/src/uts/common/sys/mac.h index 52fd06e47e..2e7d480685 100644 --- a/usr/src/uts/common/sys/mac.h +++ b/usr/src/uts/common/sys/mac.h @@ -165,6 +165,8 @@ typedef enum { MAC_PROP_PRIO, MAC_PROP_BIND_CPU, MAC_PROP_TAGMODE, + MAC_PROP_ADV_10GFDX_CAP, + MAC_PROP_EN_10GFDX_CAP, MAC_PROP_PRIVATE = -1 } mac_prop_id_t; diff --git a/usr/src/uts/common/sys/mac_ether.h b/usr/src/uts/common/sys/mac_ether.h index 6310ea4952..32e0168971 100644 --- a/usr/src/uts/common/sys/mac_ether.h +++ b/usr/src/uts/common/sys/mac_ether.h @@ -19,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_MAC_ETHER_H #define _SYS_MAC_ETHER_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Ethernet MAC Plugin */ @@ -103,9 +101,13 @@ enum ether_stat { ETHER_STAT_CAP_100T4, ETHER_STAT_ADV_CAP_100T4, ETHER_STAT_LP_CAP_100T4, + + ETHER_STAT_CAP_10GFDX, + ETHER_STAT_ADV_CAP_10GFDX, + ETHER_STAT_LP_CAP_10GFDX, }; -#define ETHER_NSTAT (ETHER_STAT_LP_CAP_100T4 - ETHER_STAT_ALIGN_ERRORS + 1) +#define ETHER_NSTAT (ETHER_STAT_LP_CAP_10GFDX - ETHER_STAT_ALIGN_ERRORS + 1) #define ETHER_STAT_ISACOUNTER(_ether_stat) \ ((_ether_stat) == ETHER_STAT_ALIGN_ERRORS || \ diff --git a/usr/src/uts/i86pc/ml/amd64.il b/usr/src/uts/i86pc/ml/amd64.il index 8b694c4915..9abac56955 100644 --- a/usr/src/uts/i86pc/ml/amd64.il +++ b/usr/src/uts/i86pc/ml/amd64.il @@ -177,28 +177,3 @@ xorl %eax, %eax bsrw %di, %ax .end - -/* - * prefetch 64 bytes - */ - - .inline prefetch_read_many,8 - prefetcht0 (%rdi) - prefetcht0 32(%rdi) - .end - - .inline prefetch_read_once,8 - prefetchnta (%rdi) - prefetchnta 32(%rdi) - .end - - .inline prefetch_write_many,8 - prefetcht0 (%rdi) - prefetcht0 32(%rdi) - .end - - .inline prefetch_write_once,8 - prefetcht0 (%rdi) - prefetcht0 32(%rdi) - .end - diff --git a/usr/src/uts/i86pc/ml/ia32.il b/usr/src/uts/i86pc/ml/ia32.il index d1b10939dc..44354b8bca 100644 --- a/usr/src/uts/i86pc/ml/ia32.il +++ b/usr/src/uts/i86pc/ml/ia32.il @@ -176,35 +176,3 @@ movw (%esp), %cx bsrw %cx, %ax .end - -/* - * prefetch 64 bytes - * - * prefetch is an SSE extension which is not supported on older 32-bit processors - * so define this as a no-op for now - */ - - .inline prefetch_read_many, 4 -/ movl (%esp), %eax -/ prefetcht0 (%eax) -/ prefetcht0 32(%eax) - .end - - .inline prefetch_read_once, 4 -/ movl (%esp), %eax -/ prefetchnta (%eax) -/ prefetchnta 32(%eax) - .end - - .inline prefetch_write_many, 4 -/ movl (%esp), %eax -/ prefetcht0 (%eax) -/ prefetcht0 32(%eax) - .end - - .inline prefetch_write_once, 4 -/ movl (%esp), %eax -/ prefetcht0 (%eax) -/ prefetcht0 32(%eax) - .end - diff --git a/usr/src/uts/i86xpv/ml/amd64.il b/usr/src/uts/i86xpv/ml/amd64.il index 4874a7b264..111473332a 100644 --- a/usr/src/uts/i86xpv/ml/amd64.il +++ b/usr/src/uts/i86xpv/ml/amd64.il @@ -86,28 +86,3 @@ shlq $32, %rdx orq %rdx, %rax .end - -/* - * prefetch 64 bytes - */ - - .inline prefetch_read_many,8 - prefetcht0 (%rdi) - prefetcht0 32(%rdi) - .end - - .inline prefetch_read_once,8 - prefetchnta (%rdi) - prefetchnta 32(%rdi) - .end - - .inline prefetch_write_many,8 - prefetcht0 (%rdi) - prefetcht0 32(%rdi) - .end - - .inline prefetch_write_once,8 - prefetcht0 (%rdi) - prefetcht0 32(%rdi) - .end - diff --git a/usr/src/uts/i86xpv/ml/ia32.il b/usr/src/uts/i86xpv/ml/ia32.il index fc41a63bec..d4c5013b43 100644 --- a/usr/src/uts/i86xpv/ml/ia32.il +++ b/usr/src/uts/i86xpv/ml/ia32.il @@ -99,34 +99,3 @@ .inline __rdtsc_insn, 0 rdtsc .end - -/* - * prefetch 64 bytes - * - * prefetch is an SSE extension which is not supported on older 32-bit processors - * so define this as a no-op for now - */ - - .inline prefetch_read_many, 4 -/ movl (%esp), %eax -/ prefetcht0 (%eax) -/ prefetcht0 32(%eax) - .end - - .inline prefetch_read_once, 4 -/ movl (%esp), %eax -/ prefetchnta (%eax) -/ prefetchnta 32(%eax) - .end - - .inline prefetch_write_many, 4 -/ movl (%esp), %eax -/ prefetcht0 (%eax) -/ prefetcht0 32(%eax) - .end - - .inline prefetch_write_once, 4 -/ movl (%esp), %eax -/ prefetcht0 (%eax) -/ prefetcht0 32(%eax) - .end diff --git a/usr/src/uts/intel/asm/cpu.h b/usr/src/uts/intel/asm/cpu.h index c887111058..d70608dc88 100644 --- a/usr/src/uts/intel/asm/cpu.h +++ b/usr/src/uts/intel/asm/cpu.h @@ -34,7 +34,8 @@ extern "C" { #if defined(__i386) || defined(__amd64) -extern __inline__ void ht_pause(void) +extern __inline__ void +ht_pause(void) { __asm__ __volatile__( "pause"); @@ -47,7 +48,8 @@ extern __inline__ void ht_pause(void) * older 32-bit processors, so define this as a no-op for now */ -extern __inline__ void prefetch_read_many(void *addr) +extern __inline__ void +prefetch_read_many(void *addr) { #if defined(__amd64) __asm__( @@ -58,7 +60,8 @@ extern __inline__ void prefetch_read_many(void *addr) #endif /* __amd64 */ } -extern __inline__ void prefetch_read_once(void *addr) +extern __inline__ void +prefetch_read_once(void *addr) { #if defined(__amd64) __asm__( @@ -69,7 +72,8 @@ extern __inline__ void prefetch_read_once(void *addr) #endif /* __amd64 */ } -extern __inline__ void prefetch_write_many(void *addr) +extern __inline__ void +prefetch_write_many(void *addr) { #if defined(__amd64) __asm__( @@ -80,7 +84,8 @@ extern __inline__ void prefetch_write_many(void *addr) #endif /* __amd64 */ } -extern __inline__ void prefetch_write_once(void *addr) +extern __inline__ void +prefetch_write_once(void *addr) { #if defined(__amd64) __asm__( @@ -93,19 +98,22 @@ extern __inline__ void prefetch_write_once(void *addr) #if !defined(__xpv) -extern __inline__ void cli(void) +extern __inline__ void +cli(void) { __asm__ __volatile__( "cli" : : : "memory"); } -extern __inline__ void sti(void) +extern __inline__ void +sti(void) { __asm__ __volatile__( "sti"); } -extern __inline__ void i86_halt(void) +extern __inline__ void +i86_halt(void) { __asm__ __volatile__( "sti; hlt"); @@ -117,7 +125,8 @@ extern __inline__ void i86_halt(void) #if defined(__amd64) -extern __inline__ void __set_ds(selector_t value) +extern __inline__ void +__set_ds(selector_t value) { __asm__ __volatile__( "movw %0, %%ds" @@ -125,7 +134,8 @@ extern __inline__ void __set_ds(selector_t value) : "r" (value)); } -extern __inline__ void __set_es(selector_t value) +extern __inline__ void +__set_es(selector_t value) { __asm__ __volatile__( "movw %0, %%es" @@ -133,7 +143,8 @@ extern __inline__ void __set_es(selector_t value) : "r" (value)); } -extern __inline__ void __set_fs(selector_t value) +extern __inline__ void +__set_fs(selector_t value) { __asm__ __volatile__( "movw %0, %%fs" @@ -141,7 +152,8 @@ extern __inline__ void __set_fs(selector_t value) : "r" (value)); } -extern __inline__ void __set_gs(selector_t value) +extern __inline__ void +__set_gs(selector_t value) { __asm__ __volatile__( "movw %0, %%gs" @@ -151,7 +163,8 @@ extern __inline__ void __set_gs(selector_t value) #if !defined(__xpv) -extern __inline__ void __swapgs(void) +extern __inline__ void +__swapgs(void) { __asm__ __volatile__( "mfence; swapgs"); diff --git a/usr/src/uts/intel/ia32/ml/ia32.il b/usr/src/uts/intel/ia32/ml/ia32.il index 9d763e0ab3..78a2b6c647 100644 --- a/usr/src/uts/intel/ia32/ml/ia32.il +++ b/usr/src/uts/intel/ia32/ml/ia32.il @@ -192,25 +192,25 @@ * so define this as a no-op for now */ - .inline prefetch_read_many, 4 + .inline prefetch_read_many,4 / movl (%esp), %eax / prefetcht0 (%eax) / prefetcht0 32(%eax) .end - .inline prefetch_read_once, 4 + .inline prefetch_read_once,4 / movl (%esp), %eax / prefetchnta (%eax) / prefetchnta 32(%eax) .end - .inline prefetch_write_many, 4 + .inline prefetch_write_many,4 / movl (%esp), %eax / prefetcht0 (%eax) / prefetcht0 32(%eax) .end - .inline prefetch_write_once, 4 + .inline prefetch_write_once,4 / movl (%esp), %eax / prefetcht0 (%eax) / prefetcht0 32(%eax) |