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: Sivan Reinstein <sivanr@qti.qualcomm.com> Signed-off-by: Harout Hedeshian <harouth@codeaurora.org> [subashab@codeaurora.org: resolve trivial merge conflicts] Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
This commit is contained in:
parent
a4dc732269
commit
6ff0325a57
2 changed files with 5 additions and 2 deletions
|
@ -124,7 +124,7 @@ static inline __be16 tc_skb_protocol(const struct sk_buff *skb)
|
|||
return skb->protocol;
|
||||
}
|
||||
|
||||
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.
|
||||
|
|
|
@ -1173,10 +1173,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;
|
||||
|
@ -1193,9 +1194,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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue