diff options
author | Harout Hedeshian <harouth@codeaurora.org> | 2013-10-07 12:58:51 -0600 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2013-10-31 19:04:03 -0600 |
commit | 4c48963517f1569ce909ad2f8a4b7a675de5a1f6 (patch) | |
tree | 3cecf10b60e8befaa7cb7ce79da1e5cf66b53c1a | |
parent | 157d428913c3d738be481f12e8cbf9267b3b2862 (diff) | |
download | android_external_iproute2-stable/cm-11.0-XNG3C.tar.gz android_external_iproute2-stable/cm-11.0-XNG3C.tar.bz2 android_external_iproute2-stable/cm-11.0-XNG3C.zip |
tc: Add flow control setting on PRIO qdisccm-11.0-XNPH44S-bacon-5fa8c79c0bcm-11.0-XNPH33R-bacon-3628510d76cm-11.0-XNPH30O-bacon-4f280f505acm-11.0-XNPH25R-bacon-d22b777afacm-11.0-XNPH22R-bacon-03d77315eacm-11.0-XNPH05Q-tomato-9828f8e9cccm-11.0-XNPH05Q-bacon-5229c4ef56stable/cm-11.0-XNG3Cstable/cm-11.0-XNG2Sstable/cm-11.0-XNF9Xstable/cm-11.0-XNF8Ystable/cm-11.0shipping/cm-11.0cm-11.0
* Enable filter fw, qdiscs prio, and qdisc fifo.
* Add "flow enable|disable" clause for PRIO qdisc
* Now using sanitized kernel headers
CRs-fixed: 555466
Change-Id: I7ccfe9717bf21738c66b33dbafe04b2c3a3a912a
(cherry picked from commit f238dceaa69cd866e1fb068c0c658eb659f5c8ed)
(cherry picked from commit 2c252e1350ba7fde0e27a17c159b561ba0e0945d)
-rw-r--r-- | tc/Android.mk | 16 | ||||
-rw-r--r-- | tc/q_prio.c | 22 | ||||
-rw-r--r-- | tc/tc.c | 18 | ||||
-rw-r--r-- | tc/tc_qdisc.c | 4 |
4 files changed, 55 insertions, 5 deletions
diff --git a/tc/Android.mk b/tc/Android.mk index 07150e9..460850e 100644 --- a/tc/Android.mk +++ b/tc/Android.mk @@ -1,10 +1,15 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) + LOCAL_SRC_FILES := tc.c tc_qdisc.c q_cbq.c tc_util.c tc_class.c tc_core.c m_action.c \ 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 := \ @@ -12,9 +17,16 @@ LOCAL_SYSTEM_SHARED_LIBRARIES := \ LOCAL_SHARED_LIBRARIES += libiprouteutil libnetlink -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include +ifeq ($(call is-vendor-board-platform,QCOM),true) +LOCAL_C_INCLUDES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include +LOCAL_C_INCLUDES += external/iproute2/include +LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr +LOCAL_CFLAGS := -DFEATURE_PRIO +else +LOCAL_C_INCLUDES := $(KERNEL_HEADERS) external/iproute2/include +endif -LOCAL_CFLAGS := -O2 -g -W -Wall +LOCAL_CFLAGS += -O2 -g -W -Wall -Wunused-parameter include $(BUILD_EXECUTABLE) diff --git a/tc/q_prio.c b/tc/q_prio.c index 79b4fd0..b8e6ab7 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; } @@ -49,6 +49,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, @@ -111,6 +117,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; @@ -164,6 +178,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 3f932a7..5608a65 100644 --- a/tc/tc_qdisc.c +++ b/tc/tc_qdisc.c @@ -241,11 +241,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]) { |