@@ -142,7 +142,7 @@ static int tcx_link_prog_attach(struct bpf_link *link, u32 flags, u32 id_or_fd,
142142 u64 revision )
143143{
144144 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 ;
146146 struct bpf_mprog_entry * entry , * entry_new ;
147147 struct net_device * dev = tcx -> dev ;
148148 int ret ;
@@ -169,7 +169,7 @@ static int tcx_link_prog_attach(struct bpf_link *link, u32 flags, u32 id_or_fd,
169169static void tcx_link_release (struct bpf_link * link )
170170{
171171 struct tcx_link * tcx = tcx_link (link );
172- bool ingress = tcx -> location == BPF_TCX_INGRESS ;
172+ bool ingress = link -> attach_type == BPF_TCX_INGRESS ;
173173 struct bpf_mprog_entry * entry , * entry_new ;
174174 struct net_device * dev ;
175175 int ret = 0 ;
@@ -204,7 +204,7 @@ static int tcx_link_update(struct bpf_link *link, struct bpf_prog *nprog,
204204 struct bpf_prog * oprog )
205205{
206206 struct tcx_link * tcx = tcx_link (link );
207- bool ingress = tcx -> location == BPF_TCX_INGRESS ;
207+ bool ingress = link -> attach_type == BPF_TCX_INGRESS ;
208208 struct bpf_mprog_entry * entry , * entry_new ;
209209 struct net_device * dev ;
210210 int ret = 0 ;
@@ -260,8 +260,8 @@ static void tcx_link_fdinfo(const struct bpf_link *link, struct seq_file *seq)
260260
261261 seq_printf (seq , "ifindex:\t%u\n" , ifindex );
262262 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" );
265265}
266266
267267static 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,
276276 rtnl_unlock ();
277277
278278 info -> tcx .ifindex = ifindex ;
279- info -> tcx .attach_type = tcx -> location ;
279+ info -> tcx .attach_type = link -> attach_type ;
280280 return 0 ;
281281}
282282
@@ -303,7 +303,6 @@ static int tcx_link_init(struct tcx_link *tcx,
303303{
304304 bpf_link_init (& tcx -> link , BPF_LINK_TYPE_TCX , & tcx_link_lops , prog ,
305305 attr -> link_create .attach_type );
306- tcx -> location = attr -> link_create .attach_type ;
307306 tcx -> dev = dev ;
308307 return bpf_link_prime (& tcx -> link , link_primer );
309308}
0 commit comments