1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-15 03:33:52 +02:00
openwrt/target/linux/layerscape/patches-5.4/701-net-0043-sdk_dpaa-ceetm-stop-transmitting-frames-when-the-CQ-.patch
Yangbo Lu cddd459140 layerscape: add patches-5.4
Add patches for linux-5.4. The patches are from NXP LSDK-20.04 release
which was tagged LSDK-20.04-V5.4.
https://source.codeaurora.org/external/qoriq/qoriq-components/linux/

For boards LS1021A-IOT, and Traverse-LS1043 which are not involved in
LSDK, port the dts patches from 4.14.

The patches are sorted into the following categories:
  301-arch-xxxx
  302-dts-xxxx
  303-core-xxxx
  701-net-xxxx
  801-audio-xxxx
  802-can-xxxx
  803-clock-xxxx
  804-crypto-xxxx
  805-display-xxxx
  806-dma-xxxx
  807-gpio-xxxx
  808-i2c-xxxx
  809-jailhouse-xxxx
  810-keys-xxxx
  811-kvm-xxxx
  812-pcie-xxxx
  813-pm-xxxx
  814-qe-xxxx
  815-sata-xxxx
  816-sdhc-xxxx
  817-spi-xxxx
  818-thermal-xxxx
  819-uart-xxxx
  820-usb-xxxx
  821-vfio-xxxx

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2020-05-07 12:53:06 +02:00

101 lines
3.1 KiB
Diff

From 3aa939c73c176690a9ebe646612cd097f281efe5 Mon Sep 17 00:00:00 2001
From: Camelia Groza <camelia.groza@nxp.com>
Date: Fri, 24 Nov 2017 10:48:31 +0200
Subject: [PATCH] sdk_dpaa: ceetm: stop transmitting frames when the CQ is
congested
When the egress CQ is congested, drop the frames instead of enqueueing
them. This is more efficient than enqueueing and receiving them back on
the ERN queue.
We also can't stop the netdev queues because that would affect all the CQs
and would hinder prioritization.
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
---
.../ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c | 22 ++++++++++++++++------
.../ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h | 1 +
2 files changed, 17 insertions(+), 6 deletions(-)
--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c
+++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c
@@ -125,16 +125,16 @@ static void ceetm_cscn(struct qm_ceetm_c
break;
}
+ ceetm_fq->congested = congested;
+
if (congested) {
dpa_priv->cgr_data.congestion_start_jiffies = jiffies;
- netif_tx_stop_all_queues(dpa_priv->net_dev);
dpa_priv->cgr_data.cgr_congested_count++;
if (cstats)
cstats->congested_count++;
} else {
dpa_priv->cgr_data.congested_jiffies +=
(jiffies - dpa_priv->cgr_data.congestion_start_jiffies);
- netif_tx_wake_all_queues(dpa_priv->net_dev);
}
}
@@ -148,6 +148,7 @@ static int ceetm_alloc_fq(struct ceetm_f
(*fq)->net_dev = dev;
(*fq)->ceetm_cls = cls;
+ (*fq)->congested = 0;
return 0;
}
@@ -1913,7 +1914,8 @@ int __hot ceetm_tx(struct sk_buff *skb,
struct Qdisc *sch = net_dev->qdisc;
struct ceetm_class *cl;
struct dpa_priv_s *priv_dpa;
- struct qman_fq *egress_fq, *conf_fq;
+ struct ceetm_fq *ceetm_fq;
+ struct qman_fq *conf_fq;
struct ceetm_qdisc *priv = qdisc_priv(sch);
struct ceetm_qdisc_stats *qstats = this_cpu_ptr(priv->root.qstats);
struct ceetm_class_stats *cstats;
@@ -1945,11 +1947,11 @@ int __hot ceetm_tx(struct sk_buff *skb,
*/
switch (cl->type) {
case CEETM_PRIO:
- egress_fq = &cl->prio.fq->fq;
+ ceetm_fq = cl->prio.fq;
cstats = this_cpu_ptr(cl->prio.cstats);
break;
case CEETM_WBFS:
- egress_fq = &cl->wbfs.fq->fq;
+ ceetm_fq = cl->wbfs.fq;
cstats = this_cpu_ptr(cl->wbfs.cstats);
break;
default:
@@ -1957,8 +1959,16 @@ int __hot ceetm_tx(struct sk_buff *skb,
goto drop;
}
+ /* If the FQ is congested, avoid enqueuing the frame and dropping it
+ * when it returns on the ERN path. Drop it here directly instead.
+ */
+ if (unlikely(ceetm_fq->congested)) {
+ qstats->drops++;
+ goto drop;
+ }
+
bstats_update(&cstats->bstats, skb);
- return dpa_tx_extended(skb, net_dev, egress_fq, conf_fq);
+ return dpa_tx_extended(skb, net_dev, &ceetm_fq->fq, conf_fq);
drop:
dev_kfree_skb_any(skb);
--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h
+++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h
@@ -105,6 +105,7 @@ struct ceetm_fq {
struct qman_fq fq;
struct net_device *net_dev;
struct ceetm_class *ceetm_cls;
+ int congested; /* Congestion status */
};
struct root_q {