Unverified Commit 9751672d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 69b51840 a0cd0689
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ struct mini_Qdisc;
struct tcx_entry {
	struct mini_Qdisc __rcu *miniq;
	struct bpf_mprog_bundle bundle;
	bool miniq_active;
	u32 miniq_active;
	struct rcu_head rcu;
};

@@ -129,11 +129,16 @@ static inline void tcx_skeys_dec(bool ingress)
	tcx_dec();
}

static inline void tcx_miniq_set_active(struct bpf_mprog_entry *entry,
					const bool active)
static inline void tcx_miniq_inc(struct bpf_mprog_entry *entry)
{
	ASSERT_RTNL();
	tcx_entry(entry)->miniq_active = active;
	tcx_entry(entry)->miniq_active++;
}

static inline void tcx_miniq_dec(struct bpf_mprog_entry *entry)
{
	ASSERT_RTNL();
	tcx_entry(entry)->miniq_active--;
}

static inline bool tcx_entry_is_active(struct bpf_mprog_entry *entry)
+6 −6
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ static int ingress_init(struct Qdisc *sch, struct nlattr *opt,
	entry = tcx_entry_fetch_or_create(dev, true, &created);
	if (!entry)
		return -ENOMEM;
	tcx_miniq_set_active(entry, true);
	tcx_miniq_inc(entry);
	mini_qdisc_pair_init(&q->miniqp, sch, &tcx_entry(entry)->miniq);
	if (created)
		tcx_entry_update(dev, entry, true);
@@ -121,7 +121,7 @@ static void ingress_destroy(struct Qdisc *sch)
	tcf_block_put_ext(q->block, sch, &q->block_info);

	if (entry) {
		tcx_miniq_set_active(entry, false);
		tcx_miniq_dec(entry);
		if (!tcx_entry_is_active(entry)) {
			tcx_entry_update(dev, NULL, true);
			tcx_entry_free(entry);
@@ -256,7 +256,7 @@ static int clsact_init(struct Qdisc *sch, struct nlattr *opt,
	entry = tcx_entry_fetch_or_create(dev, true, &created);
	if (!entry)
		return -ENOMEM;
	tcx_miniq_set_active(entry, true);
	tcx_miniq_inc(entry);
	mini_qdisc_pair_init(&q->miniqp_ingress, sch, &tcx_entry(entry)->miniq);
	if (created)
		tcx_entry_update(dev, entry, true);
@@ -275,7 +275,7 @@ static int clsact_init(struct Qdisc *sch, struct nlattr *opt,
	entry = tcx_entry_fetch_or_create(dev, false, &created);
	if (!entry)
		return -ENOMEM;
	tcx_miniq_set_active(entry, true);
	tcx_miniq_inc(entry);
	mini_qdisc_pair_init(&q->miniqp_egress, sch, &tcx_entry(entry)->miniq);
	if (created)
		tcx_entry_update(dev, entry, false);
@@ -301,7 +301,7 @@ static void clsact_destroy(struct Qdisc *sch)
	tcf_block_put_ext(q->egress_block, sch, &q->egress_block_info);

	if (ingress_entry) {
		tcx_miniq_set_active(ingress_entry, false);
		tcx_miniq_dec(ingress_entry);
		if (!tcx_entry_is_active(ingress_entry)) {
			tcx_entry_update(dev, NULL, true);
			tcx_entry_free(ingress_entry);
@@ -309,7 +309,7 @@ static void clsact_destroy(struct Qdisc *sch)
	}

	if (egress_entry) {
		tcx_miniq_set_active(egress_entry, false);
		tcx_miniq_dec(egress_entry);
		if (!tcx_entry_is_active(egress_entry)) {
			tcx_entry_update(dev, NULL, false);
			tcx_entry_free(egress_entry);