tools/testing/selftests/bpf/progs/test_xdp_adjust_tail_shrink.c

Source file repositories/reference/linux-study-clean/tools/testing/selftests/bpf/progs/test_xdp_adjust_tail_shrink.c

File Facts

System
Linux kernel
Corpus path
tools/testing/selftests/bpf/progs/test_xdp_adjust_tail_shrink.c
Extension
.c
Size
1058 bytes
Lines
53
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

switch (data[0]) {
		case 0:
			offset = 10;
			break;
		case 1:
			offset = 4100;
			break;
		case 2:
			offset = 8200;
			break;
		default:
			return XDP_DROP;
		}
		break;
	default:
		offset = 20;
		break;
	}
	if (bpf_xdp_adjust_tail(xdp, 0 - offset))
		return XDP_DROP;
	return XDP_TX;
}

char _license[] SEC("license") = "GPL";

Annotation

Implementation Notes