Re: [PATCH net-next v6 3/4] selftests: net: test SO_PRIORITY ancillary data with cmsg_sender
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2024-12-11 00:56:47
Anna Emese Nyiri wrote:
Extend cmsg_sender.c with a new option '-Q' to send SO_PRIORITY ancillary data. cmsg_so_priority.sh script added to validate SO_PRIORITY behavior by creating VLAN device with egress QoS mapping and testing packet priorities using flower filters. Verify that packets with different priorities are correctly matched and counted by filters for multiple protocols and IP versions. Suggested-by: Ido Schimmel <redacted> Signed-off-by: Anna Emese Nyiri <redacted>
Reviewed-by: Willem de Bruijn <willemb@google.com>
+ ip netns exec $NS ./cmsg_sender -$i -Q $priority -d "${DELAY}" \
+ -p $proto $TGT $PORT
+
+ pkts=$(tc -n $NS -j -s filter show dev dummy1 egress \
+ | jq ".[] | select(.options.handle == ${handle}) | \
+ .options.actions[0].stats.packets")
+ if [[ $pkts == 1 ]]; then
+ check_result 0
+ else
+ echo "prio $priority -Q: expected 1, got $pkts"
+ check_result 1
+ fi
+
+ ip netns exec $NS ./cmsg_sender -$i -P $priority -d "${DELAY}" \
+ -p $proto $TGT $PORTnit: delay is not used here. Neither txtime nor ts is set (and only one packet is sent). It's harmless. No need to respin just for this.