Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

srv6: Fix packet drop with GSO type mismatch #30732

Merged
merged 1 commit into from Feb 15, 2024

Conversation

YutaroHayakawa
Copy link
Member

@YutaroHayakawa YutaroHayakawa commented Feb 13, 2024

When the Pod generates a TCP stream larger than MSS, it may be sent as a GSO large packet. We observed in such a case, SRv6-encapsulated packet is dropped.

The root cause was a misuse of ctx_adjust_hroom. We call it ctx_adjust_hroom(ctx, growth, BPF_ADJ_ROOM_MAC, 0), but this way, the helper is not aware of what kind of encapsulation we want to perform, so it doesn't adjust skb->inner_protocol (should be ETH_P_IP) and skb_shinfo->gso_type (should be SKB_GSO_IPXIP6 | SKB_GSO_TCPV4) appropriately. As a result, the packet will be dropped in ip4ip6_gso_segment due to the flag mismatch.

Use BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 flag which is introduced to solve this problem.

srv6: Fix packet drop with GSO type mismatch

When the Pod generates a TCP stream larger than MSS, it may be sent as a
GSO large packet. We observed in such a case, SRv6-encapsulated packet
is dropped.

The root cause was a misuse of ctx_adjust_hroom. We call it
ctx_adjust_hroom(ctx, growth, BPF_ADJ_ROOM_MAC, 0), but this way, the
helper is not aware of what kind of encapsulation we want to perform, so
it doesn't adjust skb->inner_protocol (should be ETH_P_IP) and
skb_shinfo->gso_type (should be SKB_GSO_IPXIP6 | SKB_GSO_TCPV4)
appropriately. As a result, the packet will be dropped in
ip4ip6_gso_segment due to the flag mismatch.

Use BPF_F_ADJ_ROOM_ENCAP_L3_IPV6 flag which is introduced to solve this
problem.

Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Feb 13, 2024
@YutaroHayakawa YutaroHayakawa added release-note/bug This PR fixes an issue in a previous release of Cilium. release-note/misc This PR makes changes that have no direct user impact. needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Feb 13, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Feb 13, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.15.1 Feb 13, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from main in 1.14.7 Feb 13, 2024
@YutaroHayakawa YutaroHayakawa added the backport/author The backport will be carried out by the author of the PR. label Feb 13, 2024
@YutaroHayakawa YutaroHayakawa marked this pull request as ready for review February 13, 2024 07:34
@YutaroHayakawa YutaroHayakawa requested a review from a team as a code owner February 13, 2024 07:34
@YutaroHayakawa
Copy link
Member Author

/test

@michi-covalent michi-covalent added this to Needs backport from main in 1.15.2 Feb 14, 2024
@michi-covalent michi-covalent removed this from Needs backport from main in 1.15.1 Feb 14, 2024
@YutaroHayakawa YutaroHayakawa removed the release-note/misc This PR makes changes that have no direct user impact. label Feb 15, 2024
@YutaroHayakawa
Copy link
Member Author

YutaroHayakawa commented Feb 15, 2024

Cilium Cluster Mesh upgrade: #28088
Conformance Ginkgo: Failing to fetch JUnit (cp: cannot stat '*.xml': No such file or directory).
Travis: Seems like a bgpv2 flake. Filed new issues #30786 , #30787

Copy link
Contributor

@ldelossa ldelossa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Feb 15, 2024
@ldelossa ldelossa added this pull request to the merge queue Feb 15, 2024
Merged via the queue into cilium:main with commit 12e3ae9 Feb 15, 2024
63 checks passed
@YutaroHayakawa YutaroHayakawa removed the backport/author The backport will be carried out by the author of the PR. label Feb 15, 2024
@sayboras sayboras mentioned this pull request Feb 16, 2024
1 task
@sayboras sayboras added backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. and removed needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Feb 16, 2024
@sayboras sayboras mentioned this pull request Feb 16, 2024
3 tasks
@sayboras sayboras added backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. and removed needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch labels Feb 16, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from main to Backport pending to v1.14 in 1.14.7 Feb 16, 2024
@github-actions github-actions bot added backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. and removed backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. labels Feb 16, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot removed this from Backport pending to v1.14 in 1.14.7 Feb 16, 2024
@github-actions github-actions bot added backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. and removed backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. labels Feb 16, 2024
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Backport done to v1.14 in 1.14.7 Feb 16, 2024
@tklauser tklauser moved this from Needs backport from main to Backport done to v1.15 in 1.15.2 Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
No open projects
1.14.7
Backport done to v1.14
1.15.2
Backport done to v1.15
Development

Successfully merging this pull request may close these issues.

None yet

5 participants