On Mon, 18 May 2026 15:27:18 +0200 Robin Jarry <[email protected]> wrote:
> rte_net_get_ptype stops at the MPLS layer and never identifies the L3 > protocol of the payload. Also, the label parsing uses a fixed maximum of > 5 headers instead of checking the bottom of stack bit. > > Use the bottom of stack bit to consume all labels and inspect the first > nibble of the payload to determine if it is IPv4 or IPv6. > > Add test cases to verify this works. Ensure that an unknown protocol > after MPLS (e.g. ARP) does not produce a bogus L3 type. > > Signed-off-by: Robin Jarry <[email protected]> > --- Re: [PATCH dpdk v5 4/5] net: parse L3 protocol after MPLS labels Info: The local variable name `nimble` (and its companion `nimble_copy`) appears to be a typo for `nibble`. A nibble is the standard term for 4 bits, which is what the code reads and masks against `0xf0`. The commit message itself uses the correct spelling ("inspect the first nibble of the payload"), so only the code is affected. const uint8_t *nimble; uint8_t nimble_copy; ... nimble = rte_pktmbuf_read(m, off, sizeof(*nimble), &nimble_copy); if (nimble == NULL) return pkt_type; switch (*nimble & 0xf0) { Suggest renaming to `nibble`/`nibble_copy` for clarity.

