netd.c - nettrace - add 'wakeup' boolean

This is based on network driver populated skb->mark magic bit.
This is the bit used by netd's WakeupController.

We mandated the location of this bit in U, though we haven't
(yet??) mandated it being supported by all network drivers.

If the driver doesn't support it, it could always
be false (skb->mark should default to 0),
or potentially (this is very very unlikely) be garbage.

IFIRC nettrace isn't enabled on pre-U devices anyway.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2b3b91315d77c08c022396253b26954593dd3f5a
This commit is contained in:
Maciej Żenczykowski 2023-09-13 21:59:46 +00:00
commit b9cf34715c
2 changed files with 3 additions and 1 deletions

View file

@ -319,6 +319,7 @@ static __always_inline inline void do_packet_tracing(
pkt->dport = dport;
pkt->egress = egress;
pkt->wakeup = !egress && (skb->mark & 0x80000000); // Fwmark.ingress_cpu_wakeup
pkt->ipProto = proto;
pkt->tcpFlags = flags;
pkt->ipVersion = ipVersion;

View file

@ -81,7 +81,8 @@ typedef struct {
__be16 sport;
__be16 dport;
bool egress;
bool egress:1,
wakeup:1;
uint8_t ipProto;
uint8_t tcpFlags;
uint8_t ipVersion; // 4=IPv4, 6=IPv6, 0=unknown