Solaris使用ndd排除网卡故障
测试硬件:Sun V480&Sun V880
测试环境: Solaris 10 11/06 s10s_u3wos_10 SPARC
故障描述:网络不通或者瞬断后自动恢复
故障检查:排除网络问题,排除网卡、交换机硬件问题后,通过查看错误日志找到问题
# more /var/adm/messages |grep -i warning 或者dmesg |grep -i warning
log样本如下:
Sep 18 18:31:20 DBSERVER2 genunix: [ID 451854 kern.warning] WARNING: ce1: xcvr addr:0x01 - link down
Sep 18 18:31:20 DBSERVER2 in.routed[135]: [ID 238047 daemon.warning] interface ce1 to 192.168.100.60 turned off
Sep 18 18:31:20 DBSERVER2 in.routed[135]: [ID 238047 daemon.warning] interface ce1 to 192.168.100.60 restored
一般超成该故障可能原因为:网卡的参数设置问题
查看网卡参数
ndd -get /dev/ce ?
可以查看和设置的参数如下:
adv_autoneg_cap (read and write)
adv_1000fdx_cap (read and write)
adv_1000hdx_cap (read and write)
adv_100T4_cap (read and write)
adv_100fdx_cap (read and write)
adv_100hdx_cap (read and write)
adv_10fdx_cap (read and write)
adv_10hdx_cap (read and write)
adv_asmpause_cap (read and write)
adv_pause_cap (read and write)
master_cfg_enable (read and write)
master_cfg_value (read and write)
use_int_xcvr (read and write)
enable_ipg0 (read and write)
ipg0 (read and write)
ipg1 (read and write)
ipg2 (read and write)
rx_intr_pkts (read and write)
rx_intr_time (read and write)
red_dv4to6k (read and write)
red_dv6to8k (read and write)
red_dv8to10k (read and write)
red_dv10to12k (read and write)
tx_dma_weight (read and write)
rx_dma_weight (read and write)
infinite_burst (read and write)
disable_64bit (read and write)
accept_jumbo (read and write)
查看网卡的自适应设置:ndd -get /dev/ce adv_autoneg_cap
显示为:0(禁用)
查看adv_1000fdx_cap:ndd -get /dev/ce adv_1000fdx_cap
显示为:1,启用
ok,网卡是支持千兆的,但是交换机是百兆的,而网卡的配置没有启用自适应,造成了该故障
解决方法:修改相关配置
vi /platform/sun4u/kernel/drv/ce.conf 参考如下配置:
# GigaSwift (ce) driver configuration file
# Copyright (c) 2000 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident "@(#)ce.conf 1.0.5 041110 SMI ES-PTS-NET/Lor"
#
############################################
# This file is not needed for most installations !
#
# It MAY be needed for rare special customizations. In this case,
# copy the file and edit the following example to suit your needs.
############################################
#
# Depending on your changes, this file overwrites the Sun[TM] recommended
# default values (To use the default values, you do not need this file).
# In particular, Sun's[TM] recommendation is to leave Ethernet Auto-negotiation
# ON at both link partners (this is the default). See Product Documentation and
# SunSolve Infodocs 41665, 72033 for proper use first.
#
# Most parameters must be set on both sides to have effect
# (e.g check also switch and remote partner(s) settings).
#
# To install:
# 1) On SPARC systems, copy ce.conf to /platform/sun4u/kernel/drv/ce.conf
# On x86 Opteron systems, copy ce.conf to /kernel/drv/ce.conf
# 2) edit file to your needs. Default is to do nothing.
# 3) reboot the system
#
# For settings per interface, name, parent and unit-address
# must be specified. Obtain the hardware path from /etc/driver_aliases and
# /etc/path_to_inst as shown below (unit-address is NOT the instance !) :
#
# % grep ce /etc/driver_aliases
# ce "pci108e,abba"
# | % grep ce /etc/path_to_inst
# | "/pci@21c,700000/pci@1/network@0" 0 "ce"
# | | |
# V V V
# name="pci108e,abba" parent="/pci@21c,700000/pci@1" unit-address="0"
#
# after this, append the settings you want.
# Repeat for each interface to be configured. All other will be default.
# Don't forget the ";" after each section. Hardware path examples:
#
# name="pci108e,abba" parent="/pci@21c,700000/pci@1" unit-address="0"
# (GigaSwift NIC in Sun Fire 15000 hsPCI Board IO 16 PCI Slot 1)
#
# name="pci100b,35" parent="/pci@9,600000/pci@2/pci@0" unit-address="1"
# (2nd port of QGE NIC in Sun Fire V880 PCI Slot 7)
#
name="pci108e,abba" parent="/pci@9,700000" unit-address="2" ;
name="pci108e,abba" parent="/pci@9,600000" unit-address="1" ;
# (V480R onboard interfaces)
#
# For global settings, no hardware path needs to
# be specified, the settings are used for all ce interfaces.
############################################
#
# Select hardware path (not needed if all interfaces set the same)
#name="" parent="" unit-address=""
#
# example: forced 1000 Mbit/s, 802.3x Flow Control send and receive
# Speed/Mode values, set the desired to 1, all other to 0:
adv_1000fdx_cap=0
adv_1000hdx_cap=0
adv_100fdx_cap=0
adv_100T4_cap=0
adv_100hdx_cap=0
adv_10fdx_cap=0
adv_10hdx_cap=0
#
# Enable Ethernet Flow Control
#adv_asmpause_cap=0
#adv_pause_cap=1
#
# Clock Master values, change in forced 1000 Mbit/s back-to-back config only:
#master_cfg_enable=1 # enable usage of master_cfg_value (ce >1.118)
#master_cfg_value=0 # one link partner 1, the other 0 (ce >1.118)
#
# Advertize values above per Auto-negotiation.
# Should be set to 1 in most cases, 0 disables Auto-negotiation
adv_autoneg_cap=1
#
#
# Enable Jumbo Frames
#accept-jumbo=1
;
上面的;表示结束不是多余的哦
更新ce.conf
update_drv -f ce
ok,再次查看系统日志后发现问题消失!