[Edited Message Follows] Hi Team, It has been observed that for a single tx packet, the "tx packets" counter at the loop interface is exactly double of the "tx packets" at the sub-interface level. In code, the interface counter gets incremented in "interface_output" node as expected. But it is also gets incremented in "simulated_ethernet_interface_tx" node.
First, function at sub interface level is invoked: src/vnet/interface_output.c: vnet_interface_output_node_inline() 438 /* Update main interface stats. */ 439 vlib_increment_combined_counter ( https://docs.fd.io/vpp/18.04/d7/da2/counter_8h.html#a763f18044631dc6d49428b4abef167b3 ) (im->combined_sw_if_counters 440 + VNET_INTERFACE_COUNTER_TX ( https://docs.fd.io/vpp/18.04/d4/da9/interface_8h.html#a8b270edd4bb2aaffd96ba01dd1797487a680debe9e03856c56126484b9fb6e42a ) , 441 thread_index, 442 rt-> sw_if_index ( https://docs.fd.io/vpp/18.04/d7/dde/structvnet__interface__output__runtime__t.html#ac365d64c5d7605814d5bfec843bb7c07 ) , n_packets, n_bytes); Next, function at loopback interface level is invoked: vnet/vnet/ethernet/interface.c: simulated_ethernet_interface_tx() 380 /* increment TX interface stat */ 381 vlib_increment_combined_counter ( https://docs.fd.io/vpp/16.12/d7/da2/counter_8h.html#a21bff1eefc9d97096e8ca83e21192130 ) (im-> combined_sw_if_counters ( https://docs.fd.io/vpp/16.12/d9/d58/structvnet__interface__main__t.html#a35473073b61bc8050c98169d4f55643d ) + 382 VNET_INTERFACE_COUNTER_TX ( https://docs.fd.io/vpp/16.12/d4/da9/interface_8h.html#a8b270edd4bb2aaffd96ba01dd1797487a680debe9e03856c56126484b9fb6e42a ) , cpu_index, 383 sw_if_index, n_pkts, n_bytes); Count at sub interface level: GigabitEthernet0/6/0.17488 90 up 1500/0/0/0 tx packets 11 tx bytes 12282 Count at loop interface level: (tx packets and bytes count are twice of the sub interface) loop18 94 up 1500/0/0/0 tx packets 22 tx bytes 24476 Is this a expected behavior of incrementing interface counter in "simulated_ethernet_interface_tx" node? Regards, Kathir
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#20583): https://lists.fd.io/g/vpp-dev/message/20583 Mute This Topic: https://lists.fd.io/mt/87534283/21656 Mute #vnet:https://lists.fd.io/g/vpp-dev/mutehashtag/vnet Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-