add KPI counter to count bytes for RLC and LLC frames

rlc.dl_bytes		bytes before sending rlc
rlc.dl_payload_bytes	count data w/o LI
rlc.ul_bytes		bytes when received rlc (only valid)
rlc.ul_payload_bytes	count data fragments w/o LI
llc.dl_bytes		complete encapsulated LLC PDUs
llc.ul_bytes		complete received LLC PDUs

Change-Id: I9a98a5a375d39b3f4990360056c4d6145e755f4d
Reviewed-on: https://gerrit.osmocom.org/145
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Reviewed-by: Holger Freyther <holger@freyther.de>
Tested-by: Jenkins Builder
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 66f747b..5931676 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -513,6 +513,7 @@
 
 	do {
 		bool is_final;
+		int payload_written = 0;
 
 		if (m_llc.frame_length() == 0) {
 			/* nothing to sent - delay the release of the TBF */
@@ -540,7 +541,10 @@
 		is_final = llc_queue()->size() == 0 && !keep_open(fn);
 
 		ar = Encoding::rlc_data_to_dl_append(rdbi, cs,
-			&m_llc, &write_offset, &num_chunks, data, is_final, NULL);
+			&m_llc, &write_offset, &num_chunks, data, is_final, &payload_written);
+
+		if (payload_written > 0)
+			bts->rlc_dl_payload_bytes(payload_written);
 
 		if (ar == Encoding::AR_NEED_MORE_BLOCKS)
 			break;
@@ -548,6 +552,7 @@
 		LOGP(DRLCMACDL, LOGL_INFO, "Complete DL frame for %s"
 			"len=%d\n", tbf_name(this), m_llc.frame_length());
 		gprs_rlcmac_dl_bw(this, m_llc.frame_length());
+		bts->llc_dl_bytes(m_llc.frame_length());
 		m_llc.reset();
 
 		if (is_final) {