Uploaded image for project: 'vpp'
  1. vpp
  2. VPP-642

Incorrect API specification for vnet_interface_counters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • None
    • None
    • VPP API Infra
    • None

      In src/vnet/interface.api, in the vnet_interface_counters structure definition, the type of the data parameter is specified as u8 while it is actually u64 (see vpp/stats/stats.c).

      This cause the python API binding to incorrectly decode this API message, trashing most of the data.

      There are several possibilities to fix this, I propose that:
      1) We change the type of the data parameter
      2) We change the meaning of the count parameter from the number of interfaces in this stat block to the length of data. So if is_combined!=0, count is twice the number of interfaces, otherwise it is still equal to the number of interfaces in the stat block.

      This is the simplest way to get the API bindings to actually decode all the data. Otherwise we would need to adjust the definition of data to, for instance, u64 data[(1+is_combined) * count], which is much more complex.

            otroan Ole Trøan
            aloysaugustin Aloys Augustin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: