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 */