diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2020-03-11 10:17:13 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2020-03-11 10:17:13 -0700 |
commit | feaf83a833e9217db3f3ba297e8e98cb0a54e0c6 (patch) | |
tree | 1fd2774a4ec2bc240c0829503659ebf8ab42895c | |
parent | a910a5dd4cb9a4f9c0539369c0a3691d3e3755df (diff) | |
parent | 762f7ff9d5f6c3973d3eae970927f43825925aaf (diff) | |
download | data-kernel-feaf83a833e9217db3f3ba297e8e98cb0a54e0c6.tar.gz |
Merge 762f7ff9d5f6c3973d3eae970927f43825925aaf on remote branch
Change-Id: Icb6c973a2d6c4282156c1836605aabb0d10bf785
-rw-r--r-- | drivers/emac-dwc-eqos/DWC_ETH_QOS_mdio.c | 26 | ||||
-rw-r--r-- | drivers/emac-dwc-eqos/DWC_ETH_QOS_platform.c | 5 | ||||
-rw-r--r-- | drivers/rmnet/shs/rmnet_shs_wq.c | 58 |
3 files changed, 70 insertions, 19 deletions
diff --git a/drivers/emac-dwc-eqos/DWC_ETH_QOS_mdio.c b/drivers/emac-dwc-eqos/DWC_ETH_QOS_mdio.c index defeef8..9ee36cd 100644 --- a/drivers/emac-dwc-eqos/DWC_ETH_QOS_mdio.c +++ b/drivers/emac-dwc-eqos/DWC_ETH_QOS_mdio.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved. +/* Copyright (c) 2017-2020, 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 @@ -1097,8 +1097,6 @@ static int DWC_ETH_QOS_init_phy(struct net_device *dev) { struct DWC_ETH_QOS_prv_data *pdata = netdev_priv(dev); struct phy_device *phydev = NULL; - char phy_id_fmt[MII_BUS_ID_SIZE + 3]; - char bus_id[MII_BUS_ID_SIZE]; u32 phydata = 0; int ret = 0; @@ -1108,22 +1106,24 @@ static int DWC_ETH_QOS_init_phy(struct net_device *dev) pdata->speed = 0; pdata->oldduplex = -1; - snprintf(bus_id, MII_BUS_ID_SIZE, "dwc_phy-%x", pdata->bus_id); - - snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id, - pdata->phyaddr); - - DBGPR_MDIO("trying to attach to %s\n", phy_id_fmt); - - phydev = phy_connect(dev, phy_id_fmt, &DWC_ETH_QOS_adjust_link, - pdata->interface); - + phydev = mdiobus_get_phy(pdata->mii, pdata->phyaddr); if (IS_ERR(phydev)) { pr_alert("%s: Could not attach to PHY\n", dev->name); return PTR_ERR(phydev); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) + phydev->skip_sw_reset = true; +#endif + ret = phy_connect_direct(dev, phydev, &DWC_ETH_QOS_adjust_link, + pdata->interface); + if (ret) { + EMACERR("phy_connect_direct failed\n"); + return ret; + } + if (phydev->phy_id == 0) { + pr_alert("%s: Invalid phy id\n", dev->name); phy_disconnect(phydev); return -ENODEV; } diff --git a/drivers/emac-dwc-eqos/DWC_ETH_QOS_platform.c b/drivers/emac-dwc-eqos/DWC_ETH_QOS_platform.c index 62daeb6..32b6a57 100644 --- a/drivers/emac-dwc-eqos/DWC_ETH_QOS_platform.c +++ b/drivers/emac-dwc-eqos/DWC_ETH_QOS_platform.c @@ -2123,6 +2123,11 @@ static int DWC_ETH_QOS_probe(struct platform_device *pdev) goto err_out_dev_failed; } EMACDBG("<-- DWC_ETH_QOS_probe\n"); + +#if defined DWC_ETH_QOS_BUILTIN && defined CONFIG_MSM_BOOT_TIME_MARKER + place_marker("M - Ethernet probe end"); +#endif + return ret; err_out_dev_failed: diff --git a/drivers/rmnet/shs/rmnet_shs_wq.c b/drivers/rmnet/shs/rmnet_shs_wq.c index 4c69b57..5944f16 100644 --- a/drivers/rmnet/shs/rmnet_shs_wq.c +++ b/drivers/rmnet/shs/rmnet_shs_wq.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. +/* Copyright (c) 2018-2020 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 @@ -28,6 +28,8 @@ MODULE_LICENSE("GPL v2"); #define RMNET_SHS_NSEC_TO_SEC(x) ((x)/1000000000) #define RMNET_SHS_BYTE_TO_BIT(x) ((x)*8) #define RMNET_SHS_MIN_HSTAT_NODES_REQD 16 +#define RMNET_SHS_FILTER_PKT_LIMIT 200 +#define RMNET_SHS_FILTER_FLOW_RATE 100 #define PERIODIC_CLEAN 0 /* FORCE_CLEAN should only used during module de-ini.*/ @@ -88,6 +90,10 @@ unsigned int rmnet_shs_cpu_rx_flows[MAX_CPUS]; module_param_array(rmnet_shs_cpu_rx_flows, uint, 0, 0444); MODULE_PARM_DESC(rmnet_shs_cpu_rx_flows, "Num flows processed per core"); +unsigned int rmnet_shs_cpu_rx_filter_flows[MAX_CPUS]; +module_param_array(rmnet_shs_cpu_rx_filter_flows, uint, 0, 0644); +MODULE_PARM_DESC(rmnet_shs_cpu_rx_filter_flows, "Num filtered flows per core"); + unsigned long long rmnet_shs_cpu_rx_bytes[MAX_CPUS]; module_param_array(rmnet_shs_cpu_rx_bytes, ullong, 0, 0444); MODULE_PARM_DESC(rmnet_shs_cpu_rx_bytes, "SHS stamp bytes per CPU"); @@ -1875,19 +1881,53 @@ void rmnet_shs_update_cfg_mask(void) { /* Start with most avaible mask all eps could share*/ u8 mask = UPDATE_MASK; + u8 rps_enabled = 0; struct rmnet_shs_wq_ep_s *ep; list_for_each_entry(ep, &rmnet_shs_wq_ep_tbl, ep_list_id) { if (!ep->is_ep_active) continue; - /* Bitwise and to get common mask VNDs with different mask - * will have UNDEFINED behavior + /* Bitwise and to get common mask from non-null masks. + * VNDs with different mask will have UNDEFINED behavior */ - mask &= ep->rps_config_msk; + if (ep->rps_config_msk) { + mask &= ep->rps_config_msk; + rps_enabled = 1; + } + } + + if (!rps_enabled) { + rmnet_shs_cfg.map_mask = 0; + rmnet_shs_cfg.map_len = 0; + return; + } else if (rmnet_shs_cfg.map_mask != mask) { + rmnet_shs_cfg.map_mask = mask; + rmnet_shs_cfg.map_len = rmnet_shs_get_mask_len(mask); + } +} + +void rmnet_shs_wq_filter(void) +{ + int cpu; + int temp; + struct rmnet_shs_wq_hstat_s *hnode = NULL; + + for (cpu = 0; cpu < MAX_CPUS; cpu++) + rmnet_shs_cpu_rx_filter_flows[cpu] = 0; + + /* Filter out flows with low pkt count */ + list_for_each_entry(hnode, &rmnet_shs_wq_hstat_tbl, hstat_node_id) { + + if (hnode->in_use == 0) + continue; + if (hnode->avg_pps > RMNET_SHS_FILTER_FLOW_RATE && + hnode->rx_skb > RMNET_SHS_FILTER_PKT_LIMIT) + if (hnode->current_cpu < MAX_CPUS){ + temp = hnode->current_cpu; + rmnet_shs_cpu_rx_filter_flows[temp]++; + } } - rmnet_shs_cfg.map_mask = mask; - rmnet_shs_cfg.map_len = rmnet_shs_get_mask_len(mask); } void rmnet_shs_wq_update_stats(void) @@ -1944,6 +1984,7 @@ void rmnet_shs_wq_update_stats(void) /*Invoke after both the locks are released*/ rmnet_shs_wq_cleanup_hash_tbl(PERIODIC_CLEAN); rmnet_shs_wq_debug_print_flows(); + rmnet_shs_wq_filter(); } void rmnet_shs_wq_process_wq(struct work_struct *work) @@ -2031,8 +2072,13 @@ void rmnet_shs_wq_init_cpu_rx_flow_tbl(void) void rmnet_shs_wq_pause(void) { + int cpu; + if (rmnet_shs_wq && rmnet_shs_delayed_wq) cancel_delayed_work_sync(&rmnet_shs_delayed_wq->wq); + + for (cpu = 0; cpu < MAX_CPUS; cpu++) + rmnet_shs_cpu_rx_filter_flows[cpu] = 0; } void rmnet_shs_wq_restart(void) |