Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c1ab59e authored by Sivan Reinstein's avatar Sivan Reinstein
Browse files

msm: ecm_ipa: fix rx bytes reporting



netif_rx_ni/netif_rx functions free the skb, it can't be used afterwards
as it might contain garbage values. This change saves the length value
prior to the network stack function calls above in order to properly
update the traffic stats of the interface.

Change-Id: Ib3a9347b974e843b7fd573e4fe36ba2558844577
Acked-by: default avatarDavid Arinzon <darinzon@qti.qualcomm.com>
Signed-off-by: default avatarSivan Reinstein <sivanr@codeaurora.org>
parent 37bc52a5
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -661,12 +661,14 @@ static void ecm_ipa_packet_receive_notify(void *priv,
	struct sk_buff *skb = (struct sk_buff *)data;
	struct ecm_ipa_dev *ecm_ipa_ctx = priv;
	int result;
	unsigned int packet_len;

	if (!skb) {
		ECM_IPA_ERROR("Bad SKB received from IPA driver\n");
		return;
	}

	packet_len = skb->len;
	ECM_IPA_DEBUG("packet RX, len=%d\n", skb->len);

	if (unlikely(ecm_ipa_ctx->state != ECM_IPA_CONNECTED_AND_UP)) {
@@ -691,7 +693,7 @@ static void ecm_ipa_packet_receive_notify(void *priv,
	if (result)
		ECM_IPA_ERROR("fail on netif_rx\n");
	ecm_ipa_ctx->net->stats.rx_packets++;
	ecm_ipa_ctx->net->stats.rx_bytes += skb->len;
	ecm_ipa_ctx->net->stats.rx_bytes += packet_len;

	return;
}