# I want to use the Credit Based Shaping feature to allot a particular bandwidth to Channel 2. How do I program the CBS parameters to achieve the same?

Document created by VineethaThomas on Jun 10, 2015
Version 1Show Document

Consider an example of operating at 100Mbps, and the bandwidth to be allotted to Channel 2 is 60Mbps.

Parameters to be programmed: 1. Send Slope 2. Idle Slope 3. High Credit 4. Low Credit

• Channel2 idleSlope

Since bandwidth allocated for Channel 2 is 60%, idleSlope should be 60Mbps.

Credit accumulation rate = idleSlope = 60 Mbps

Credit accumulated per cycle (40ns for 100Mbps operation) = 60 Mbps * 40ns = 2.4 bits

Channel2 idleSlopeCredit Register = 2.4*1024 = 0x99A

• Channel2 sendSlope

Since bandwidth allocated for Channel 2 is 60%, sendSlope should be (100-60)Mbps = 40Mbps
Credit drain rate = sendSlope = 40 Mbps
Credit drained per cycle (40ns for 100Mbps operation) = 40 Mbps * 40ns = 1.6 bits
Channel2 sendSlopeCredit Register = 1.6*1024 = 0x666

• High Credit Value

This is the maximum value that can be accumulated in the credit parameter, specified in bits scaled by 1,024. The maximum value is maxInterferenceSize, that is, best-effort maximum frame size which is 16,384 bytes or 131,072 bits. The value to be specified is 131,072 * 1,024 = 134,217,728 or 0x0800_0000.

• Low Credit Value

This is the minimum value that can be accumulated in the credit parameter, specified in bits scaled by 1,024. The maximum value is maxInterferenceSize, that is, best-effort maximum frame size which is 16,384 bytes or 131,072 bits. The value to be specified is 131,072 * 1,024 = 134,217,728 or 0x0800_0000. The programmed value is 2's complement (negative number), that is, 0xF800_0000.