summaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2015-09-26 01:27:34 +0900
committerSteve Kondik <steve@cyngn.com>2016-06-08 21:15:23 -0700
commitbee83f8d7edb48a1d8b8f2333a1b259854c44b95 (patch)
tree4b32117a26b25295f155ac185b3eca0ec26396c2 /config.c
parent4f99df509e1e6626967aa8bb394045932e75576b (diff)
downloadandroid_external_android-clat-bee83f8d7edb48a1d8b8f2333a1b259854c44b95.tar.gz
android_external_android-clat-bee83f8d7edb48a1d8b8f2333a1b259854c44b95.tar.bz2
android_external_android-clat-bee83f8d7edb48a1d8b8f2333a1b259854c44b95.zip
Add a "packet_burst" config option that will cause clatd to read (and write) in bursts of up to that number of packets, instead of always only reading one packet at a time. This reduces poll overhead and improves performance. The variable is initially set to 10. Bug: 24113287 Change-Id: I7feba4127538c5a89f92e0ebea1fb75971d6b901
Diffstat (limited to 'config.c')
-rw-r--r--config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/config.c b/config.c
index b147868..84a1e0e 100644
--- a/config.c
+++ b/config.c
@@ -371,6 +371,13 @@ int read_config(const char *file, const char *uplink_interface, const char *plat
Global_Clatd_Config.use_dynamic_iid = 1;
}
+ if(!config_item_int16_t(root, "packet_burst", "10", &Global_Clatd_Config.packet_burst))
+ goto failed;
+
+ if (Global_Clatd_Config.packet_burst < 1 || Global_Clatd_Config.packet_burst > 50) {
+ logmsg(ANDROID_LOG_FATAL, "invalid value packet_burst %d", Global_Clatd_Config.packet_burst);
+ }
+
return 1;
failed:
@@ -392,4 +399,5 @@ void dump_config() {
logmsg(ANDROID_LOG_DEBUG,"ipv4_local_prefixlen = %d", Global_Clatd_Config.ipv4_local_prefixlen);
logmsg(ANDROID_LOG_DEBUG,"plat_subnet = %s",inet_ntop(AF_INET6, &Global_Clatd_Config.plat_subnet, charbuffer, sizeof(charbuffer)));
logmsg(ANDROID_LOG_DEBUG,"default_pdp_interface = %s",Global_Clatd_Config.default_pdp_interface);
+ logmsg(ANDROID_LOG_DEBUG,"packet burst = %d",Global_Clatd_Config.packet_burst);
}