openwrt/target/linux/layerscape/patches-5.4/701-net-0044-sdk_dpaa-ceetm-coding-style-fixes-and-added-comments.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

92 lines
3.0 KiB
Diff

From e21cd0d3ef6f039c674b9e22581aaaabdf3a40f7 Mon Sep 17 00:00:00 2001
From: Camelia Groza <camelia.groza@nxp.com>
Date: Fri, 24 Nov 2017 11:55:51 +0200
Subject: [PATCH] sdk_dpaa: ceetm: coding style fixes and added comments
Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
---
.../ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c | 38 ++++++++++++++--------
1 file changed, 24 insertions(+), 14 deletions(-)
--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c
+++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c
@@ -69,15 +69,17 @@ static void get_dcp_and_sp(struct net_de
static void ceetm_ern(struct qman_portal *portal, struct qman_fq *fq,
const struct qm_mr_entry *msg)
{
- struct net_device *net_dev;
- struct ceetm_class *cls;
+ struct dpa_percpu_priv_s *dpa_percpu_priv;
struct ceetm_class_stats *cstats = NULL;
const struct dpa_priv_s *dpa_priv;
- struct dpa_percpu_priv_s *dpa_percpu_priv;
- struct sk_buff *skb;
struct qm_fd fd = msg->ern.fd;
+ struct net_device *net_dev;
+ struct ceetm_fq *ceetm_fq;
+ struct ceetm_class *cls;
+ struct sk_buff *skb;
- net_dev = ((struct ceetm_fq *)fq)->net_dev;
+ ceetm_fq = container_of(fq, struct ceetm_fq, fq);
+ net_dev = ceetm_fq->net_dev;
dpa_priv = netdev_priv(net_dev);
dpa_percpu_priv = raw_cpu_ptr(dpa_priv->percpu_priv);
@@ -86,7 +88,7 @@ static void ceetm_ern(struct qman_portal
dpa_percpu_priv->stats.tx_fifo_errors++;
/* Increment CEETM counters */
- cls = ((struct ceetm_fq *)fq)->ceetm_cls;
+ cls = ceetm_fq->ceetm_cls;
switch (cls->type) {
case CEETM_PRIO:
cstats = this_cpu_ptr(cls->prio.cstats);
@@ -99,11 +101,15 @@ static void ceetm_ern(struct qman_portal
if (cstats)
cstats->ern_drop_count++;
+ /* Release the buffers that were supposed to be recycled. */
if (fd.bpid != 0xff) {
dpa_fd_release(net_dev, &fd);
return;
}
+ /* Release the frames that were supposed to return on the
+ * confirmation path.
+ */
skb = _dpa_cleanup_tx_fd(dpa_priv, &fd);
dev_kfree_skb_any(skb);
}
@@ -1909,18 +1915,22 @@ static struct ceetm_class *ceetm_classif
int __hot ceetm_tx(struct sk_buff *skb, struct net_device *net_dev)
{
- int ret;
- bool act_drop = false;
+ const int queue_mapping = dpa_get_queue_mapping(skb);
struct Qdisc *sch = net_dev->qdisc;
- struct ceetm_class *cl;
+ struct ceetm_class_stats *cstats;
+ struct ceetm_qdisc_stats *qstats;
struct dpa_priv_s *priv_dpa;
struct ceetm_fq *ceetm_fq;
+ struct ceetm_qdisc *priv;
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;
- const int queue_mapping = dpa_get_queue_mapping(skb);
- spinlock_t *root_lock = qdisc_lock(sch);
+ struct ceetm_class *cl;
+ spinlock_t *root_lock;
+ bool act_drop = false;
+ int ret;
+
+ root_lock = qdisc_lock(sch);
+ priv = qdisc_priv(sch);
+ qstats = this_cpu_ptr(priv->root.qstats);
spin_lock(root_lock);
cl = ceetm_classify(skb, sch, &ret, &act_drop);