File Index
Files and directories
Sign in
FILE

bpf_qdisc_common.h

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/bpf/progs/bpf_qdisc_common.h C
 1/* SPDX-License-Identifier: GPL-2.0 */
 2
 3#ifndef _BPF_QDISC_COMMON_H
 4#define _BPF_QDISC_COMMON_H
 5
 6#define NET_XMIT_SUCCESS        0x00
 7#define NET_XMIT_DROP           0x01    /* skb dropped                  */
 8#define NET_XMIT_CN             0x02    /* congestion notification      */
 9
10#define TC_PRIO_CONTROL  7
11#define TC_PRIO_MAX      15
12
13#define private(name) SEC(".data." #name) __hidden __attribute__((aligned(8)))
14
15struct bpf_sk_buff_ptr;
16
17static struct qdisc_skb_cb *qdisc_skb_cb(const struct sk_buff *skb)
18{
19	return (struct qdisc_skb_cb *)skb->cb;
20}
21
22static inline unsigned int qdisc_pkt_len(const struct sk_buff *skb)
23{
24	return qdisc_skb_cb(skb)->pkt_len;
25}
26
27#endif
~/ Read-only file preview.