Hi,
It's not clear where in packet_
utils.
py you have introduced this bit of code.
packet_utils.py contains definitions of certain functions.
Suppose you introduce this bit of code in the function make_packet defined inside packet_utils.py
make_packet() will be called by an instance of mod_pkts() defined inside pkt.py, into which payload is passed.
So, when the send_pkt(payload) is called for the first time, it enters the while loop and it is executed indefinitely. The len(payload) will be computed from the first payload that is passed into the make_packet().
To know the transmitted packet number you should have put the same code in benchmark_tx.py at a suitable location.