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

Commit b407e473 authored by Harout Hedeshian's avatar Harout Hedeshian
Browse files

net: tc_qdisc_flow_control returning qdisc size



Changed the tc_qdisc_flow_control API to return the size of the
qdisc in order to be able to collect data on the size of the
qdisc before doing flow control operations. This is required to effectively
diagnose the state of the queues when debugging flow control.

CRs-Fixed: 657414
Change-Id: I4aff2157410e1170de2d0791757ed2e12830a2db
Acked-by: default avatarSivan Reinstein <sivanr@qti.qualcomm.com>
Signed-off-by: default avatarHarout Hedeshian <harouth@codeaurora.org>
parent 9e91c0c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ extern int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp,
			      struct tcf_result *res);
extern int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
		       struct tcf_result *res);
extern void tc_qdisc_flow_control(struct net_device *dev, u32 tcm_handle,
extern int tc_qdisc_flow_control(struct net_device *dev, u32 tcm_handle,
				  int flow_enable);
/* Calculate maximal size of packet seen by hard_start_xmit
   routine of this device.
+4 −1
Original line number Diff line number Diff line
@@ -1080,10 +1080,11 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n)
/*
 * enable/disable flow on qdisc.
 */
void
int
tc_qdisc_flow_control(struct net_device *dev, u32 tcm_handle, int enable_flow)
{
	struct Qdisc *q;
	int qdisc_len = 0;
	struct __qdisc_change_req {
		struct nlattr attr;
		struct tc_prio_qopt data;
@@ -1100,9 +1101,11 @@ tc_qdisc_flow_control(struct net_device *dev, u32 tcm_handle, int enable_flow)

	/* call registered change function */
	if (q) {
		qdisc_len = q->q.qlen;
		if (q->ops->change(q, &(req.attr)) != 0)
			pr_err("tc_qdisc_flow_control: qdisc change failed");
	}
	return qdisc_len;
}
EXPORT_SYMBOL(tc_qdisc_flow_control);