From c45bdfddfa9beb8fffef9fbd2fdd2d443b009ff3 Mon Sep 17 00:00:00 2001 From: Jesper Dangaard Brouer Date: Mon, 31 Jan 2022 18:25:32 +0100 Subject: [PATCH] tc-policy: No need to call bpf_tc_query after bpf_tc_attach The attach_egress.prog_id have already been provided after calling bpf_tc_attach. Signed-off-by: Jesper Dangaard Brouer --- tc-policy/tc_txq_policy.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tc-policy/tc_txq_policy.c b/tc-policy/tc_txq_policy.c index 95a1f7b..efd1ddc 100644 --- a/tc-policy/tc_txq_policy.c +++ b/tc-policy/tc_txq_policy.c @@ -241,19 +241,6 @@ int tc_attach_egress(struct user_config *cfg, struct tc_txq_policy_kern *obj) goto out; } - /* Let check BPF prog got attached */ - attach_egress.flags = 0; - attach_egress.prog_fd = 0; - attach_egress.prog_id = 0; - attach_egress.handle = EGRESS_HANDLE; - attach_egress.priority = EGRESS_PRIORITY; - err = bpf_tc_query(&hook, &attach_egress); - if (err) { - fprintf(stderr, "No egress program is attached " - "for ifindex %d (err:%d)\n", cfg->ifindex, err); - goto out; - } - if (verbose) { printf("Attached TC-BPF program id:%d\n", attach_egress.prog_id);