Unverified Commit 6359f4f7 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!1535 net/sched: sch_qfq: account for stab overhead in qfq_enqueue

parents 6b33e607 6d004dad
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@

#define QFQ_MTU_SHIFT		16	/* to support TSO/GSO */
#define QFQ_MIN_LMAX		512	/* see qfq_slot_insert */
#define QFQ_MAX_LMAX		(1UL << QFQ_MTU_SHIFT)

#define QFQ_MAX_AGG_CLASSES	8 /* max num classes per aggregate allowed */

@@ -375,8 +376,13 @@ static int qfq_change_agg(struct Qdisc *sch, struct qfq_class *cl, u32 weight,
			   u32 lmax)
{
	struct qfq_sched *q = qdisc_priv(sch);
	struct qfq_aggregate *new_agg = qfq_find_agg(q, lmax, weight);
	struct qfq_aggregate *new_agg;

	/* 'lmax' can range from [QFQ_MIN_LMAX, pktlen + stab overhead] */
	if (lmax > QFQ_MAX_LMAX)
		return -EINVAL;

	new_agg = qfq_find_agg(q, lmax, weight);
	if (new_agg == NULL) { /* create new aggregate */
		new_agg = kzalloc(sizeof(*new_agg), GFP_ATOMIC);
		if (new_agg == NULL)