On Tue, Mar 12, 2024 at 11:01 PM Stephen Hemminger
<step...@networkplumber.org> wrote:
>
> The existing verbose levels 1..3 provide a messy multi-line
> output per packet. This is unhelpful when diagnosing many
> types of problems like packet flow.
>
> This patch adds two new levels:
> 4: one line per packet is printed in a format resembling
>    tshark output. With addresses and protocol info.
> 5: dump packet in hex.
>    Useful if the driver is messing up the data.
>
> Signed-off-by: Stephen Hemminger <step...@networkplumber.org>

That's an interesting addition.
I like the tshark like output.
I had to write similar (more limited) parsing for debug.


I know some project decodes packets and it could probably reuse what
DPDK provides.
Could the parsing function you propose go to lib/net/ maybe?
Something like rte_net_format_packet(const struct rte_mbuf *m, char
*buf, size_t size);
It could be worth instructing the parser to decode only a part of the
packet too (via an offset/size and a hint of the layer).


An additional comment: when you have multiple cores processing packets
(even at low rate), getting all those output mixed with no context at
all would be hard to follow.
I would prefer we retain the information of whether the displayed
packet was caught on Rx/Tx and the queue and port on which it
happened.

As an alternative, there is the possibility of only displaying
received or transmitted packets (if verbose is used as a bitmask with
0x1 and 0x2 controlling rx / tx filtering, and the new modes enhancing
output beauty).


-- 
David Marchand

Reply via email to