The Barefoot shell is available directly from EXEC mode. The shell enables you to issue commands directly to the Barefoot
Networks Tofino ASICs, which are supported in the Cisco Nexus 3464C and Cisco Nexus 34180YC switches. You can check the model
of your switch by issuing the show module command.
Example:switch-1# show module
Mod Ports Module-Type Model Status
--- ----- ------------------------------------- --------------------- ---------
1 66 64x100G QSFP28 + 2x10G SFP+ Ethernet N3K-C3464C active *
This topic documents how to access the Barefoot shell from NX-OS, use the online help function, and exit the Barefoot shell.
For detailed documentation about the Barefoot shell and its commands, consult the Barefoot Networks Tofino documentation.
-
To enter the Barefoot shell, issue the bfshell command.
Example:
switch-1# bfshell
Warning: bfshell access should be used with caution
********************************************
* WARNING: Authorised Access Only *
********************************************
bfshell>
The command prompt changes to bfshell
to indicate that you are in the Barefoot shell.
-
To get a list of top-level commands in the hierarchy, type ? (question mark).
Example:
bfshell> ?
cint C Interpreter
exit Exit this CLI session
help Display an overview of the CLI syntax
pd-switch pd_switch Related Commands
pipemgr Pipe manager commands
quit Exit this CLI session
switchapi switchAPI commands
ucli UCLI commands
version Display the SDE version
-
To get details about the types of help available, type help at the prompt.
Example:bfshell> help
CONTEXT SENSITIVE HELP
[?] - Display context sensitive help. This is either a list of possible
command completions with summaries, or the full syntax of the
current command. A subsequent repeat of this key, when a command
has been resolved, will display a detailed reference.
AUTO-COMPLETION
The following keys both perform auto-completion for the current command line.
If the command prefix is not unique then the bell will ring and a subsequent
repeat of the key will display possible completions.
[enter] - Auto-completes, syntax-checks then executes a command. If there is
a syntax error then offending part of the command line will be
highlighted and explained.
[space] - Auto-completes, or if the command is already resolved inserts a space.
MOVEMENT KEY
[CTRL-A] - Move to the start of the line.
[CTRL-E] - Move to the end of the line.
[up] - Move to the previous command line held in history.
[down] - Move to the next command line held in history.
[left] - Move the insertion point left one character.
[right] - Move the insertion point right one character.
DELETION KEYS
[CTRL-C] - Delete and abort the current line.
[CTRL-D] - Delete the character to the right on the insertion point.
[CTRL-K] - Delete all the characters to the right of the insertion point.
[CTRL-U] - Delete the whole line.
[backspace] - Delete the character to the left of the insertion point.
ESCAPE SEQUENCES
!! - Subsitute the the last command line.
!N - Substitute the Nth command line (absolute as per 'history' command)
!-N - Substitute the command line entered N lines before (relative)
bfshell>
-
To change to different command subsystems in the hierarchy, enter the top-level command name.
For example, to change to the pd-switch commands:bfshell> ?
cint C Interpreter
exit Exit this CLI session
help Display an overview of the CLI syntax
pd-switch pd_switch Related Commands
pipemgr Pipe manager commands
quit Exit this CLI session
switchapi switchAPI commands
ucli UCLI commands
version Display the SDE version
bfshell> pd-switch
pd-switch:0>
Notice the prompt changes to display the subsystem.
New commands are available within each subsystem in the hierarchy.
pd-switch:0> ?
dump_profile dump action profile entries
dump_table dump table entries
end End pd-switch sub-commands
exit Exit this CLI session
get Display value of shell variable
help Display an overview of the CLI syntax
pd prefix for all pd commands
quit Exit this CLI session
set Set value of shell variable
var Declare new shell variable
-
To exit the Barefoot shell, issue either the exit or quit command, which terminates the current Barefoot CLI session and returns you to the NX-OS prompt. You can issue these commands
from anywhere in the hierarchy.
Examples:
pd-switch:0> exit
switch-1#
bfshell> quit
switch-1#