openwrt/target/linux/layerscape/patches-5.4/701-net-0052-sdk_dpaa-ceetm-remove-tc-class-reference-counting.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

107 lines
3.3 KiB
Diff

From 024d664114310fe103c2c31f2253bed58238951d Mon Sep 17 00:00:00 2001
From: Camelia Groza <camelia.groza@nxp.com>
Date: Wed, 17 Jan 2018 16:47:07 +0200
Subject: [PATCH] sdk_dpaa: ceetm: remove tc class reference counting
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
---
.../ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c | 38 +++-------------------
.../ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h | 1 -
2 files changed, 4 insertions(+), 35 deletions(-)
--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c
+++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c
@@ -774,7 +774,6 @@ static int ceetm_init_prio(struct Qdisc
}
child_cl->common.classid = TC_H_MAKE(sch->handle, (i + 1));
- child_cl->refcnt = 1;
child_cl->parent = sch;
child_cl->type = CEETM_PRIO;
child_cl->shaped = priv->shaped;
@@ -986,7 +985,6 @@ static int ceetm_init_wbfs(struct Qdisc
}
child_cl->common.classid = TC_H_MAKE(sch->handle, (i + 1));
- child_cl->refcnt = 1;
child_cl->parent = sch;
child_cl->type = CEETM_WBFS;
child_cl->shaped = priv->shaped;
@@ -1297,29 +1295,9 @@ static void ceetm_attach(struct Qdisc *s
}
}
-static unsigned long ceetm_cls_get(struct Qdisc *sch, u32 classid)
+static unsigned long ceetm_cls_search(struct Qdisc *sch, u32 handle)
{
- struct ceetm_class *cl;
-
- pr_debug(KBUILD_BASENAME " : %s : classid %X from qdisc %X\n",
- __func__, classid, sch->handle);
- cl = ceetm_find(classid, sch);
-
- if (cl)
- cl->refcnt++; /* Will decrement in put() */
- return (unsigned long)cl;
-}
-
-static void ceetm_cls_put(struct Qdisc *sch, unsigned long arg)
-{
- struct ceetm_class *cl = (struct ceetm_class *)arg;
-
- pr_debug(KBUILD_BASENAME " : %s : classid %X from qdisc %X\n",
- __func__, cl->common.classid, sch->handle);
- cl->refcnt--;
-
- if (cl->refcnt == 0)
- ceetm_cls_destroy(sch, cl);
+ return (unsigned long)ceetm_find(handle, sch);
}
static int ceetm_cls_change_root(struct ceetm_class *cl,
@@ -1540,7 +1518,6 @@ static int ceetm_cls_change(struct Qdisc
cl->root.tbl = copt->tbl;
cl->common.classid = classid;
- cl->refcnt = 1;
cl->parent = sch;
cl->root.child = NULL;
cl->root.wbfs_grp_a = false;
@@ -1696,15 +1673,9 @@ static int ceetm_cls_delete(struct Qdisc
sch_tree_lock(sch);
qdisc_class_hash_remove(&priv->clhash, &cl->common);
- cl->refcnt--;
-
- /* The refcnt should be at least 1 since we have incremented it in
- * get(). Will decrement again in put() where we will call destroy()
- * to actually free the memory if it reaches 0.
- */
- WARN_ON(cl->refcnt == 0);
sch_tree_unlock(sch);
+ ceetm_cls_destroy(sch, cl);
return 0;
}
@@ -1824,8 +1795,7 @@ static void ceetm_tcf_unbind(struct Qdis
const struct Qdisc_class_ops ceetm_cls_ops = {
.graft = ceetm_cls_graft,
.leaf = ceetm_cls_leaf,
- .get = ceetm_cls_get,
- .put = ceetm_cls_put,
+ .find = ceetm_cls_search,
.change = ceetm_cls_change,
.delete = ceetm_cls_delete,
.walk = ceetm_cls_walk,
--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h
+++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h
@@ -191,7 +191,6 @@ struct wbfs_c {
struct ceetm_class {
struct Qdisc_class_common common;
- int refcnt; /* usage count of this class */
struct tcf_proto *filter_list; /* class attached filters */
struct tcf_block *block;
struct Qdisc *parent;