The number of meters used for a SAP ingress policy that is configured to use the service-meter pool is equal to the number of unique meters mapped to different FCs in the fc-meter-map policy that is associated with the SAP ingress policy.
The fc-meter-map defines the association between the meters and the FC-to-meter. Meter resources are allocated only to meters that have an associated FC. For example, if 10 meters are created in the fc-meter-map, and only 5 meters are associated with an FC, the system allocates only 5 meters per SAP (and not 10 meters) and rounds off the number of meters to the nearest power of 2, which results in eight (8) meters to be allocated. Meters that are not associated with an FC are ignored for resource allocation. The number of counters allocated is equal to twice the number of meters per SAP.
Based on the number of meters that the SAP requires, the amount of meter resources allocated in hardware is equal to the nearest power of 2 greater than the number of meters required. For example, if the number of required meter resources as determined by the fc-meter-map is five (5), then eight (8) meter resources are allocated in hardware. Similarly, if the number of meter resources required as determined by the fc-meter-map is 10, then 16 meter resources are allocated in hardware.
The number of counters allocated corresponds to the number of meters. If the number of counter resources required as determined by the fc-meter-map is 16, then 32 counter resources are allocated in the hardware.
Even if no CAM resources are used for either classification (that is, matching of packet header QoS bits) or for meters, at least 1 slice must be allocated to SAP ingress classification and policing from the ingress-internal-tcam>qos-sap-ingress-resource pool.
The slice is used to allocate resources that are required for the default SAP ingress policy (which requires 1 tcam meter resource and 2 tcam classification resources), when the SAP is configured using the create command. Otherwise, SAP configuration using the create command will fail. The remaining SAP ingress resource pool CAM slices from the ingress-internal-tcam resource pool can be reassigned to other entities.