@@ -142,7 +142,7 @@ static int tcx_link_prog_attach(struct bpf_link *link, u32 flags, u32 id_or_fd,
142
142
u64 revision )
143
143
{
144
144
struct tcx_link * tcx = tcx_link (link );
145
- bool created , ingress = tcx -> location == BPF_TCX_INGRESS ;
145
+ bool created , ingress = link -> attach_type == BPF_TCX_INGRESS ;
146
146
struct bpf_mprog_entry * entry , * entry_new ;
147
147
struct net_device * dev = tcx -> dev ;
148
148
int ret ;
@@ -169,7 +169,7 @@ static int tcx_link_prog_attach(struct bpf_link *link, u32 flags, u32 id_or_fd,
169
169
static void tcx_link_release (struct bpf_link * link )
170
170
{
171
171
struct tcx_link * tcx = tcx_link (link );
172
- bool ingress = tcx -> location == BPF_TCX_INGRESS ;
172
+ bool ingress = link -> attach_type == BPF_TCX_INGRESS ;
173
173
struct bpf_mprog_entry * entry , * entry_new ;
174
174
struct net_device * dev ;
175
175
int ret = 0 ;
@@ -204,7 +204,7 @@ static int tcx_link_update(struct bpf_link *link, struct bpf_prog *nprog,
204
204
struct bpf_prog * oprog )
205
205
{
206
206
struct tcx_link * tcx = tcx_link (link );
207
- bool ingress = tcx -> location == BPF_TCX_INGRESS ;
207
+ bool ingress = link -> attach_type == BPF_TCX_INGRESS ;
208
208
struct bpf_mprog_entry * entry , * entry_new ;
209
209
struct net_device * dev ;
210
210
int ret = 0 ;
@@ -260,8 +260,8 @@ static void tcx_link_fdinfo(const struct bpf_link *link, struct seq_file *seq)
260
260
261
261
seq_printf (seq , "ifindex:\t%u\n" , ifindex );
262
262
seq_printf (seq , "attach_type:\t%u (%s)\n" ,
263
- tcx -> location ,
264
- tcx -> location == BPF_TCX_INGRESS ? "ingress" : "egress" );
263
+ link -> attach_type ,
264
+ link -> attach_type == BPF_TCX_INGRESS ? "ingress" : "egress" );
265
265
}
266
266
267
267
static int tcx_link_fill_info (const struct bpf_link * link ,
@@ -276,7 +276,7 @@ static int tcx_link_fill_info(const struct bpf_link *link,
276
276
rtnl_unlock ();
277
277
278
278
info -> tcx .ifindex = ifindex ;
279
- info -> tcx .attach_type = tcx -> location ;
279
+ info -> tcx .attach_type = link -> attach_type ;
280
280
return 0 ;
281
281
}
282
282
@@ -303,7 +303,6 @@ static int tcx_link_init(struct tcx_link *tcx,
303
303
{
304
304
bpf_link_init (& tcx -> link , BPF_LINK_TYPE_TCX , & tcx_link_lops , prog ,
305
305
attr -> link_create .attach_type );
306
- tcx -> location = attr -> link_create .attach_type ;
307
306
tcx -> dev = dev ;
308
307
return bpf_link_prime (& tcx -> link , link_primer );
309
308
}
0 commit comments