fcoe
fcoe - configure Fibre Channel over Ethernet header and trailer packet.
SYNOPSIS
fcoe sub-command options
DESCRIPTION
The fcoe command is used to configure Fibre Channel over Ethernet (FCoE) header and trailer packet. FCoE is a method of communicating data for streams and protocols.
STANDARD OPTIONS
eEofDelimiter
Configure the end of frame delimiter. (default = 65) Available options are:
Option |
Value |
Usage |
---|---|---|
fcoeEofTerminate |
66 |
(default) End of frame terminate |
fcoeEofAbort |
80 |
EoF abort |
fcoeEofNormal |
65 |
EoF normal |
fcoeEofNormalInvalid |
73 |
EoF normal invalid |
fcoeEofRemoveTerminateClass4 |
68 |
EoF remove terminate class 4 |
fcoeEofRemoveTerminateInvalid |
79 |
EoF remove terminate invalid class 4 |
eEofReserved
Configure the end of frame reserved value. (default = '00 00 00')
enableValidateFrame
Size true/false
Enable the stream size validation. The frame size should be a multiple of 4. (default = false)
eSofReserved
Configure the start of frame reserved value. This is a 12-byte hex value.
(default = '00 .. 00')
eSofDelimiter
Configure the start of frame delimiter. (default = 54) Available option values are:
Option |
Value |
Usage |
---|---|---|
fcoeSofNormalClass1 |
55 |
Start of frame normal class 1 |
fcoeSofInitiateClass2 |
45 |
SoF initiate class 2 |
fcoeSofNormalClass2 |
53 |
SoF normal class 2 |
fcoeSofInitiateClass3 |
46 |
SoF initiate class 3 |
fcoeSofNormalClass3 |
54 |
(default) SoF normal class 3 |
fcoeSofActivateClass4 |
57 |
SoF activate class 4 |
fcoeSofInitiateClass4 |
41 |
SoF initiate class 4 |
fcoeSofNormalClass4 |
49 |
SoF normal class 4 |
fcoeSofFabric |
40 |
SoF fabric |
version
Configure the version. (default = 1)
COMMANDS
The fcoe command is invoked with the following sub-commands. If no sub-command is specified, returns a list of all sub-commands available.
fcoe decode capFrame chasID cardID portID
Decodes the FCoE header and trailer packet and refreshes the IxTclHal object. Specific errors are:
- No connection to a chassis
- The captured frame is not a valid fcoe packet
fcoe get chasID cardID portID
Gets current FCoE header and trailer settings from IxHal and refreshes IxTclHal object. Specific errors are:
- No connection to a chassis
- Invalid port
fcoe set chasID cardID portID
Sets current FCoE header and trailer settings from IxTclHal to local IxHal. Specific errors are:
- No connection to a chassis
- Unsupported feature
- The port is being used by another user
- The configured parameters are not valid for this port
fcoe setDefault chasID cardID portID
Sets to IxTclHal local default.
EXAMPLES
package req IxTclHal
set hostname ixia_hostname
if {[ixConnectToChassis $hostname]} {
errorMsg "error connecting $hostname chassis"
return "FAIL"
}
set chassId [chassis cget -id]
set cardId 2
set portId 1
set streamId 1
set portList [list [list $chassId $cardId $portId ] ]
if {![port isValidFeature $chassId $cardId $portId $::portFeatureDataCenterMode]} {
errorMsg "portFeatureDataCenterMode is not valid on $chassId $cardId $portId"
return "FAIL"
}
# Configure FCoE interfaces
proc configurePortAndProtocols { portList } \
{
set retCode $::TCL_OK
if {[ixSetWidePacketGroupMode portList]} {
errorMsg "Error in Setting Wide Packet Group Mode"
set retCode $::TCL_ERROR
}
foreach port $portList {
scan $port "%d %d %d" chassId cardId portId
port setFactoryDefaults $chassId $cardId $portId
port config -flowControl $::true
port config -enableAutoDetectInstrumentation $::true
port config -autoDetectInstrumentationMode $::portAutoInstrumentationModeFloating
port config -loopback $::portLoopback
port config -receiveMode [expr $::portCapture|$::portRxSequenceChecking|$::portRxModeWidePacketGroup]
port config -transmitMode $::portTxModeAdvancedScheduler
if {[port set $chassId $cardId $portId]} {
errorMsg "Error calling port set $chassId $cardId $portId"
set retCode $::TCL_ERROR
}
stat setDefault
stat config -mode statNormal
stat config -enableFcoeStats $::true
stat config -fcoeRxSharedStatType1 $::statFcoeValidFrames
stat config -fcoeRxSharedStatType2 $::statFcoeValidFrames
if {[stat set $chassId $cardId $portId]} {
errorMsg "Error calling stat set $chassId $cardId $portId"
set retCode $::TCL_ERROR
}
packetGroup setDefault
packetGroup config -enableInsertPgid true
packetGroup config -latencyControl cutThrough
packetGroup config -groupIdMode packetGroupSplit
if {[packetGroup setRx $chassId $cardId $portId]} {
errorMsg "Error calling packetGroup setRx $chassId $cardId $portId"
set retCode $::TCL_ERROR
}
splitPacketGroup setDefault
splitPacketGroup config -groupIdOffset 32
splitPacketGroup config -groupIdOffsetBaseType $::splitPgidStartOfFrame
splitPacketGroup config -groupIdWidth 4
splitPacketGroup config -groupIdMask "FF FF 00 00"
if {[splitPacketGroup set $chassId $cardId $portId 0]} {
errorMsg "Error calling splitPacketGroup set $chassId $cardId $portId 0"
set retCode $::TCL_ERROR
}
splitPacketGroup setDefault
splitPacketGroup config -groupIdOffset 52
splitPacketGroup config -groupIdOffsetBaseType $::splitPgidStartOfFrame
splitPacketGroup config -groupIdWidth 4
splitPacketGroup config -groupIdMask "FF FF FF FF"
if {[splitPacketGroup set $chassId $cardId $portId 1]} {
errorMsg "Error calling splitPacketGroup set $chassId $cardId $portId 1"
set retCode $::TCL_ERROR
}
splitPacketGroup setDefault
splitPacketGroup config -groupIdOffset 52
splitPacketGroup config -groupIdOffsetBaseType $::splitPgidStartOfFrame
splitPacketGroup config -groupIdWidth 4
splitPacketGroup config -groupIdMask "FF FF FF FF"
if {[splitPacketGroup set $chassId $cardId $portId 2]} {
errorMsg "Error calling splitPacketGroup set $chassId $cardId $portId 2"
set retCode $::TCL_ERROR
}
autoDetectInstrumentation setDefault
autoDetectInstrumentation config -startOfScan 0
autoDetectInstrumentation config -signature {87 73 67 49 42 87 11 80 08 71 18 05}
if {[autoDetectInstrumentation setRx $chassId $cardId $portId]} {
errorMsg "Error calling autoDetectInstrumentation setRx $chassId $cardId $portId"
set retCode $::TCL_ERROR
}
if {[interfaceTable select $chassId $cardId $portId]} {
errorMsg "Error calling interfaceTable select $chassId $cardId $portId"
set retCode $::TCL_ERROR
}
interfaceTable setDefault
interfaceTable config -fcoeRequestRate 500
interfaceTable config -fcoeNumRetries 5
if {[interfaceTable set]} {
errorMsg "Error calling interfaceTable set"
set retCode $::TCL_ERROR
}
interfaceTable clearAllInterfaces
#### Interface entry type - interfaceTypeConnected
interfaceEntry clearAllItems addressTypeIpV6
interfaceEntry clearAllItems addressTypeIpV4
interfaceEntry setDefault
fcoeProperties setDefault
fcoeProperties config -sourcePortWWN "02 00 04 FF FE 9F 0A 5C"
fcoeProperties config -sourceNodeWWN "02 00 04 00 00 9F 0A 5C"
fcoeProperties config -destinationId "01.b6.69"
fcoeProperties config -sourceOui "0e.fc.00"
fcoeProperties config -bufferToBufferRxSize 2112
fcoeProperties config -enableNs $::false
fcoeProperties config -enablePlogi $::false
interfaceEntry config -enable true
interfaceEntry config -description "ProtocolInterface1"
interfaceEntry config -macAddress {00 00 04 9F 0A 5C}
interfaceEntry config -eui64Id {02 00 04 FF FE 9F 0A 5C}
interfaceEntry config -mtu 1500
interfaceEntry config -enableFlogi $::true
if {[interfaceTable addInterface interfaceTypeConnected]} {
errorMsg "Error calling interfaceTable addInterface interfaceTypeConnected"
set retCode $::TCL_ERROR
}
#### Interface entry type - interfaceTypeNpiv
interfaceEntry clearAllItems addressTypeIpV6
interfaceEntry clearAllItems addressTypeIpV4
interfaceEntry setDefault
npivProperties setDefault
npivProperties config -sourcePortWWN "02 00 04 FF FE 9F 0A 5D"
npivProperties config -sourceNodeWWN "02 00 04 00 00 9F 0A 5D"
npivProperties config -destinationId "01.b6.69"
npivProperties config -bufferToBufferRxSize 2112
npivProperties config -enableNs $::false
npivProperties config -enablePlogi $::false
interfaceEntry config -enable $::true
interfaceEntry config -description "NpivInterface2"
interfaceEntry config -connectedVia "ProtocolInterface1"
if {[interfaceTable addInterface interfaceTypeNpiv]} {
errorMsg "Error calling interfaceTable addInterface interfaceTypeNpiv"
set retCode $::TCL_ERROR
}
}
if {[ixWritePortsToHardware portList]} {
errorMsg "Error ixWritePortsToHardware"
set retCode $::TCL_ERROR
}
if {[ixCheckLinkState portList]} {
errorMsg "Error ixCheckLinkState"
set retCode $::TCL_ERROR
}
return $retCode
}
#Configure FCoE streams
proc configureFcoeStreams { portList SourceIdArray } \
{
upvar $SourceIdArray sourceIdArray
set retCode $::TCL_OK
foreach port $portList {
scan $port "%d %d %d" chassId cardId portId
port reset $chassId $cardId $portId
for {set streamId 1 } {$streamId <= 2 } { incr streamId} {
# Stream 1
protocol setDefault
protocol config -name $::fcoe
protocol config -ethernetType $::ethernetII
stream setDefault
stream config -enable $::true
stream config -numFrames 1000
stream config -gapUnit $::gapNanoSeconds
stream config -rateMode $::usePercentRate
stream config -framesize 100
stream config -frameSizeType $::sizeFixed
stream config -patternType $::incrByte
stream config -dataPattern x00010203
stream config -pattern "00 01 02 03"
stream config -frameType "89 06"
stream config -dma $::stopStream
stream config -enableStatistic $::true
stream config -enableSourceInterface $::true
stream config -priorityGroup $::priorityGroup0
stream config -patternType $::incrByte
stream config -preambleSize 8
if {$streamId == 1} {
stream config -name "FCoE stream"
stream config -sa "0E FC 00 00 00 08"
stream config -da "6D 50 00 00 01 95"
stream config -percentPacketRate 50
stream config -sourceInterfaceDescription "ProtocolInterface1"
} else {
stream config -name "NPIV stream"
stream config -sa "0E FC 00 00 00 01"
stream config -da "6D 50 00 00 01 95"
stream config -percentPacketRate 50.000014565
stream config -sourceInterfaceDescription "NpivInterface2"
}
fcoe setDefault
fcoe config -enableValidateFrameSize $::true
fcoe config -version 1
fcoe config -eSofReserved "00 00 00 00 00 00 00 00 00 00 00 00 00"
fcoe config -eSofDelimiter $::fcoeSofNormalClass3
fcoe config -eEofDelimiter $::fcoeEofTerminate
fcoe config -eEofReserved "00 00 00"
if {[fcoe set $chassId $cardId $portId]} {
errorMsg "Error calling fcoe set $chassId $cardId $portId"
set retCode $::TCL_ERROR
}
fibreChannel setDefault
fibreChannel config -destinationId "00.00.00"
fibreChannel config -routingControlType $::fibreChannelDeviceDataFrames
fibreChannel config -routingControlInformation $::fibreChannelUncategorizedInformation
if {$streamId == 1} {
fibreChannel config -sourceId $sourceIdArray($chassId,$cardId,$portId,fcoe)
} else {
fibreChannel config -sourceId $sourceIdArray($chassId,$cardId,$portId,npiv)
}
fibreChannel config -csControlOrPriorityValue 0x00
fibreChannel config -frameControl "00 00 00"
fibreChannel config -type 0x00
fibreChannel config -sequenceCount 5
fibreChannel config -dataFieldControl 0x00
fibreChannel config -sequenceId 0x00
fibreChannel config -responderExchangeId "00 00"
fibreChannel config -originatorExchangeId "00 00"
fibreChannel config -parameter "00 00 00 00"
fibreChannel config -originatorExchangeCounter fibreChannelIdle
fibreChannel config -enableBadFibreChannelCrc $::true
fibreChannel config -enableUseFcControlBits $::true
fibreChannel config -exchangeContext $::fibreChannelOriginator
fibreChannel config -sequenceContext $::fibreChannelInitiator
fibreChannel config -firstSequence $::fibreChannelFirstSequenceOther
fibreChannel config -lastSequence $::fibreChannelLastSequenceOther
fibreChannel config -endSequence $::fibreChannelEndSequenceOther
fibreChannel config -endConnection $::fibreChannelConnectionAlive
fibreChannel config -csControlOrPriority $::fibreChannelCsCtl
fibreChannel config -sequenceInitiative $::fibreChannelInitiativeHold
fibreChannel config -ackForm $::fibreChannelOriginal
fibreChannel config -retransmittedSequence $::fibreChannelOriginal
fibreChannel config -unidirectionalTransmit $::fibreChannelBidirectional
fibreChannel config -continueSequenceCondition $::fibreChannelNoInformation
fibreChannel config -abortSequenceCondition $::fibreChannelContinue
fibreChannel config -relativeOffsetPresent $::fibreChannelRelativeOffsetDefined
fibreChannel config -exchangeReassembly $::fibreChannelExchangeReassemblyOff
fibreChannel config -fillBytes $::fibreChannelZeroHexByteFill
if {[fibreChannel set $chassId $cardId $portId]} {
errorMsg "Error calling fibreChannel set $chassId $cardId $portId"
set retCode $::TCL_ERROR
}
if {[stream set $chassId $cardId $portId $streamId]} {
errorMsg "Error calling stream set $chassId $cardId $portId $streamId"
set retCode $::TCL_ERROR
}
packetGroup setDefault
packetGroup config -signature "08 71 18 05"
packetGroup config -insertSignature $::true
packetGroup config -groupId 1
packetGroup config -groupIdOffset 66
packetGroup config -enableInsertPgid $::true
packetGroup config -sequenceNumberOffset 68
packetGroup config -sequenceErrorThreshold 2
packetGroup config -insertSequenceSignature $::true
packetGroup config -latencyControl $::cutThrough
if {[packetGroup setTx $chassId $cardId $portId $streamId]} {
errorMsg "Error calling packetGroup setTx $chassId $cardId $portId $streamId"
set retCode $::TCL_ERROR
}
dataIntegrity setDefault
dataIntegrity config -signatureOffset 52
dataIntegrity config -signature "08 71 18 00"
dataIntegrity config -insertSignature $::true
dataIntegrity config -enableTimeStamp $::false
dataIntegrity config -floatingTimestampAndDataIntegrityMode $::dataIntegrityNumberOfBytesFromEndOfFrame
dataIntegrity config -numBytesFromEndOfFrame 12
dataIntegrity config -payloadLength 0
if {[dataIntegrity setTx $chassId $cardId $portId $streamId]} {
errorMsg "Error calling dataIntegrity setTx $chassId $cardId $portId $streamId"
set retCode $::TCL_ERROR
}
autoDetectInstrumentation setDefault
autoDetectInstrumentation config -enableTxAutomaticInstrumentation $::true
autoDetectInstrumentation config -signature {87 73 67 49 42 87 11 80 08 71 18 05}
if {[autoDetectInstrumentation setTx $chassId $cardId $portId $streamId]} {
errorMsg "Error calling autoDetectInstrumentation setTx $chassId $cardId $portId $streamId"
set retCode $::TCL_ERROR
}
}
}
ixWriteConfigToHardware portList
return $retCode
}
proc fcoeMainTest { portList } \
{
errorMsg "******** Testing Latency Test and Stream-Interface linkage Test on $portList"
set retCode $::TCL_OK
if {[configurePortAndProtocols $portList ]} {
errorMsg "Error configurePortAndProtocols"
set retCode $::TCL_ERROR
}
errorMsg "Starting FCoE Server..."
package require IxTclServices
set pcpuCommand "/shared/chassis/arch/bin/fcoeserver&"
if {[issuePcpuCommand portList $pcpuCommand]} {
errorMsg "Failed to start FCoE server"
set retCode $::TCL_ERROR
} else {
errorMsg "FCoE Server started..."
}
# Give some time for FCoE server to start
after 4000
# Verify FCoE discovered information
foreach port $portList {
scan $port "%d %d %d" chassId cardId portId
if {[interfaceTable select $chassId $cardId $portId]} {
errorMsg "Error selecting interfaceTable on $chassId $cardId $portId."
set retCode $::TCL_ERROR
}
if {[interfaceTable requestDiscoveredTable]} {
errorMsg "Error interfaceTable requestDiscoveredTable on $chassId $cardId $portId."
set retCode $::TCL_ERROR
}
if {[interfaceTable getFirstInterface interfaceTypeConnected ]} {
errorMsg "Error adding interfaceTypeConnected to interfaceTable on $chassId $cardId $portId."
set retCode $::TCL_ERROR
}
set interfaceDescription [interfaceEntry cget -description]
after 2000
fcoeDiscoveredInfo setDefault
if {[interfaceTable getFcoeDiscoveredInfo $interfaceDescription]} {
errorMsg "Error getting Fcoe Discovered table for $interfaceDescription on $chassId $cardId $portId."
set retCode $::TCL_ERROR
}
set sourceIdArray($chassId,$cardId,$portId,fcoe) [fcoeDiscoveredInfo cget -sourceId]
ixPuts ">>>>>> $interfaceDescription DiscoveredInfo [fcoeDiscoveredInfo cget -sourceId]"
set pgidStringFcoe [fcoeDiscoveredInfo cget -sourceId]
set firstPgid [string range $pgidStringFcoe 7 8]
if {[interfaceTable getFirstInterface interfaceTypeNpiv ]} {
errorMsg "Error adding interfaceTypeNpiv to interfaceTable on $chassId $cardId $portId."
set retCode $::TCL_ERROR
}
set interfaceDescriptionNpiv [interfaceEntry cget -description]
if {[interfaceTable getFcoeDiscoveredInfo $interfaceDescriptionNpiv]} {
errorMsg "Error getting Fcoe Discovered table for $interfaceDescriptionNpiv on $chassId $cardId $portId."
set retCode $::TCL_ERROR
}
set sourceIdArray($chassId,$cardId,$portId,npiv) [fcoeDiscoveredInfo cget -sourceId]
ixPuts ">>>>>> $interfaceDescription DiscoveredInfo [fcoeDiscoveredInfo cget -sourceId]"
set pgidStringNpiv [fcoeDiscoveredInfo cget -sourceId]
set secondPgid [string range $pgidStringNpiv 7 8]
}
if {[configureFcoeStreams $portList sourceIdArray ]} {
errorMsg "Error configureFcoeStreams"
set retCode $::TCL_ERROR
}
if {$retCode == $::TCL_OK } {
set txFrames 2000 ;# 1000 FCoE and 1000 Npiv
ixClearTimeStamp portList
ixClearStats portList
ixStartCapture portList
ixStartPacketGroups portList
ixStartTransmit portList
after 2000
ixStopTransmit portList
ixCheckTransmitDone portList
ixStopPacketGroups portList
ixStopCapture portList
ixRequestStats portList
set expectedNumGroups 1455
foreach port $portList {
scan $port "%d %d %d" chassId cardId portId
if {[statList get $chassId $cardId $portId]} {
errorMsg "Error getting stats for $chassId $cardId $portId."
set retCode $::TCL_ERROR
}
ixPuts " fcoeRxSharedStat1 [statList cget -fcoeRxSharedStat1]"
ixPuts " fcoeRxSharedStat2 [statList cget -fcoeRxSharedStat2]"
# Now get the statistics back
# First a get for all of the packet groups
if [packetGroupStats get $chassId $cardId $portId 0 $expectedNumGroups ] {
errorMsg "Error in packetGroupStats get on $chassId $cardId $portId"
set retCode $::TCL_ERROR
}
ixPuts " numGroups [packetGroupStats cget -numGroups] "
}
}
# shut down FCoE Server
set pcpuFcoeSrvStop {/bin/ps& -ef | /bin/grep 'fcoeserver' | /bin/grep -v grep | /shared/chassis/arch/usr/bin/awk '{print $1}' | /usr/bin/xargs kill -9}
if {[issuePcpuCommand portList $pcpuFcoeSrvStop]} {
errorMsg "Failed to kill FCoE server on $chassId $cardId $portId"
set retCode $::TCL_ERROR
} else {
errorMsg "FCoE Server Stopped..."
}
package forget IxTclServices
return $retCode
}
# Run the test
fcoeMainTest $portList