Change in osmo-sgsn[master]: Use new stat item/ctr getter APIs

laforge gerrit-no-reply at lists.osmocom.org
Fri Jun 4 19:40:06 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/24549 )

Change subject: Use new stat item/ctr getter APIs
......................................................................

Use new stat item/ctr getter APIs

Generated with spatch:
"""
@@
expression E1, E2;
@@
- &E2->ctr[E1]
+ rate_ctr_group_get_ctr(E2, E1)
"""

Change-Id: I2e064883ac6dafa89e41a297a886a9ebd26ce925
---
M src/gtphub/gtphub.c
M src/sgsn/gprs_gb.c
M src/sgsn/gprs_gmm.c
M src/sgsn/gprs_llc.c
M src/sgsn/gprs_ranap.c
M src/sgsn/gprs_sm.c
M src/sgsn/sgsn_libgtp.c
7 files changed, 50 insertions(+), 50 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/gtphub/gtphub.c b/src/gtphub/gtphub.c
index c24652e..237d699 100644
--- a/src/gtphub/gtphub.c
+++ b/src/gtphub/gtphub.c
@@ -2125,7 +2125,7 @@
 	struct gtphub_bind *from_bind = &hub->to_gsns[side_idx][plane_idx];
 	struct gtphub_bind *to_bind = &hub->to_gsns[other_side_idx(side_idx)][plane_idx];
 
-	rate_ctr_add(&from_bind->counters_io->ctr[GTPH_CTR_BYTES_IN],
+	rate_ctr_add(rate_ctr_group_get_ctr(from_bind->counters_io, GTPH_CTR_BYTES_IN),
 		     received);
 
 	struct gtp_packet_desc p;
@@ -2147,7 +2147,7 @@
 		return -1;
 	}
 
-	rate_ctr_inc(&from_bind->counters_io->ctr[GTPH_CTR_PKTS_IN]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(from_bind->counters_io, GTPH_CTR_PKTS_IN));
 
 	int reply_len;
 	reply_len = gtphub_handle_echo_req(hub, &p, reply_buf);
@@ -2156,8 +2156,8 @@
 		sgsn_sockaddr_copy(to_addr, from_addr);
 		*to_ofd = &from_bind->ofd;
 
-		rate_ctr_inc(&from_bind->counters_io->ctr[GTPH_CTR_PKTS_OUT]);
-		rate_ctr_add(&from_bind->counters_io->ctr[GTPH_CTR_BYTES_OUT],
+		rate_ctr_inc(rate_ctr_group_get_ctr(from_bind->counters_io, GTPH_CTR_PKTS_OUT));
+		rate_ctr_add(rate_ctr_group_get_ctr(from_bind->counters_io, GTPH_CTR_BYTES_OUT),
 			     reply_len);
 		LOG(LOGL_DEBUG, "%s Echo response to %s: %d bytes to %s\n",
 		    (side_idx == GTPH_SIDE_GGSN)? "-->" : "<--",
@@ -2236,9 +2236,9 @@
 		return -1;
 	}
 
-	rate_ctr_add(&from_peer->counters_io->ctr[GTPH_CTR_BYTES_IN],
+	rate_ctr_add(rate_ctr_group_get_ctr(from_peer->counters_io, GTPH_CTR_BYTES_IN),
 		     received);
-	rate_ctr_inc(&from_peer->counters_io->ctr[GTPH_CTR_PKTS_IN]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(from_peer->counters_io, GTPH_CTR_PKTS_IN));
 
 	LOG(LOGL_DEBUG, "from %s peer: %s\n", gtphub_side_idx_names[side_idx],
 	    gtphub_port_str(from_peer));
@@ -2257,9 +2257,9 @@
 
 	if (p.tun) {
 		struct gtphub_tunnel_endpoint *te = &p.tun->endpoint[p.side_idx][p.plane_idx];
-		rate_ctr_add(&te->counters_io->ctr[GTPH_CTR_BYTES_IN],
+		rate_ctr_add(rate_ctr_group_get_ctr(te->counters_io, GTPH_CTR_BYTES_IN),
 			     received);
-		rate_ctr_inc(&te->counters_io->ctr[GTPH_CTR_PKTS_IN]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(te->counters_io, GTPH_CTR_PKTS_IN));
 	}
 
 	if ((!to_peer) && (side_idx == GTPH_SIDE_SGSN)) {
@@ -2311,19 +2311,19 @@
 	*reply_buf = (uint8_t*)p.data;
 
 	if (received) {
-		rate_ctr_inc(&to_bind->counters_io->ctr[GTPH_CTR_PKTS_OUT]);
-		rate_ctr_add(&to_bind->counters_io->ctr[GTPH_CTR_BYTES_OUT],
+		rate_ctr_inc(rate_ctr_group_get_ctr(to_bind->counters_io, GTPH_CTR_PKTS_OUT));
+		rate_ctr_add(rate_ctr_group_get_ctr(to_bind->counters_io, GTPH_CTR_BYTES_OUT),
 			     received);
 
-		rate_ctr_inc(&to_peer->counters_io->ctr[GTPH_CTR_PKTS_OUT]);
-		rate_ctr_add(&to_peer->counters_io->ctr[GTPH_CTR_BYTES_OUT],
+		rate_ctr_inc(rate_ctr_group_get_ctr(to_peer->counters_io, GTPH_CTR_PKTS_OUT));
+		rate_ctr_add(rate_ctr_group_get_ctr(to_peer->counters_io, GTPH_CTR_BYTES_OUT),
 			     received);
 	}
 
 	if (p.tun) {
 		struct gtphub_tunnel_endpoint *te = &p.tun->endpoint[other_side_idx(p.side_idx)][p.plane_idx];
-		rate_ctr_inc(&te->counters_io->ctr[GTPH_CTR_PKTS_OUT]);
-		rate_ctr_add(&te->counters_io->ctr[GTPH_CTR_BYTES_OUT],
+		rate_ctr_inc(rate_ctr_group_get_ctr(te->counters_io, GTPH_CTR_PKTS_OUT));
+		rate_ctr_add(rate_ctr_group_get_ctr(te->counters_io, GTPH_CTR_BYTES_OUT),
 			     received);
 	}
 
diff --git a/src/sgsn/gprs_gb.c b/src/sgsn/gprs_gb.c
index cddd1b1..96157a0 100644
--- a/src/sgsn/gprs_gb.c
+++ b/src/sgsn/gprs_gb.c
@@ -57,7 +57,7 @@
 	bssgp_parse_cell_id(&ra_id, msgb_bcid(msg));
 	mmctx = sgsn_mm_ctx_by_tlli(msgb_tlli(msg), &ra_id);
 	if (mmctx) {
-		rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PKTS_SIG_IN]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PKTS_SIG_IN));
 		mmctx->gb.llme = llme;
 		gprs_gb_recv_pdu(mmctx, msg);
 	}
@@ -102,7 +102,7 @@
 	pinfo.drx_params = mmctx->drx_parms;
 	pinfo.qos[0] = 0; // FIXME
 	rc = bssgp_tx_paging(mmctx->gb.nsei, 0, &pinfo);
-	rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PAGING_PS]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PAGING_PS));
 
 	return rc;
 }
diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c
index edddd2d..c5e927a 100644
--- a/src/sgsn/gprs_gmm.c
+++ b/src/sgsn/gprs_gmm.c
@@ -131,7 +131,7 @@
 			     struct sgsn_mm_ctx *mm, bool encryptable)
 {
 	if (mm) {
-		rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_SIG_OUT]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(mm->ctrg, GMM_CTR_PKTS_SIG_OUT));
 #ifdef BUILD_IU
 		if (mm->ran_type == MM_CTX_T_UTRAN_Iu)
 			return ranap_iu_tx(msg, GPRS_SAPI_GMM);
@@ -291,7 +291,7 @@
 #endif
 
 	LOGMMCTXP(LOGL_INFO, mm, "<- GMM ATTACH ACCEPT (new P-TMSI=0x%08x)\n", mm->p_tmsi);
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ATTACH_ACKED]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ATTACH_ACKED));
 
 	mmctx2msgid(msg, mm);
 
@@ -356,7 +356,7 @@
 
 	LOGMMCTXP(LOGL_NOTICE, mm, "<- GMM ATTACH REJECT: %s\n",
 		  get_value_string(gsm48_gmm_cause_names, gmm_cause));
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ATTACH_REJECTED]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ATTACH_REJECTED));
 
 	gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
 	gh->proto_discr = GSM48_PDISC_MM_GPRS;
@@ -389,7 +389,7 @@
 	/* MMCTX might be NULL! */
 
 	DEBUGP(DMM, "<- GMM DETACH ACC (force-standby: %d)\n", force_stby);
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_DETACH_ACKED]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_DETACH_ACKED));
 
 	gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1);
 	gh->proto_discr = GSM48_PDISC_MM_GPRS;
@@ -1163,7 +1163,7 @@
 	int rc;
 
 	LOGMMCTXP(LOGL_INFO, ctx, "-> GMM ATTACH REQUEST ");
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ATTACH_REQUEST]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ATTACH_REQUEST));
 
 	/* As per TS 04.08 Chapter 4.7.1.4, the attach request arrives either
 	 * with a foreign TLLI (P-TMSI that was allocated to the MS before),
@@ -1410,7 +1410,7 @@
 	power_off = gh->data[0] & 0x8;
 
 	/* FIXME: In 24.008 there is an optional P-TMSI and P-TMSI signature IE */
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_DETACH_REQUEST]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_DETACH_REQUEST));
 	LOGMMCTXP(LOGL_INFO, ctx, "-> GMM DETACH REQUEST TLLI=0x%08x type=%s %s\n",
 		msgb_tlli(msg), get_value_string(gprs_det_t_mo_strs, detach_type),
 		power_off ? "Power-off" : "");
@@ -1449,7 +1449,7 @@
 	struct osmo_mobile_identity mi;
 #endif
 
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ROUTING_AREA_ACKED]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ROUTING_AREA_ACKED));
 	LOGMMCTXP(LOGL_INFO, mm, "<- GMM ROUTING AREA UPDATE ACCEPT\n");
 
 	mmctx2msgid(msg, mm);
@@ -1505,7 +1505,7 @@
 	struct gsm48_hdr *gh;
 
 	LOGP(DMM, LOGL_NOTICE, "<- ROUTING AREA UPDATE REJECT\n");
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ROUTING_AREA_REJECT]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ROUTING_AREA_REJECT));
 
 	gmm_copy_id(msg, old_msg);
 
@@ -1585,7 +1585,7 @@
 	/* Update Type 10.5.5.18 */
 	upd_type = *cur++ & 0x07;
 
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_GPRS_ROUTING_AREA_REQUEST]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_GPRS_ROUTING_AREA_REQUEST));
 	LOGMMCTXP(LOGL_INFO, mmctx, "-> GMM RA UPDATE REQUEST type=\"%s\"\n",
 		get_value_string(gprs_upd_t_strs, upd_type));
 
@@ -1713,7 +1713,7 @@
 	/* Store new BVCI/NSEI in MM context (FIXME: delay until we ack?) */
 	msgid2mmctx(mmctx, msg);
 	/* Bump the statistics of received signalling msgs for this MM context */
-	rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PKTS_SIG_IN]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PKTS_SIG_IN));
 
 	/* Update the MM context with the new RA-ID */
 	if (mmctx->ran_type == MM_CTX_T_GERAN_Gb && msgb_bcid(msg)) {
@@ -1724,7 +1724,7 @@
 	/* FIXME: Update the MM context with the MS radio acc capabilities */
 	/* FIXME: Update the MM context with the MS network capabilities */
 
-	rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_RA_UPDATE]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_RA_UPDATE));
 
 #ifdef PTMSI_ALLOC
 	ptmsi_update(mmctx);
diff --git a/src/sgsn/gprs_llc.c b/src/sgsn/gprs_llc.c
index e357d16..4fbf211 100644
--- a/src/sgsn/gprs_llc.c
+++ b/src/sgsn/gprs_llc.c
@@ -670,8 +670,8 @@
 
 	/* Identifiers passed down: (BVCI, NSEI) */
 
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_PACKETS]);
-	rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_BYTES], msg->len);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_DL_PACKETS));
+	rate_ctr_add(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_DL_BYTES), msg->len);
 
 	/* Send BSSGP-DL-UNITDATA.req */
 	return _bssgp_tx_dl_ud(msg, NULL);
@@ -814,8 +814,8 @@
 		}
 	}
 
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_PACKETS]);
-	rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_DL_BYTES], msg->len);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_DL_PACKETS));
+	rate_ctr_add(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_DL_BYTES), msg->len);
 
 	/* Identifiers passed down: (BVCI, NSEI) */
 
@@ -1000,8 +1000,8 @@
 		msgb_l3trim(msg, llhp.data_len);
 	}
 
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_PACKETS]);
-	rate_ctr_add(&sgsn->rate_ctrs->ctr[CTR_LLC_UL_BYTES], msg->len);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_UL_PACKETS));
+	rate_ctr_add(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_LLC_UL_BYTES), msg->len);
 
 	/* llhp.data is only set when we need to send LL_[UNIT]DATA_IND up */
 	if (llhp.cmd == GPRS_LLC_UI && llhp.data && llhp.data_len) {
diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c
index e8addd7..ead20f7 100644
--- a/src/sgsn/gprs_ranap.c
+++ b/src/sgsn/gprs_ranap.c
@@ -232,7 +232,7 @@
 
 	mmctx = sgsn_mm_ctx_by_ue_ctx(MSG_IU_UE_CTX(msg));
 	if (mmctx) {
-		rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PKTS_SIG_IN]);
+		rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PKTS_SIG_IN));
 		if (ra_id)
 			memcpy(&mmctx->ra, ra_id, sizeof(mmctx->ra));
 	}
diff --git a/src/sgsn/gprs_sm.c b/src/sgsn/gprs_sm.c
index 3bdad3b..6c09c4f 100644
--- a/src/sgsn/gprs_sm.c
+++ b/src/sgsn/gprs_sm.c
@@ -186,7 +186,7 @@
 	uint8_t transaction_id = pdp->ti ^ 0x8; /* flip */
 
 	LOGPDPCTXP(LOGL_INFO, pdp, "<- ACTIVATE PDP CONTEXT ACK\n");
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_ACTIVATE_ACCEPT]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_ACTIVATE_ACCEPT));
 
 	mmctx2msgid(msg, pdp->mm);
 
@@ -232,7 +232,7 @@
 
 	LOGMMCTXP(LOGL_NOTICE, mm, "<- ACTIVATE PDP CONTEXT REJ: %s\n",
 		  get_value_string(gsm48_gsm_cause_names, cause));
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_ACTIVATE_REJECT]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_ACTIVATE_REJECT));
 
 	mmctx2msgid(msg, mm);
 
@@ -257,7 +257,7 @@
 	uint8_t tear_down_ind = (0x9 << 4) | (!!teardown);
 
 	LOGMMCTXP(LOGL_INFO, mm, "<- DEACTIVATE PDP CONTEXT REQ\n");
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_DL_DEACTIVATE_REQUEST]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_DL_DEACTIVATE_REQUEST));
 
 	mmctx2msgid(msg, mm);
 
@@ -285,7 +285,7 @@
 	uint8_t transaction_id = tid ^ 0x8; /* flip */
 
 	LOGMMCTXP(LOGL_INFO, mm, "<- DEACTIVATE PDP CONTEXT ACK\n");
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_DL_DEACTIVATE_ACCEPT]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_DL_DEACTIVATE_ACCEPT));
 
 	mmctx2msgid(msg, mm);
 
@@ -533,7 +533,7 @@
 
 	/* Only increment counter for a real activation, after we checked
 	 * for re-transmissions */
-	rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PDP_CTX_ACT]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PDP_CTX_ACT));
 
 	/* Determine GGSN based on APN and subscription options */
 	ggsn = sgsn_mm_ctx_find_ggsn_ctx(mmctx, &tp, &gsm_cause, apn_str);
@@ -591,7 +591,7 @@
 	struct msgb *msg;
 	int rc;
 
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_ACTIVATE_REQUEST]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_ACTIVATE_REQUEST));
 
 	/*
 	 * This is painful. We might not have a static GGSN
@@ -629,7 +629,7 @@
 
 	LOGMMCTXP(LOGL_INFO, mm, "-> DEACTIVATE PDP CONTEXT REQ (cause: %s)\n",
 		get_value_string(gsm48_gsm_cause_names, gh->data[0]));
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_UL_DEACTIVATE_REQUEST]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_UL_DEACTIVATE_REQUEST));
 
 	pdp = sgsn_pdp_ctx_by_tid(mm, transaction_id);
 	if (!pdp) {
@@ -654,7 +654,7 @@
 	struct sgsn_pdp_ctx *pdp;
 
 	LOGMMCTXP(LOGL_INFO, mm, "-> DEACTIVATE PDP CONTEXT ACK\n");
-	rate_ctr_inc(&sgsn->rate_ctrs->ctr[CTR_PDP_UL_DEACTIVATE_ACCEPT]);
+	rate_ctr_inc(rate_ctr_group_get_ctr(sgsn->rate_ctrs, CTR_PDP_UL_DEACTIVATE_ACCEPT));
 
 	pdp = sgsn_pdp_ctx_by_tid(mm, transaction_id);
 	if (!pdp) {
diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c
index 6229217..1ac3b44 100644
--- a/src/sgsn/sgsn_libgtp.c
+++ b/src/sgsn/sgsn_libgtp.c
@@ -792,10 +792,10 @@
 		return -1;
 	}
 
-	rate_ctr_inc(&pdp->ctrg->ctr[PDP_CTR_PKTS_UDATA_OUT]);
-	rate_ctr_add(&pdp->ctrg->ctr[PDP_CTR_BYTES_UDATA_OUT], len);
-	rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_UDATA_OUT]);
-	rate_ctr_add(&mm->ctrg->ctr[GMM_CTR_BYTES_UDATA_OUT], len);
+	rate_ctr_inc(rate_ctr_group_get_ctr(pdp->ctrg, PDP_CTR_PKTS_UDATA_OUT));
+	rate_ctr_add(rate_ctr_group_get_ctr(pdp->ctrg, PDP_CTR_BYTES_UDATA_OUT), len);
+	rate_ctr_inc(rate_ctr_group_get_ctr(mm->ctrg, GMM_CTR_PKTS_UDATA_OUT));
+	rate_ctr_add(rate_ctr_group_get_ctr(mm->ctrg, GMM_CTR_BYTES_UDATA_OUT), len);
 
 	/* It is easier to have a global count */
 	pdp->cdr_bytes_out += len;
@@ -830,10 +830,10 @@
 		return -EIO;
 	}
 
-	rate_ctr_inc(&pdp->ctrg->ctr[PDP_CTR_PKTS_UDATA_IN]);
-	rate_ctr_add(&pdp->ctrg->ctr[PDP_CTR_BYTES_UDATA_IN], npdu_len);
-	rate_ctr_inc(&mmctx->ctrg->ctr[GMM_CTR_PKTS_UDATA_IN]);
-	rate_ctr_add(&mmctx->ctrg->ctr[GMM_CTR_BYTES_UDATA_IN], npdu_len);
+	rate_ctr_inc(rate_ctr_group_get_ctr(pdp->ctrg, PDP_CTR_PKTS_UDATA_IN));
+	rate_ctr_add(rate_ctr_group_get_ctr(pdp->ctrg, PDP_CTR_BYTES_UDATA_IN), npdu_len);
+	rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PKTS_UDATA_IN));
+	rate_ctr_add(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_BYTES_UDATA_IN), npdu_len);
 
 	/* It is easier to have a global count */
 	pdp->cdr_bytes_in += npdu_len;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/24549
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I2e064883ac6dafa89e41a297a886a9ebd26ce925
Gerrit-Change-Number: 24549
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210604/a7c47b30/attachment.htm>


More information about the gerrit-log mailing list