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

Commit e2d72897 authored by Sivan Reinstein's avatar Sivan Reinstein Committed by Gerrit - the friendly Code Review server
Browse files

msm: rndis_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: Ia489913d3b226205ed5bded5fe179b195bf6694b
Acked-by: default avatarDavid Arinzon <darinzon@qti.qualcomm.com>
Signed-off-by: default avatarSivan Reinstein <sivanr@codeaurora.org>
parent 3d109ee5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1087,6 +1087,7 @@ static void rndis_ipa_packet_receive_notify(void *private,
	struct sk_buff *skb = (struct sk_buff *)data;
	struct rndis_ipa_dev *rndis_ipa_ctx = private;
	int result;
	unsigned int packet_len = skb->len;

	RNDIS_IPA_DEBUG("packet Rx, len=%d\n",
		skb->len);
@@ -1123,7 +1124,7 @@ static void rndis_ipa_packet_receive_notify(void *private,
	if (result)
		RNDIS_IPA_ERROR("fail on netif_rx\n");
	rndis_ipa_ctx->net->stats.rx_packets++;
	rndis_ipa_ctx->net->stats.rx_bytes += skb->len;
	rndis_ipa_ctx->net->stats.rx_bytes += packet_len;

	return;
}