Flexible counter bank allocation
SR Linux devices allow flexible counter bank allocation for the following applications:
7250 IXR Gen 2c+
- Early Congestion Notification (ECN) statistics
- LSP statistics (ingress and egress)
- IP-in-IP tunnel statistics
7250 IXR Gen 3
- Early Congestion Notification (ECN) statistics
- IP-in-IP tunnel statistics
Some counter banks are pre-assigned for essential applications, for example, CPM filter counters, interface queue statistics, and so on. These pre-assigned banks cannot be modified. Other banks are free and available for assignment to the applications listed above. The number of banks you assign, along with their size, determines how many statistics can be collected. To view the list of banks you can allocate to an application, use the info from state with-context platform linecard forwarding-complex counter-banks command. See Displaying bank allocations on line cards for more information.
For each SR Linux device, you can select one of the supported applications and assign one or more free counter banks identified by unique IDs. Banks come in different sizes depending on the SR Linux device. You must match the application’s scale requirement to a bank large enough to store all counters. If a single bank is not large enough, you can allocate multiple banks to expand capacity. For example, assigning bank-id 1 to ingress-lsp-statistics, stores LSP ingress statistics in bank 1 on a specific device. Adding bank-id 4 to the same application expands the allocation, therefore increasing the capacity. See Performing counter bank allocations for more inforation. In addition to bank allocation, the applications may also have specific bank size or scaling requirements.
Counter banks available on 7250 IXR Gen 2c+
The following table lists the free counter banks with IDs and sizes available for allocation when a 7250 IXR Gen 2c+ device boots.
| Bank ID | Bank size |
|---|---|
| 1, 4 | 4K |
| 13, 15 | 8K |
| 19, 28, 29, 30, 31, 32, 33, 34 | 16K |
Counter banks available on 7250 IXR Gen 3
The following table lists the free counter bank with IDs and sizes available for allocation when a 7250 IXR Gen 3 device boots.
| Bank ID | Bank size |
|---|---|
| 1, 2, 4, 11, 12 | 6K |
| 21, 22, 23, 24 | 12K |
| 30, 31 | 24K |
Reboot requirements
-
Reboot is not required for the following tasks:
- Allocating a free bank to an application.
- Adding a free bank to an existing application.
-
Reboot is required for the following tasks:
- An application evacuating a bank.
- Replacing a bank with another bank, smaller or larger
The show command, info from state with-context platform resource-management counter-banks displays the pending allocations that require system reboot. See Verifying reboot status of bank allocations for more information.
Bank allocation considerations
- If no bank is allocated or allocation fails and the application enables statistics, the node returns statistics as all zeros. The node reports the allocation failure back to the application. The node does not manage retries or maintain retry queues. The application retries using a bank when it becomes available.
- If counter banks are not available for additional entries, the node reports the shortage.
- Applications define their own maximum limits. Even if banks are available, statistics collection stops after the application reaches the maximum limit.
Performing counter bank allocations
To allocate a bank to an application, use the platform resource-management counter-banks forwarding-complex-type application bank-allocation command, specifying the SR Linux device type, application, and the bank ID as shown in the example.
Allocating a bank to 7250 IXR Gen 2c+ egress LSP statistics
This example allocates bank 1 to 7250 IXR Gen 2c+ egress LSP statistics.
--{ + candidate shared default }--[ ]--
# info with-context platform resource-management counter-banks
platform {
resource-management {
counter-banks {
forwarding-complex-type Gen2c+ {
application egress-lsp-stats {
bank-allocation 1 {
}
}
}
}
}
}
Displaying bank allocations on line cards
To view the bank allocation on line cards, use the info from state with-context platform linecard forwarding-complex counter-banks command specifying the line card and forwarding complex.
View bank allocation on a line card
This example displays the bank allocation on line card 1.
--{ + candidate shared default }--[ ]--
# info from state with-context platform linecard 1 forwarding-complex 1 counter-banks
platform {
linecard 1 {
forwarding-complex 1 {
counter-banks {
bank 1 {
bank-size 4K
application ingress-lsp-stats {
entries 4096
}
}
bank 4 {
bank-size 4K
application ingress-lsp-stats {
entries 4096
}
}
bank 13 {
bank-size 8K
application unallocated {
}
}
bank 15 {
bank-size 8K
application unallocated {
}
}
bank 19 {
bank-size 16K
application unallocated {
}
}
bank 28 {
bank-size 16K
application unallocated {
}
}
bank 29 {
bank-size 16K
application unallocated {
}
}
bank 30 {
bank-size 16K
application unallocated {
}
}
bank 31 {
bank-size 16K
application unallocated {
}
}
bank 32 {
bank-size 16K
application unallocated {
}
}
bank 33 {
bank-size 16K
application unallocated {
}
}
bank 34 {
bank-size 16K
application unallocated {
}
}
}
}
}
}
Verifying reboot status of bank allocations
To verify whether a bank allocation takes effect immediately or requires a reboot, use the info from state with-context platform resource-management counter-banks command. Check the chassis-reboot-required flag in the output.
If the flag is set to false, the allocation is active immediately. See Reboot not required.
If the flag is set to true, the allocation only applies after a reboot. See Reboot required.
Reboot not required
The following example shows that the bank allocation is active and reboot is not required.
--{ + candidate shared default }--[ ]--
# info from state with-context platform resource-management counter-banks
platform {
resource-management {
counter-banks {
chassis-reboot-required false
forwarding-complex-type Gen2c+ {
application ingress-lsp-stats {
bank-allocation 1 {
}
bank-allocation 4 {
}
}
}
}
}
}
Reboot required
The following example shows that the bank allocation is modified and reboot is required.
--{ + candidate shared default }--[ ]--
# info from state with-context platform resource-management counter-banks
platform {
resource-management {
counter-banks {
chassis-reboot-required true
forwarding-complex-type Gen2c+ {
application ingress-lsp-stats {
}
application ip-in-ip-tunnel-stats {
bank-allocation 1 {
}
bank-allocation 4 {
}
}
}
}
}
}