Lines Matching refs:tcx
144 struct tcx_link *tcx = tcx_link(link); in tcx_link_prog_attach() local
145 bool created, ingress = tcx->location == BPF_TCX_INGRESS; in tcx_link_prog_attach()
147 struct net_device *dev = tcx->dev; in tcx_link_prog_attach()
171 struct tcx_link *tcx = tcx_link(link); in tcx_link_release() local
172 bool ingress = tcx->location == BPF_TCX_INGRESS; in tcx_link_release()
178 dev = tcx->dev; in tcx_link_release()
196 tcx->dev = NULL; in tcx_link_release()
206 struct tcx_link *tcx = tcx_link(link); in tcx_link_update() local
207 bool ingress = tcx->location == BPF_TCX_INGRESS; in tcx_link_update()
213 dev = tcx->dev; in tcx_link_update()
253 const struct tcx_link *tcx = tcx_link_const(link); in tcx_link_fdinfo() local
257 if (tcx->dev) in tcx_link_fdinfo()
258 ifindex = tcx->dev->ifindex; in tcx_link_fdinfo()
263 tcx->location, in tcx_link_fdinfo()
264 tcx->location == BPF_TCX_INGRESS ? "ingress" : "egress"); in tcx_link_fdinfo()
270 const struct tcx_link *tcx = tcx_link_const(link); in tcx_link_fill_info() local
274 if (tcx->dev) in tcx_link_fill_info()
275 ifindex = tcx->dev->ifindex; in tcx_link_fill_info()
278 info->tcx.ifindex = ifindex; in tcx_link_fill_info()
279 info->tcx.attach_type = tcx->location; in tcx_link_fill_info()
298 static int tcx_link_init(struct tcx_link *tcx, in tcx_link_init() argument
304 bpf_link_init(&tcx->link, BPF_LINK_TYPE_TCX, &tcx_link_lops, prog); in tcx_link_init()
305 tcx->location = attr->link_create.attach_type; in tcx_link_init()
306 tcx->dev = dev; in tcx_link_init()
307 return bpf_link_prime(&tcx->link, link_primer); in tcx_link_init()
315 struct tcx_link *tcx; in tcx_link_attach() local
324 tcx = kzalloc(sizeof(*tcx), GFP_USER); in tcx_link_attach()
325 if (!tcx) { in tcx_link_attach()
329 ret = tcx_link_init(tcx, &link_primer, attr, dev, prog); in tcx_link_attach()
331 kfree(tcx); in tcx_link_attach()
334 ret = tcx_link_prog_attach(&tcx->link, attr->link_create.flags, in tcx_link_attach()
335 attr->link_create.tcx.relative_fd, in tcx_link_attach()
336 attr->link_create.tcx.expected_revision); in tcx_link_attach()
338 tcx->dev = NULL; in tcx_link_attach()