Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c27f339a authored by Jarek Poplawski's avatar Jarek Poplawski Committed by David S. Miller
Browse files

net_sched: Add qdisc __NET_XMIT_BYPASS flag



Patrick McHardy <kaber@trash.net> noticed that it would be nice to
handle NET_XMIT_BYPASS by NET_XMIT_SUCCESS with an internal qdisc flag
__NET_XMIT_BYPASS and to remove the mapping from dev_queue_xmit().

David Miller <davem@davemloft.net> spotted a serious bug in the first
version of this patch.

Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 378a2f09
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -343,14 +343,14 @@ static inline unsigned int qdisc_pkt_len(struct sk_buff *skb)
	return qdisc_skb_cb(skb)->pkt_len;
}

#ifdef CONFIG_NET_CLS_ACT
/* additional qdisc xmit flags */
/* additional qdisc xmit flags (NET_XMIT_MASK in linux/netdevice.h) */
enum net_xmit_qdisc_t {
	__NET_XMIT_STOLEN = 0x00010000,
	__NET_XMIT_BYPASS = 0x00020000,
};

#ifdef CONFIG_NET_CLS_ACT
#define net_xmit_drop_count(e)	((e) & __NET_XMIT_STOLEN ? 0 : 1)

#else
#define net_xmit_drop_count(e)	(1)
#endif
+0 −1
Original line number Diff line number Diff line
@@ -1805,7 +1805,6 @@ int dev_queue_xmit(struct sk_buff *skb)

		spin_unlock(root_lock);

		rc = rc == NET_XMIT_BYPASS ? NET_XMIT_SUCCESS : rc;
		goto out;
	}

+1 −1
Original line number Diff line number Diff line
@@ -457,7 +457,7 @@ drop: __maybe_unused
		return 0;
	}
	tasklet_schedule(&p->task);
	return NET_XMIT_BYPASS;
	return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
}

/*
+2 −2
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ cbq_classify(struct sk_buff *skb, struct Qdisc *sch, int *qerr)
	    (cl = cbq_class_lookup(q, prio)) != NULL)
		return cl;

	*qerr = NET_XMIT_BYPASS;
	*qerr = NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
	for (;;) {
		int result = 0;
		defmap = head->defaults;
@@ -377,7 +377,7 @@ cbq_enqueue(struct sk_buff *skb, struct Qdisc *sch)
	q->rx_class = cl;
#endif
	if (cl == NULL) {
		if (ret == NET_XMIT_BYPASS)
		if (ret & __NET_XMIT_BYPASS)
			sch->qstats.drops++;
		kfree_skb(skb);
		return ret;
+1 −1
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)
drop:
	kfree_skb(skb);
	sch->qstats.drops++;
	return NET_XMIT_BYPASS;
	return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
}

static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
Loading