Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    How to Verify Charging Statistics Processing

    Requirements

    This example uses the following hardware and software components:

    • An operational MX chassis
    • Junos OS Mobility package

    Verifying Packet Forwarding Engine Charging Statistics Are Processing Properly

    This section shows an example of verifying that Packet Forwarding Engine charging statistics are processed from the LU to the Stats agent.

    Configuration

    Processing Packet Forwarding Engine Charging Statistics

    Step-by-Step Procedure

    The following procedure shows how to verify that charging statistics are transferred from the LU to Stats agent via TOE. The three components required to ship charging statistics from the forwarding plane to the control plane are:

    • Callout thread: This is a 0.5 sec periodic thread that runs in the LU and is responsible for preparing the charging statistics.
    • Charging thread: This thread runs on the LU TOE and is responsible for shipping charging statistics from the LU to the Stats agent.
    • Stats agent: This runs on the Packet Forwarding Engine host CPU and is responsible for forwarding charging statistics to the charging module.

    The sequence of charging statistics transfer is:

    • Callout thread populates charging statistics data in the Callout FIFO.
    • Callout thread triggers Charging thread to notify it of availability of data in the Callout FIFO.
    • Charging thread checks whether space is available on the Stats FIFO to successfully transfer statistics from the Callout FIFO.
    • If there is not enough space available on the Stats FIFO, the Charging thread aborts the statistics read from the Callout FIFO.
    • If enough space is available in the Stats FIFO, then the Charging thread completes the transfer in two steps:
      • Copy statistics data from Callout FIFO to TOE Lmem.
      • DMA statistics data from TOE Lmem to Stats FIFO

    Follow these steps to verify proper charging statistics handling.

    1. Verify that the Callout thread is populating charging statistics in the Callout FIFO. Check the Callout FIFO descriptor to see whether the Tail (write) pointer moves. The Callout thread increments this Tail (write) pointer by the number of words that it wrote to the Callout FIFO. Therefore, if the Tail (wr) pointer moves, it means that the Callout thread is writing to the Callout FIFO.
      user@host> show jnh 0 ucode-vars
      ...
      ME CHRG information:
      Base address                               : 0xc0000026
      ME CHRG fifo tail(wr)/head(rd)  : 2/0     <================ Check if tail(wr) pointer moves
      ME CHRG fifo base/size             : 0x01300000/1048576
      ME CHRG next walk cookie        : 16140901064495857675
      ME CHRG time stamp                 : 335007768900

      Note: In the preceding snippet, 2/0 means that Tail (write) is 2 and Head (read) is 0. A value of 2 for Tail (write) means that the Callout thread has written two words to Callout FIFO.

    2. Verify that the charging thread is being triggered by the callout thread to indicate data availability for transfer. The callout thread triggers the charging thread to notify it of availability of data in the callout FIFO. To verify that the charging thread is seeing these triggers, you could dump the TOE mobile-edge counters where the count of triggers from the callout thread is maintained. The count represents the count of triggers that the charging thread is able to honor—that is, the charging thread has determined that there are enough resources available to initiate a transfer.
      user@host> show toe pfe 3 lu 0 mobile-edge counters
                            Counter block location in LMEM: 0x4270
      
      Host FIFO full                : 0
      Callout FIFO empty            : 0
      Host addr buff size unaligned : 0
      Host addr page size unaligned : 53
      Test Reg 1                    : 0
      Test Reg 2                    : 0
      Callout-to-LMEM copy bytes    : 231368
      LMEM-to-Host dma bytes        : 231368
      Callout triggers              : 2675            <=== count of triggers from Callout thread
    3. Verify that the Stats FIFO is full. The charging thread checks whether space is available on the Stats FIFO to successfully transfer statistics from the callout FIFO. If the Stats FIFO is full, the transfer is not initiated. For each trigger from the callout thread, the charging thread checks the status of the Stats FIFO and if it is full, increments the counter.
      user@host> show toe pfe 3 lu 0 mobile-edge counters
      Counter block location in LMEM: 0x4270
      
      Host FIFO full                : 0     <=== increments on each trigger from 
                                                                 Callout thread, if Stats FIFO is FULL and 
                                                                  trigger cannot be "honored"
      Callout FIFO empty            : 0
      Host addr buff size unaligned : 0
      Host addr page size unaligned : 53
      Test Reg 1                    : 0
      Test Reg 2                    : 0
      Callout-to-LMEM copy bytes    : 231368
      LMEM-to-Host dma bytes        : 231368
      Callout triggers              : 2675
      
      
    4. Verify that the charging thread is reading the charging statistics from the callout FIFO. Check the TOE mobile-edge counters to get the total number of “bytes” of charging data transferred by the Charging thread, from the Callout FIFO to the TOE LMem.
      user@host> show toe pfe 3 lu 0 mobile-edge counters
      Counter block location in LMEM: 0x4270
      
      Host FIFO full                : 0
      Callout FIFO empty            : 0
      Host addr buff size unaligned : 0
      Host addr page size unaligned : 53
      Test Reg 1                    : 0
      Test Reg 2                    : 0
      Callout-to-LMEM copy bytes    : 231368    <== Number of bytes transferred from 
                                                                                       Callout FIFO to TOE LMem
      LMEM-to-Host dma bytes        : 231368
      Callout triggers              : 2675
    5. Verify that the charging thread is sending charging data to the Stats FIFO. Check the TOE mobile-edge counters to get the number of “bytes” of charging statistics transferred by the charging thread, from the TOE LMem to Stats FIFO.
      user@host> show toe pfe 3 lu 0 mobile-edge counters
      Counter block location in LMEM: 0x4270
      
      Host FIFO full                : 0
      Callout FIFO empty            : 0
      Host addr buff size unaligned : 0
      Host addr page size unaligned : 53
      Test Reg 1                    : 0
      Test Reg 2                    : 0
      Callout-to-LMEM copy bytes    : 231368
      LMEM-to-Host dma bytes        : 231368         <=== Number of bytes transferred by 
                                                                                            charging thread from TOE LMem to Stats FIFO
      Callout triggers              : 2675

    Published: 2011-11-16