diff options
author | Bogdan Hamciuc <bogdan.hamciuc@freescale.com> | 2013-01-25 23:46:16 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-04-08 23:10:50 (GMT) |
commit | c59ac0e90877baf081ba4d9c5a4604a0481c9835 (patch) | |
tree | 42af2a881be714a747c5652168102442a7833e37 /drivers/net/ethernet/freescale | |
parent | 5137280f9d74d4d9a933e7334f959dc5a1929082 (diff) | |
download | linux-fsl-qoriq-c59ac0e90877baf081ba4d9c5a4604a0481c9835.tar.xz |
dpaa_eth: Add overhead accounting control to CGRs
QMan can account for a fixed overhead when comparing the current byte
counts against the CGR notification threshold. We can use it to better
memory management in those cases when the fixed overhead from skb shells
and the netdev's needed_headroom is significant compared to the outgoing
frame size.
Unfortunately, with the current hardware the maximum value of
the overhead accounting limit (OAL) is 127, which is not enough for our
needs; but even so, it is better than no OAL at all.
Change-Id: I368a59816b52b176aa569eb446a869ac20b3d8b3
Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
(cherry picked from commit 4084d9c8d258aad9a1fb3367fd8c81f01a9c9e30)
Reviewed-on: http://git.am.freescale.net:8181/1039
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth.c | 16 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth.h | 7 |
2 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index fdc88d0..d07dbdc 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -614,10 +614,24 @@ _dpa_fq_alloc(struct list_head *list, struct dpa_fq *dpa_fq) initfq.fqd.dest.wq = dpa_fq->wq; /* Put all egress queues in a congestion group of their own */ - initfq.we_mask |= QM_INITFQ_WE_CGID; if (dpa_fq->fq_type == FQ_TYPE_TX) { + initfq.we_mask |= QM_INITFQ_WE_CGID; initfq.fqd.fq_ctrl |= QM_FQCTRL_CGE; initfq.fqd.cgid = priv->cgr_data.cgr.cgrid; + /* + * Set a fixed overhead accounting, in an attempt to + * reduce the impact of fixed-size skb shells and the + * driver's needed headroom on system memory. This is + * especially the case when the egress traffic is + * composed of small datagrams. + * Unfortunately, QMan's OAL value is capped to an + * insufficient value, but even that is better than + * no overhead accounting at all. + */ + initfq.we_mask |= QM_INITFQ_WE_OAC; + initfq.fqd.oac_init.oac = QM_OAC_CG; + initfq.fqd.oac_init.oal = min(sizeof(struct sk_buff) + + DPA_BP_HEAD, (size_t)FSL_QMAN_MAX_OAL); /* Configure per-cpu Tx confirmation queue */ confq = _dpa_get_tx_conf_queue(priv, &dpa_fq->fq_base); diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.h b/drivers/net/ethernet/freescale/dpa/dpaa_eth.h index 9cbe9d7..343c38c 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.h +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.h @@ -174,6 +174,13 @@ void fsl_dpaa_eth_set_hooks(struct dpaa_eth_hooks_s *hooks); #endif /* CONFIG_DPAA_ETH_SG_SUPPORT */ /* + * Largest value that the FQD's OAL field can hold. + * This is DPAA-1.x specific. + * TODO: This rather belongs in fsl_qman.h + */ +#define FSL_QMAN_MAX_OAL 127 + +/* * Values for the L3R field of the FM Parse Results */ /* L3 Type field: First IP Present IPv4 */ |