From 6c318682bce25de5b69986da2a24c9d507c916ac Mon Sep 17 00:00:00 2001 From: Subash Abhinov Kasiviswanathan Date: Wed, 20 May 2020 15:43:16 -0600 Subject: [PATCH 1/4] core: cleanup task boost list Cleanup entries in the task boost list when the pid becomes inactive. Change-Id: I0b1b2ef81cda470cd08b31ab4e78f81d346b9b70 Acked-by: Ryan Chapman Signed-off-by: Subash Abhinov Kasiviswanathan --- core/rmnet_genl.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/core/rmnet_genl.c b/core/rmnet_genl.c index f568672db569..e52364ad3b7a 100644 --- a/core/rmnet_genl.c +++ b/core/rmnet_genl.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/* Copyright (c) 2019, The Linux Foundation. All rights reserved. +/* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. * * RMNET Data Generic Netlink * @@ -190,11 +190,8 @@ static void rmnet_create_pid_bps_resp(struct rmnet_core_pid_bps_resp tx_bytes_cur = node_p->tx_bytes; if (tx_bytes_cur <= node_p->tx_bytes_last_query) { /* Dont send inactive pids to userspace */ - /* TODO: can remove from hash table probably */ - node_p->tx_bps = 0; - node_p->timstamp_last_query = - pid_bps_resp_ptr->timestamp; - node_p->sched_boost_remaining_ms = 0; + hash_del(&node_p->list); + kfree(node_p); continue; } From 9a791f3de42917f38a733a4d7a74f5b8c9a86e78 Mon Sep 17 00:00:00 2001 From: Subash Abhinov Kasiviswanathan Date: Thu, 21 May 2020 12:37:36 -0600 Subject: [PATCH 2/4] net: qualcomm: rmnet: Allow UL aggregation time limit of 1ms Reduce the minimum allowed UL aggregation timeout to 1ms as a lower limit might be preferable to reduce latency for sporadic traffic scenarios. CRs-fixed: 2692360 Change-Id: Iba1c02232fa83d7cac112bd4b3f625128e2da88b Signed-off-by: Subash Abhinov Kasiviswanathan --- core/rmnet_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/rmnet_config.c b/core/rmnet_config.c index 95208b6e6df6..1d0d71dd0d99 100644 --- a/core/rmnet_config.c +++ b/core/rmnet_config.c @@ -360,7 +360,7 @@ static int rmnet_rtnl_validate(struct nlattr *tb[], struct nlattr *data[], if (data[IFLA_RMNET_UL_AGG_PARAMS]) { agg_params = nla_data(data[IFLA_RMNET_UL_AGG_PARAMS]); - if (agg_params->agg_time < 3000000) + if (agg_params->agg_time < 1000000) return -EINVAL; } } From 2a1b9716b17edf853ab187f9c1c418b03902902b Mon Sep 17 00:00:00 2001 From: Subash Abhinov Kasiviswanathan Date: Tue, 26 May 2020 12:50:43 -0700 Subject: [PATCH 3/4] rmnet_ctl: re-arrange ipa registration Re-arrange ipa registration sequence to handle cases where rmnet_ctl is being initialized before ipa is ready. Change-Id: Ic8416ad8f96f818e32f1320e997287ebfe755d03 Acked-by: Weiyi Chen Signed-off-by: Subash Abhinov Kasiviswanathan --- core/rmnet_ctl_ipa.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/core/rmnet_ctl_ipa.c b/core/rmnet_ctl_ipa.c index fc4864cc12df..39eb76ad7781 100644 --- a/core/rmnet_ctl_ipa.c +++ b/core/rmnet_ctl_ipa.c @@ -18,6 +18,7 @@ struct rmnet_ctl_ipa_dev { }; static struct rmnet_ctl_ipa_dev ctl_ipa_dev; +static bool rmnet_ctl_ipa_registered; static int rmnet_ctl_send_ipa(struct rmnet_ctl_dev *dev, struct sk_buff *skb) { @@ -78,33 +79,31 @@ static void rmnet_ctl_ipa_ready(void *user_data) rmnet_ctl_dl_callback, &ctl_ipa_dev); - pr_info("%s: %d\n", __func__, rc); + if (rc) + pr_err("%s: %d\n", __func__, rc); + else + rmnet_ctl_ipa_registered = true; } static int __init rmnet_ctl_init(void) { int rc; - rc = ipa_register_rmnet_ctl_cb( - rmnet_ctl_probe, - &ctl_ipa_dev, - rmnet_ctl_remove, - &ctl_ipa_dev, - rmnet_ctl_dl_callback, - &ctl_ipa_dev); - - if (rc == -EAGAIN) - rc = ipa_register_ipa_ready_cb( - rmnet_ctl_ipa_ready, NULL); - - pr_info("%s: %d\n", __func__, rc); + rc = ipa_register_ipa_ready_cb(rmnet_ctl_ipa_ready, NULL); + if (rc == -EEXIST) + rmnet_ctl_ipa_ready(NULL); + else if (rc) + pr_err("%s: %d\n", __func__, rc); return 0; } static void __exit rmnet_ctl_exit(void) { - ipa_unregister_rmnet_ctl_cb(); + if (rmnet_ctl_ipa_registered) { + ipa_unregister_rmnet_ctl_cb(); + rmnet_ctl_ipa_registered = false; + } } module_init(rmnet_ctl_init) From 17190b7e11a50bfefd6c5bf6ca30cab605c384ef Mon Sep 17 00:00:00 2001 From: Subash Abhinov Kasiviswanathan Date: Thu, 28 May 2020 22:14:41 -0600 Subject: [PATCH 4/4] core: Add trace point for gso verification This patch adds trace events to help with debug for gso feature by identifying the packets (and their lengths) that are using the segmentation offload feature. Adding source and destination port number info in the gso trace events to differentiate between the flows. CRs-Fixed: 2697145 Change-Id: I4f9786afa799cb1589bd07393c0922913037390d Signed-off-by: Subash Abhinov Kasiviswanathan --- core/rmnet_trace.h | 29 ++++++++++++++++++++++++++++- core/rmnet_vnd.c | 21 +++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/core/rmnet_trace.h b/core/rmnet_trace.h index b1ae59b30c6a..28a2a2c6003c 100644 --- a/core/rmnet_trace.h +++ b/core/rmnet_trace.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved. +/* Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. */ #undef TRACE_SYSTEM @@ -101,6 +101,33 @@ DEFINE_EVENT ); +TRACE_EVENT(print_skb_gso, + + TP_PROTO(struct sk_buff *skb, __be16 src, __be16 dest), + + TP_ARGS(skb, src, dest), + + TP_STRUCT__entry( + __field(void *, skbaddr) + __field(int, len) + __field(int, data_len) + __field(__be16, src) + __field(__be16, dest) + ), + + TP_fast_assign( + __entry->skbaddr = skb; + __entry->len = skb->len; + __entry->data_len = skb->data_len; + __entry->src = src; + __entry->dest = dest; + ), + + TP_printk("GSO: skbaddr=%pK, len=%d, data_len=%d, src=%u, dest=%u", + __entry->skbaddr, __entry->len, __entry->data_len, + be16_to_cpu(__entry->src), be16_to_cpu(__entry->dest)) +); + /*****************************************************************************/ /* Trace events for rmnet_perf module */ /*****************************************************************************/ diff --git a/core/rmnet_vnd.c b/core/rmnet_vnd.c index 5b36fe88e764..55da35c684a8 100644 --- a/core/rmnet_vnd.c +++ b/core/rmnet_vnd.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include "rmnet_config.h" #include "rmnet_handlers.h" @@ -171,6 +173,25 @@ static u16 rmnet_vnd_select_queue(struct net_device *dev, int boost_trigger = 0; int txq = 0; + if (trace_print_skb_gso_enabled()) { + if (!skb_shinfo(skb)->gso_size) + goto skip_trace; + + if (skb->protocol == htons(ETH_P_IP)) { + if (ip_hdr(skb)->protocol != IPPROTO_TCP) + goto skip_trace; + } + + if (skb->protocol == htons(ETH_P_IPV6)) { + if (ipv6_hdr(skb)->nexthdr != IPPROTO_TCP) + goto skip_trace; + } + + trace_print_skb_gso(skb, tcp_hdr(skb)->source, + tcp_hdr(skb)->dest); + } + +skip_trace: if (priv->real_dev) txq = qmi_rmnet_get_queue(dev, skb);