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

Commit 141ece89 authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

net: qualcomm: rmnet: Capture all drops in transmit path



Packets in transmit path could potentially be dropped if there were
errors while adding the MAP header or the checksum header.
Increment the tx_drops stats in these cases.

Additionally, refactor the code to free the packet and increment
the tx_drops stat under a single label.

CRs-Fixed: 2226308
Change-Id: I4dd0ef20afbaf13c950d5d645682834e1745cdb9
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Git-commit: 1eece799d3f611a28a25319aabbccd4ac948098f
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git


Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 4b243459
Loading
Loading
Loading
Loading
+10 −11
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,

	if (skb_headroom(skb) < required_headroom) {
		if (pskb_expand_head(skb, required_headroom, 0, GFP_KERNEL))
			goto fail;
			return -ENOMEM;
	}

	if (port->data_format & RMNET_FLAGS_EGRESS_MAP_CKSUMV4)
@@ -187,7 +187,7 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,

	map_header = rmnet_map_add_map_header(skb, additional_header_len, 0);
	if (!map_header)
		goto fail;
		return -ENOMEM;

	map_header->mux_id = mux_id;

@@ -212,10 +212,6 @@ static int rmnet_map_egress_handler(struct sk_buff *skb,
done:
	skb->protocol = htons(ETH_P_MAP);
	return 0;

fail:
	kfree_skb(skb);
	return -ENOMEM;
}

static void
@@ -277,15 +273,18 @@ void rmnet_egress_handler(struct sk_buff *skb)
	mux_id = priv->mux_id;

	port = rmnet_get_port(skb->dev);
	if (!port) {
		kfree_skb(skb);
		return;
	}
	if (!port)
		goto drop;

	if (rmnet_map_egress_handler(skb, port, mux_id, orig_dev))
		return;
		goto drop;

	rmnet_vnd_tx_fixup(skb, orig_dev);

	dev_queue_xmit(skb);
	return;

drop:
	this_cpu_inc(priv->pcpu_stats->stats.tx_drops);
	kfree_skb(skb);
}