From fa2b857e85998a6843c1a6843446ff00067fa3a4 Mon Sep 17 00:00:00 2001 From: Marian-Cristian Rotariu Date: Thu, 15 Jan 2015 17:02:48 +0200 Subject: dpaa_eth: add VSP compatibility for eth ports This patch provides compatibility for the Ethernet driver ports with the VSP capability. Until now, the FMan ports managed by the Ethernet driver were not able to properly configure VSP because of the buffer layout of the FMan ports used. When VSPs are not enabled, the RX and TX path buffer layout are different, the Ethernet driver maintains separate buffer layouts for transmission and reception. When VSPs are enabled on a certain FMan port, the buffer layouts for Rx and Tx should be the same, the same buffer layout being used inside a storage profile. In order to bypass this the VSP capability is disabled on the Tx path by setting ContextB to 0 in the FQ descriptor of the queues that are transmitting the frames to the Tx port. Change-Id: Ie29b8a0fe8b0b9c2344658f8e4a35e0392b6bf8e Signed-off-by: Marian-Cristian Rotariu Reviewed-on: http://git.am.freescale.net:8181/25613 Reviewed-by: Madalin-Cristian Bucur diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c index 32684d2..5738160 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_common.c @@ -1215,6 +1215,8 @@ int dpa_fq_init(struct dpa_fq *dpa_fq, bool td_enable) fq = &dpa_fq->fq_base; if (dpa_fq->init) { + memset(&initfq, 0, sizeof(initfq)); + initfq.we_mask = QM_INITFQ_WE_FQCTRL; /* FIXME: why would we want to keep an empty FQ in cache? */ initfq.fqd.fq_ctrl = QM_FQCTRL_PREFERINCACHE; @@ -1276,9 +1278,11 @@ int dpa_fq_init(struct dpa_fq *dpa_fq, bool td_enable) /* ContextA: OVOM=1 (use contextA2 bits instead of ICAD) * A2V=1 (contextA A2 field is valid) * A0V=1 (contextA A0 field is valid) + * B0V=1 (contextB field is valid) * ContextA A2: EBD=1 (deallocate buffers inside FMan) + * ContextB B0(ASPID): 0 (absolute Virtual Storage ID) */ - initfq.fqd.context_a.hi = 0x1a000000; + initfq.fqd.context_a.hi = 0x1e000000; initfq.fqd.context_a.lo = 0x80000000; } } -- cgit v0.10.2