Fix and improve VLAN/MPLS parsing in rte_net_get_ptype
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest5 patches 12 repliesIn review
- v41 patch 7 repliesSuperseded
- v31 patch 4 repliesSuperseded
Changes in v5 from the cover letter
* Split the series in multiple patches.
* Revert the commit that introduced the bug.
* Add support for stacked VLAN/QINQ as suggested by David.
* Fix MPLS bottom of stack detection. Try to guess MPLS payload.
* Add more test cases.
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | Revert "net: fix packet type for stacked VLAN"lib/ | +15 | 2 replies | |
| 2/5 | net: support multiple stacked VLAN tagslib/ | +16 | 7 replies | |
| 3/5 | net: add unit tests for rte_net_get_ptypeapp/ app/ | +232 | 0 replies | |
| 4/5 | net: parse L3 protocol after MPLS labelsapp/ lib/ | +81 | 2 replies | |
| 5/5 | net: add truncated packet tests for rte_net_get_ptypeapp/ | +38 | 0 replies |
Reviews trailers per patch
1 of 5 patches has a Reviewed-by or Acked-by.
| Patch | David Marchand | Kevin Traynor |
|---|---|---|
| 1/5 | A-b | A-b |
| 2/5 | ||
| 3/5 | ||
| 4/5 | ||
| 5/5 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH dpdk v5 0/5] Fix and improve VLAN/MPLS parsing in rte_net_get_ptype
Revert commit 1f250674085a ("net: fix packet type for stacked VLAN") which introduced a regression causing single VLAN frames to be misidentified as QinQ due to incorrect use of |= on the ptype.
Replace the separate VLAN and QinQ code paths with a single loop that handles arbitrarily stacked VLAN tags. Fix the MPLS path to use the bottom of stack bit instead of a hardcoded label limit, and parse the L3 protocol of the MPLS payload by inspecting the first nibble.
Add unit tests for rte_net_get_ptype covering Ethernet, VLAN, QinQ, MPLS, IPv4/IPv6, and truncated packet scenarios.
v5:
* Split the series in multiple patches.
* Revert the commit that introduced the bug.
* Add support for stacked VLAN/QINQ as suggested by David.
* Fix MPLS bottom of stack detection. Try to guess MPLS payload.
* Add more test cases.
v4:
* changed the approach again. Only set VLAN or QINQ ptype for the first encountered vlan/qinq ether type.
* unit tests not changed
v3:
* changed the approach: initialize pkt_type=0 and only set it to RTE_PTYPE_L2_ETHER if neither of VLAN nor QINQ matched.
* extended the unit tests to check for header lengths and added ipv6 / tcp cases.
v2: added new ptype tests
v3:
* changed the approach: initialize pkt_type=0 and only set it to RTE_PTYPE_L2_ETHER if neither of VLAN nor QINQ matched.
* extended the unit tests to check for header lengths and added ipv6 / tcp cases.
v2: added new ptype tests
Robin Jarry (5):
Revert "net: fix packet type for stacked VLAN"
net: support multiple stacked VLAN tags
net: add unit tests for rte_net_get_ptype
net: parse L3 protocol after MPLS labels
net: add truncated packet tests for rte_net_get_ptype
app/test/meson.build | 1 + app/test/test_net_ptype.c | 326 ++++++++++++++++++++++++++++++++++++++ lib/net/rte_net.c | 72 +++++---- 3 files changed, 369 insertions(+), 30 deletions(-) create mode 100644 app/test/test_net_ptype.c
Signature · 1 line
2.54.0