aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>2014-07-17 17:21:44 -0600
committerLinux Build Service Account <lnxbuild@localhost>2016-08-24 08:18:54 -0600
commit8b8d0a8ed4dd35291e751b18928df54e797b184e (patch)
treeec222ab1a595b79754b5eac2061704d83054d35f
parentfebb3d86bb846b4fc40cfa170728a8c42a9a7c7f (diff)
downloadandroid_external_iproute2-staging/cm-14.0-caf.tar.gz
android_external_iproute2-staging/cm-14.0-caf.tar.bz2
android_external_iproute2-staging/cm-14.0-caf.zip
tc: Add flow control setting on PRIO qdiscstaging/cm-14.0-caf
* Enable filter fw, qdiscs prio, and qdisc fifo. * Add "flow enable|disable" clause for PRIO qdisc * Now using sanitized kernel headers CRs-Fixed: 1023199 Change-Id: I7ccfe9717bf21738c66b33dbafe04b2c3a3a912a
-rw-r--r--include/linux/pkt_sched.h1
-rw-r--r--tc/Android.mk10
-rw-r--r--tc/q_prio.c22
-rw-r--r--tc/tc.c18
-rw-r--r--tc/tc_qdisc.c4
5 files changed, 51 insertions, 4 deletions
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 8cb18b4..d9edb0f 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -130,6 +130,7 @@ struct tc_fifo_qopt {
struct tc_prio_qopt {
int bands; /* Number of bands */
__u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
+ __u8 enable_flow; /* Enable dequeue */
};
/* MULTIQ section */
diff --git a/tc/Android.mk b/tc/Android.mk
index 467b08a..85db2cb 100644
--- a/tc/Android.mk
+++ b/tc/Android.mk
@@ -5,6 +5,10 @@ LOCAL_SRC_FILES := tc.c tc_exec.c tc_qdisc.c q_cbq.c tc_util.c tc_class.c tc_co
m_estimator.c tc_filter.c tc_monitor.c tc_stab.c tc_cbq.c \
tc_estimator.c f_u32.c m_police.c q_ingress.c m_mirred.c q_htb.c
+ifeq ($(call is-vendor-board-platform,QCOM),true)
+LOCAL_SRC_FILES += f_fw.c q_prio.c q_fifo.c
+endif
+
LOCAL_MODULE := tc
LOCAL_SYSTEM_SHARED_LIBRARIES := \
@@ -14,7 +18,11 @@ LOCAL_SHARED_LIBRARIES += libiprouteutil libnetlink
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include
-LOCAL_CFLAGS := -O2 -g -W -Wall -Wno-pointer-arith -Wno-sign-compare -Werror \
+ifeq ($(call is-vendor-board-platform,QCOM),true)
+LOCAL_CFLAGS := -DFEATURE_PRIO
+endif
+
+LOCAL_CFLAGS += -O2 -g -W -Wall -Wno-pointer-arith -Wno-sign-compare -Werror \
-Wno-unused-parameter \
-Wno-missing-field-initializers
diff --git a/tc/q_prio.c b/tc/q_prio.c
index 3236bec..afcbfb4 100644
--- a/tc/q_prio.c
+++ b/tc/q_prio.c
@@ -25,14 +25,14 @@
static void explain(void)
{
- fprintf(stderr, "Usage: ... prio bands NUMBER priomap P1 P2...[multiqueue]\n");
+ fprintf(stderr, "Usage: ... prio bands NUMBER priomap P1 P2...[multiqueue] [flow (enable|disable)]\n");
}
static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nlmsghdr *n)
{
int pmap_mode = 0;
int idx = 0;
- struct tc_prio_qopt opt={3,{ 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }};
+ struct tc_prio_qopt opt={3,{ 1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 },1};
struct rtattr *nest;
unsigned char mq = 0;
@@ -53,6 +53,21 @@ static int prio_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
pmap_mode = 1;
} else if (strcmp(*argv, "multiqueue") == 0) {
mq = 1;
+ } else if (strcmp(*argv, "flow") == 0) {
+ NEXT_ARG();
+ if (strcmp(*argv, "enable") == 0)
+ {
+ opt.enable_flow = 1;
+ }
+ else if (strcmp(*argv, "disable") == 0)
+ {
+ opt.enable_flow = 0;
+ }
+ else
+ {
+ explain();
+ return -1;
+ }
} else if (strcmp(*argv, "help") == 0) {
explain();
return -1;
@@ -114,6 +129,9 @@ int prio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
fprintf(f, " multiqueue: %s ",
rta_getattr_u8(tb[TCA_PRIO_MQ]) ? "on" : "off");
+ if (qu && !strcmp(qu->id, "prio"))
+ fprintf(f, " flow %s", qopt->enable_flow ? "enabled" : "disabled");
+
return 0;
}
diff --git a/tc/tc.c b/tc/tc.c
index e1d4bc3..b4f5623 100644
--- a/tc/tc.c
+++ b/tc/tc.c
@@ -57,6 +57,12 @@ extern struct qdisc_util cbq_qdisc_util;
extern struct qdisc_util htb_qdisc_util;
extern struct qdisc_util ingress_qdisc_util;
extern struct filter_util u32_filter_util;
+#ifdef FEATURE_PRIO
+extern struct filter_util fw_filter_util;
+extern struct qdisc_util prio_qdisc_util;
+extern struct qdisc_util pfifo_fast_qdisc_util;
+extern struct qdisc_util pfifo_qdisc_util;
+#endif
#endif
static int print_noqopt(struct qdisc_util *qu, FILE *f,
@@ -119,6 +125,14 @@ struct qdisc_util *get_qdisc_kind(const char *str)
return &htb_qdisc_util;
else if (!strcmp(str, "ingress"))
return &ingress_qdisc_util;
+#ifdef FEATURE_PRIO
+ else if (!strcmp(str, "pfifo_fast"))
+ return &pfifo_fast_qdisc_util;
+ else if (!strcmp(str, "prio"))
+ return &prio_qdisc_util;
+ else if (!strcmp(str, "pfifo"))
+ return &pfifo_qdisc_util;
+#endif
else {
fprintf(stderr, "Android does not support qdisc '%s'\n", str);
return NULL;
@@ -172,6 +186,10 @@ struct filter_util *get_filter_kind(const char *str)
#ifdef ANDROID
if (!strcmp(str, "u32"))
return &u32_filter_util;
+#ifdef FEATURE_PRIO
+ else if (!strcmp(str, "fw"))
+ return &fw_filter_util;
+#endif
else {
fprintf(stderr, "Android does not support filter '%s'\n", str);
return NULL;
diff --git a/tc/tc_qdisc.c b/tc/tc_qdisc.c
index cb861e0..786119e 100644
--- a/tc/tc_qdisc.c
+++ b/tc/tc_qdisc.c
@@ -248,11 +248,13 @@ int print_qdisc(const struct sockaddr_nl *who,
if (t->tcm_info != 1) {
fprintf(fp, "refcnt %d ", t->tcm_info);
}
- /* pfifo_fast is generic enough to warrant the hardcoding --JHS */
+#if 0 /* Suppressed to dinstinguish between prio & pfifo_fast */
+ /* pfifo_fast is generic enough to warrant the hardcoding --JHS */
if (0 == strcmp("pfifo_fast", RTA_DATA(tb[TCA_KIND])))
q = get_qdisc_kind("prio");
else
+#endif
q = get_qdisc_kind(RTA_DATA(tb[TCA_KIND]));
if (tb[TCA_OPTIONS]) {