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

Commit 0c26babf authored by Subash Abhinov Kasiviswanathan's avatar Subash Abhinov Kasiviswanathan
Browse files

net: rmnet_data: Allow changes in UL aggregation parameters



In case a small egress agg size is passed, the aggregated skb
allocated would have a negative tailroom and the skb_put maybe beyond
the actual expected boundary.

Fix this by flushing out packets immediately.

CRs-Fixed: 2382840
Change-Id: Id703a64c5b4e1d24f223b4dbe5e8929351bc02ae
Signed-off-by: default avatarSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
parent 85016969
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, 2019 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -800,6 +800,7 @@ int rmnet_set_egress_data_format(struct net_device *dev,
				 u16 agg_count)
{
	struct rmnet_phys_ep_config *config;
	unsigned long flags;

	ASSERT_RTNL();

@@ -815,8 +816,11 @@ int rmnet_set_egress_data_format(struct net_device *dev,
		return RMNET_CONFIG_UNKNOWN_ERROR;

	config->egress_data_format = egress_data_format;

	spin_lock_irqsave(&config->agg_lock, flags);
	config->egress_agg_size = agg_size;
	config->egress_agg_count = agg_count;
	spin_unlock_irqrestore(&config->agg_lock, flags);

	return RMNET_CONFIG_OK;
}
+4 −3
Original line number Diff line number Diff line
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -261,8 +261,10 @@ void rmnet_map_aggregate(struct sk_buff *skb,
		 * sparse, don't aggregate. We will need to tune this later
		 */
		diff = timespec_sub(config->agg_last, last);
		size = config->egress_agg_size - skb->len;

		if ((diff.tv_sec > 0) || (diff.tv_nsec > agg_bypass_time)) {
		if ((diff.tv_sec > 0) || (diff.tv_nsec > agg_bypass_time) ||
		    (size <= 0)) {
			spin_unlock_irqrestore(&config->agg_lock, flags);
			LOGL("delta t: %ld.%09lu\tcount: bypass", diff.tv_sec,
			     diff.tv_nsec);
@@ -274,7 +276,6 @@ void rmnet_map_aggregate(struct sk_buff *skb,
			return;
		}

		size = config->egress_agg_size - skb->len;
		config->agg_skb = skb_copy_expand(skb, 0, size, GFP_ATOMIC);
		if (!config->agg_skb) {
			config->agg_skb = 0;