PortSAMp
Set/Display sflow port sampling characteristics
- PortSAMp
Shortest form:
psam.Show or set packet sampling (as used by sFlow) per port: ingress rate, egress rate, and where sampled ingress packets go. The older
PortSampRatesets only the two rates.The first argument is an optional port bitmap (all ports if omitted; see Ports and port bitmaps). It is followed by any of:
IngressRate=<n>,EgressRate=<n>: sample on average one packet in n; 0 turns sampling off and 1 samples every packet;IngressDest=None|CPU|Mirror|MirrorAndCPU: where sampled ingress packets go.
Any other word prints
PortSAMp: Unknown argument <word>. With keys, the command printsPort = <name>(<n>)for each port and thenIngressRate set to <n>(and so on) for each setting. Without keys it prints aPort Sampling Details:table with the columnsport,IngressRate,EgressRateandIngressDest. On chips without this sampling support the command does nothing. A port without sFlow shows rates0and destinationNone.The built-in help shows
IngressDest=None|Mirror|CPU|MirrorAndCPU; the shell actually treats any word other thanCPU,MirrorandMirrorAndCPUasNone, without an error, so a typo turns sampling to the CPU off.Showing is safe. Setting changes sampling behind SONiC’s back; SONiC’s sFlow configuration is not updated and may later overwrite the change.
Hardware-validated — Show sampling settings of two ports
drivshell> PortSAMp ce0,ce1 Port Sampling Details: port IngressRate EgressRate IngressDest ce0( 1) 0 0 None ce1( 5) 0 0 None
Unvalidated — Sample one in 4096 received packets on ce0 to the CPU
drivshell> PortSAMp ce0 IngressRate=4096 IngressDest=CPUBuilt-in help
Set/Display port sampling characteristics. Parameters: <pbm> [IngressRate=<value>] [EgressRate=<value>] [IngressDest=None|Mirror|CPU|MirrorAndCPU] IngressRate/EgressRate: On average, every 1/(ingress_rate|egress_rate) packets will be sampled. A rate of 0 indicates no sampling. A rate of 1 indicates all packets sampled.