Skip to content

tunnels: add core and gre drop reasons

Anton Danilov lkml netdev 8 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest8 patches 0 repliesNew
  2. v78 patches 1 replySuperseded
  3. v68 patches 2 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v514 patches6 repliesSuperseded
v410 patches8 repliesSuperseded
v39 patches2 repliesSuperseded
v28 patches0 repliesSuperseded
v111 patches8 repliesSuperseded

Changes in v8 from the cover letter

- Rebase onto net-next eb6d6c80d354.
- Group the four new drop reasons with the existing tunnel reasons, immediately after TUNNEL_NOT_FOUND, as requested by Jakub.

- v7: https://lore.kernel.org/netdev/[email protected]/

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8ip_tunnel: add drop reasons to the generic RX pathinclude/net/dropreason-core.h net/ipv4/ip_tunnel.c+32 -40 replies
2/8ip6_tunnel: add drop reasons to the receive pathnet/ipv6/ip6_tunnel.c+33 -120 replies
3/8gre: make gre_parse_header() report a drop reasoninclude/net/dropreason-core.h include/net/gre.h net/ipv4/gre_demux.c +2 more+74 -410 replies
4/8ip_gre: add drop reasons to the RX pathinclude/net/dropreason-core.h net/ipv4/ip_gre.c+48 -380 replies
5/8ip6_gre: add drop reasons to the RX pathinclude/net/ip_tunnels.h net/ipv6/ip6_gre.c+30 -290 replies
6/8ip_tunnel: make ip_tunnel_encap() return a drop reasoninclude/net/dropreason-core.h include/net/ip_tunnels.h net/ipv4/ip_tunnel.c +1 more+20 -90 replies
7/8ip_tunnel: add drop reasons to the transmit pathnet/ipv4/ip_tunnel.c+30 -120 replies
8/8ip_gre: add drop reasons to the transmit pathnet/ipv4/ip_gre.c+74 -270 replies

Reviews trailers per patch

6 of 8 patches have a Reviewed-by or Acked-by.

PatchIdo Schimmel
1/8R-b
2/8R-b
3/8R-b
4/8
5/8
6/8R-b
7/8R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v8 thread

Cover letter [PATCH net-next v8 0/8] tunnels: add core and gre drop reasons

Several tunnel receive and transmit paths free packets from unrelated checks at a common drop site. For example, a missing GRE sequence number and an old sequence number both increment rx_fifo_errors. Reporting a reason through skb:kfree_skb and drop_monitor lets an operator distinguish a tunnel configuration mismatch from a reordered packet or a peer that restarted its sequence numbering.

Patches 1-5 cover the shared IPv4 and IPv6 tunnel receive paths and the GRE and ip6tnl receive handlers. Patches 6-8 cover IPv4 tunnel and GRE transmit, including FOU and GUE encapsulation failures. The IPv6 transmit path will follow separately.

The series adds four reasons: TUNNEL_OPT_MISMATCH, TUNNEL_OLD_SEQ, GRE_CSUM and TUNNEL_ENCAP. It reuses existing reasons for tunnel lookup, header validation, PMTU and allocation failures. The device error counters keep their existing meanings.

I used Claude Code and Codex to help develop, test and review the series and edit the patch descriptions. Testing included virtme-ng and a local run of the Sashiko review prompts. I take responsibility for the changes.

Changes since v7:
- Rebase onto net-next eb6d6c80d354.
- Group the four new drop reasons with the existing tunnel reasons, immediately after TUNNEL_NOT_FOUND, as requested by Jakub.

- v7: https://lore.kernel.org/netdev/[email protected]/

Changes since v6:
- Rebase onto net-next a0aa9ceca03f as requested by Jakub.
- In patches 4 and 5, report TUNNEL_INVALID_HDR for the ERSPAN checks added by 7ccc5e05043b ("erspan: drop packets with an unknown ERSPAN version"), including the type I check on IPv6.
- Carry Ido's Reviewed-by on patches 1-3 and 6-8. Leave it off 4 and 5 for review of the new drop reasons. Shorten the patch descriptions.

- v6: https://lore.kernel.org/netdev/[email protected]/

Changes since v5:
- Split out the vxlan patches (now in net-next) and defer IPv6 TX.
- Set a reason on each path to a drop label. Keep NOT_SPECIFIED for looped-back multicast and ip6_tnl_rcv_ctl() failures.
- Add patch 6 to distinguish allocation failures in ip_tunnel_encap(). Its IPv6 counterpart will follow with ip6_tnl_xmit().
- Mention reordering in the TUNNEL_OLD_SEQ description. The vxlan series already updated the RECURSION_LIMIT description.
- Describe AI assistance in the cover letter after 1e035297ffda ("docs: remove Assisted-by references").

- v5: https://lore.kernel.org/netdev/[email protected]/
- vxlan part of v5: https://lore.kernel.org/netdev/[email protected]/
- v4: https://lore.kernel.org/netdev/[email protected]/
- v3: https://lore.kernel.org/netdev/[email protected]/
- v2: https://lore.kernel.org/netdev/[email protected]/
- v1: https://lore.kernel.org/netdev/[email protected]/

Anton Danilov (8):
ip_tunnel: add drop reasons to the generic RX path
ip6_tunnel: add drop reasons to the receive path
gre: make gre_parse_header() report a drop reason
ip_gre: add drop reasons to the RX path
ip6_gre: add drop reasons to the RX path
ip_tunnel: make ip_tunnel_encap() return a drop reason
ip_tunnel: add drop reasons to the transmit path
ip_gre: add drop reasons to the transmit path

 include/net/dropreason-core.h |  31 +++++-
 include/net/gre.h             |   5 +-
 include/net/ip_tunnels.h      |  20 ++--
 net/ipv4/gre_demux.c          |  64 +++++++----
 net/ipv4/ip_gre.c             | 199 ++++++++++++++++++++++------------
 net/ipv4/ip_tunnel.c          |  61 ++++++++---
 net/ipv6/ip6_gre.c            |  66 ++++++-----
 net/ipv6/ip6_tunnel.c         |  45 ++++++--
 net/ipv6/sit.c                |   2 +-
 9 files changed, 331 insertions(+), 162 deletions(-)

base-commit: eb6d6c80d35449c27471b1874f13066c09a8964d

Signature · 1 line
2.47.3