| @@ -4573,7 +4573,7 @@ union bpf_attr { · 4572 unmodified lines |
| 4573 | 4573 | * |
| 4574 | 4574 | * long bpf_check_mtu(void *ctx, u32 ifindex, u32 *mtu_len, s32 len_diff, u64 flags) |
| 4575 | 4575 | * Description |
| 4576 | | − * Check ctx packet size against exceeding MTU of net device (based |
| 4576 | + * Check packet size against exceeding MTU of net device (based |
| 4577 | 4577 | * on *ifindex*). This helper will likely be used in combination |
| 4578 | 4578 | * with helpers that adjust/change the packet size. |
| 4579 | 4579 | * |
| @@ -4590,6 +4590,14 @@ union bpf_attr { · 10 unmodified lines |
| 4590 | 4590 | * against the current net device. This is practical if this isn't |
| 4591 | 4591 | * used prior to redirect. |
| 4592 | 4592 | * |
| 4593 | + * On input *mtu_len* must be a valid pointer, else verifier will |
| 4594 | + * reject BPF program. If the value *mtu_len* is initialized to |
| 4595 | + * zero then the ctx packet size is use. When value *mtu_len* is |
| 4596 | + * provided as input this specify the L3 length that the MTU check |
| 4597 | + * is done against. Remember XDP and TC length operate at L2, but |
| 4598 | + * this value is L3 as this correlate to MTU and IP-header tot_len |
| 4599 | + * values which are L3 (similar behavior as bpf_fib_lookup). |
| 4600 | + * |
| 4593 | 4601 | * The Linux kernel route table can configure MTUs on a more |
| 4594 | 4602 | * specific per route level, which is not provided by this helper. |
| 4595 | 4603 | * For route level MTU checks use the **bpf_fib_lookup**\ () |
| @@ -4614,11 +4622,9 @@ union bpf_attr { · 18 unmodified lines |
| 4614 | 4622 | * |
| 4615 | 4623 | * On return *mtu_len* pointer contains the MTU value of the net |
| 4616 | 4624 | * device. Remember the net device configured MTU is the L3 size, |
| 4617 | | − * which is returned here and XDP and TX length operate at L2. |
| 4625 | + * which is returned here and XDP and TC length operate at L2. |
| 4618 | 4626 | * Helper take this into account for you, but remember when using |
| 4619 | | − * MTU value in your BPF-code. On input *mtu_len* must be a valid |
| 4620 | | − * pointer and be initialized (to zero), else verifier will reject |
| 4621 | | − * BPF program. |
| 4627 | + * MTU value in your BPF-code. |
| 4622 | 4628 | * |
| 4623 | 4629 | * Return |
| 4624 | 4630 | * * 0 on success, and populate MTU value in *mtu_len* pointer. |