mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

Some cleanups: - Remove unnecessary kfuncs declaration - Use _ns in the test name to run tests in a separate net namespace - Call skeleton __attach() instead of bpf_map__attach_struct_ops() to simplify tests. Signed-off-by: Amery Hung <ameryhung@gmail.com> Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
27 lines
675 B
C
27 lines
675 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef _BPF_QDISC_COMMON_H
|
|
#define _BPF_QDISC_COMMON_H
|
|
|
|
#define NET_XMIT_SUCCESS 0x00
|
|
#define NET_XMIT_DROP 0x01 /* skb dropped */
|
|
#define NET_XMIT_CN 0x02 /* congestion notification */
|
|
|
|
#define TC_PRIO_CONTROL 7
|
|
#define TC_PRIO_MAX 15
|
|
|
|
#define private(name) SEC(".data." #name) __hidden __attribute__((aligned(8)))
|
|
|
|
struct bpf_sk_buff_ptr;
|
|
|
|
static struct qdisc_skb_cb *qdisc_skb_cb(const struct sk_buff *skb)
|
|
{
|
|
return (struct qdisc_skb_cb *)skb->cb;
|
|
}
|
|
|
|
static inline unsigned int qdisc_pkt_len(const struct sk_buff *skb)
|
|
{
|
|
return qdisc_skb_cb(skb)->pkt_len;
|
|
}
|
|
|
|
#endif
|