Skip to content

Commit b390134

Browse files
borkmannAlexei Starovoitov
authored andcommitted
bpf: prefix cbpf internal helpers with bpf_
No change in functionality, just remove the '__' prefix and replace it with a 'bpf_' prefix instead. We later on add a couple of more helpers for cBPF and keeping the scheme with '__' is suboptimal there. Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Alexei Starovoitov <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 08dbc7a commit b390134

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

net/core/filter.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap)
113113
}
114114
EXPORT_SYMBOL(sk_filter_trim_cap);
115115

116-
BPF_CALL_1(__skb_get_pay_offset, struct sk_buff *, skb)
116+
BPF_CALL_1(bpf_skb_get_pay_offset, struct sk_buff *, skb)
117117
{
118118
return skb_get_poff(skb);
119119
}
120120

121-
BPF_CALL_3(__skb_get_nlattr, struct sk_buff *, skb, u32, a, u32, x)
121+
BPF_CALL_3(bpf_skb_get_nlattr, struct sk_buff *, skb, u32, a, u32, x)
122122
{
123123
struct nlattr *nla;
124124

@@ -138,7 +138,7 @@ BPF_CALL_3(__skb_get_nlattr, struct sk_buff *, skb, u32, a, u32, x)
138138
return 0;
139139
}
140140

141-
BPF_CALL_3(__skb_get_nlattr_nest, struct sk_buff *, skb, u32, a, u32, x)
141+
BPF_CALL_3(bpf_skb_get_nlattr_nest, struct sk_buff *, skb, u32, a, u32, x)
142142
{
143143
struct nlattr *nla;
144144

@@ -162,13 +162,13 @@ BPF_CALL_3(__skb_get_nlattr_nest, struct sk_buff *, skb, u32, a, u32, x)
162162
return 0;
163163
}
164164

165-
BPF_CALL_0(__get_raw_cpu_id)
165+
BPF_CALL_0(bpf_get_raw_cpu_id)
166166
{
167167
return raw_smp_processor_id();
168168
}
169169

170170
static const struct bpf_func_proto bpf_get_raw_smp_processor_id_proto = {
171-
.func = __get_raw_cpu_id,
171+
.func = bpf_get_raw_cpu_id,
172172
.gpl_only = false,
173173
.ret_type = RET_INTEGER,
174174
};
@@ -318,16 +318,16 @@ static bool convert_bpf_extensions(struct sock_filter *fp,
318318
/* Emit call(arg1=CTX, arg2=A, arg3=X) */
319319
switch (fp->k) {
320320
case SKF_AD_OFF + SKF_AD_PAY_OFFSET:
321-
*insn = BPF_EMIT_CALL(__skb_get_pay_offset);
321+
*insn = BPF_EMIT_CALL(bpf_skb_get_pay_offset);
322322
break;
323323
case SKF_AD_OFF + SKF_AD_NLATTR:
324-
*insn = BPF_EMIT_CALL(__skb_get_nlattr);
324+
*insn = BPF_EMIT_CALL(bpf_skb_get_nlattr);
325325
break;
326326
case SKF_AD_OFF + SKF_AD_NLATTR_NEST:
327-
*insn = BPF_EMIT_CALL(__skb_get_nlattr_nest);
327+
*insn = BPF_EMIT_CALL(bpf_skb_get_nlattr_nest);
328328
break;
329329
case SKF_AD_OFF + SKF_AD_CPU:
330-
*insn = BPF_EMIT_CALL(__get_raw_cpu_id);
330+
*insn = BPF_EMIT_CALL(bpf_get_raw_cpu_id);
331331
break;
332332
case SKF_AD_OFF + SKF_AD_RANDOM:
333333
*insn = BPF_EMIT_CALL(bpf_user_rnd_u32);

0 commit comments

Comments
 (0)