bpf/progs/offload.c: disable ipv6 offload for non-gso >pmtu
Bug: 263884894 Bug: 419747540 Test: TreeHugger Flag: EXEMPT mainline Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Idecc355084220ea5c53924c720c806adab153b5d
This commit is contained in:
parent
c9c16fc884
commit
5d79fdffd3
2 changed files with 4 additions and 0 deletions
|
|
@ -178,6 +178,9 @@ static inline __always_inline int do_forward6(struct __sk_buff* skb,
|
|||
uint64_t packets = 1;
|
||||
uint64_t L3_bytes = skb->len - l2_header_size;
|
||||
if (L3_bytes > v->pmtu) {
|
||||
if (KVER_IS_AT_LEAST(kver, 5, 4, 0)) {
|
||||
if (skb->gso_segs <= 1) TC_PUNT(ABOVE_IPV6_PMTU);
|
||||
}
|
||||
const int tcp6_overhead = sizeof(struct ipv6hdr) + sizeof(struct tcphdr) + 12;
|
||||
const int mss = v->pmtu - tcp6_overhead;
|
||||
const uint64_t payload = L3_bytes - tcp6_overhead;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
ERR(BELOW_IPV4_MTU) \
|
||||
ERR(ABOVE_IPV4_PMTU) \
|
||||
ERR(BELOW_IPV6_MTU) \
|
||||
ERR(ABOVE_IPV6_PMTU) \
|
||||
ERR(LIMIT_REACHED) \
|
||||
ERR(CHANGE_HEAD_FAILED) \
|
||||
ERR(TOO_SHORT) \
|
||||
|
|
|
|||
Loading…
Reference in a new issue