From 82d77d9ec40f4b29dc7b575d2740bf3c1fef4cd7 Mon Sep 17 00:00:00 2001 From: Subash Abhinov Kasiviswanathan Date: Fri, 28 May 2021 11:40:50 -0600 Subject: [PATCH] dfc_qmi: Honor tcp ancillary bit even when there is no change in grant The tcp ancillary bit has been updated to be sent in almost all cases unlike earlier where this was sent in case of TCP DL traffic. This bit will now not be set only in case of adverse scenarios, so this change ensures that the ACK queue state is updated in case the ancillary bit is unset. CRs-Fixed: 2957344 Change-Id: I4e1f26c9d3fabc64401284e36b48d82a4f3a5161 Signed-off-by: Subash Abhinov Kasiviswanathan --- core/dfc_qmi.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/core/dfc_qmi.c b/core/dfc_qmi.c index f1bb16b82713..f52d9e3e032f 100644 --- a/core/dfc_qmi.c +++ b/core/dfc_qmi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2021, 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 @@ -923,12 +923,18 @@ int dfc_bearer_flow_ctl(struct net_device *dev, enable = bearer->grant_size ? true : false; - qmi_rmnet_flow_control(dev, bearer->mq_idx, enable); + /* Do not flow disable tcp ack q in tcp bidir + * ACK queue opened first to drain ACKs faster + * Although since tcp ancillary is true most of the time, + * this shouldn't really make a difference + * If there is non zero grant but tcp ancillary is false, + * send out ACKs anyway + */ + if (bearer->ack_mq_idx != INVALID_MQ) + qmi_rmnet_flow_control(dev, bearer->ack_mq_idx, + enable || bearer->tcp_bidir); - /* Do not flow disable tcp ack q in tcp bidir */ - if (bearer->ack_mq_idx != INVALID_MQ && - (enable || !bearer->tcp_bidir)) - qmi_rmnet_flow_control(dev, bearer->ack_mq_idx, enable); + qmi_rmnet_flow_control(dev, bearer->mq_idx, enable); if (!enable && bearer->ack_req) dfc_send_ack(dev, bearer->bearer_id, @@ -1022,8 +1028,12 @@ static int dfc_update_fc_map(struct net_device *dev, struct qos_info *qos, itm->bytes_in_flight = 0; } + /* update queue state only if there is a change in grant + * or change in ancillary tcp state + */ if ((itm->grant_size == 0 && adjusted_grant > 0) || - (itm->grant_size > 0 && adjusted_grant == 0)) + (itm->grant_size > 0 && adjusted_grant == 0) || + (itm->tcp_bidir ^ DFC_IS_TCP_BIDIR(ancillary))) action = true; /* This is needed by qmap */