1
0
Fork 0
alistair23-linux/drivers/net/ethernet
Marcin Wojtas dc35a10f68 net: mvneta: bm: add support for hardware buffer management
Buffer manager (BM) is a dedicated hardware unit that can be used by all
ethernet ports of Armada XP and 38x SoC's. It allows to offload CPU on RX
path by sparing DRAM access on refilling buffer pool, hardware-based
filling of descriptor ring data and better memory utilization due to HW
arbitration for using 'short' pools for small packets.

Tests performed with A388 SoC working as a network bridge between two
packet generators showed increase of maximum processed 64B packets by
~20k (~555k packets with BM enabled vs ~535 packets without BM). Also
when pushing 1500B-packets with a line rate achieved, CPU load decreased
from around 25% without BM to 20% with BM.

BM comprise up to 4 buffer pointers' (BP) rings kept in DRAM, which
are called external BP pools - BPPE. Allocating and releasing buffer
pointers (BP) to/from BPPE is performed indirectly by write/read access
to a dedicated internal SRAM, where internal BP pools (BPPI) are placed.
BM hardware controls status of BPPE automatically, as well as assigning
proper buffers to RX descriptors. For more details please refer to
Functional Specification of Armada XP or 38x SoC.

In order to enable support for a separate hardware block, common for all
ports, a new driver has to be implemented ('mvneta_bm'). It provides
initialization sequence of address space, clocks, registers, SRAM,
empty pools' structures and also obtaining optional configuration
from DT (please refer to device tree binding documentation). mvneta_bm
exposes also a necessary API to mvneta driver, as well as a dedicated
structure with BM information (bm_priv), whose presence is used as a
flag notifying of BM usage by port. It has to be ensured that mvneta_bm
probe is executed prior to the ones in ports' driver. In case BM is not
used or its probe fails, mvneta falls back to use software buffer
management.

A sequence executed in mvneta_probe function is modified in order to have
an access to needed resources before possible port's BM initialization is
done. According to port-pools mapping provided by DT appropriate registers
are configured and the buffer pools are filled. RX path is modified
accordingly. Becaues the hardware allows a wide variety of configuration
options, following assumptions are made:
* using BM mechanisms can be selectively disabled/enabled basing
  on DT configuration among the ports
* 'long' pool's single buffer size is tied to port's MTU
* using 'long' pool by port is obligatory and it cannot be shared
* using 'short' pool for smaller packets is optional
* one 'short' pool can be shared among all ports

This commit enables hardware buffer management operation cooperating with
existing mvneta driver. New device tree binding documentation is added and
the one of mvneta is updated accordingly.

[gregory.clement@free-electrons.com: removed the suspend/resume part]

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-14 12:19:46 -04:00
..
3com Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
8390 pcnet_cs: add new id 2016-02-16 16:06:13 -05:00
adaptec
adi net: bfin_mac: Use phy_find_first() instead of open-coding it 2016-01-11 00:00:34 -05:00
aeroflex mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
agere et131x: check return value of dma_alloc_coherent 2016-02-17 23:32:05 -05:00
allwinner
alteon
altera net: eth: altera: do not free array priv->mdio->irq 2016-03-06 22:59:18 -05:00
amd net: relax setup_tc ndo op handle restriction 2016-03-03 16:25:15 -05:00
apm drivers: net: xgene: Add support for multiple queues 2016-02-17 22:08:34 -05:00
apple
arc net: arc_emac: fix sk_buff leak 2016-02-16 15:26:30 -05:00
atheros ethernet/atl1c: remove left over dead code 2016-03-02 15:00:55 -05:00
aurora net: ethernet: nb8800: support fixed-link DT node 2016-02-24 11:32:11 -05:00
broadcom bnxt_en: Enable AER support. 2016-03-08 14:51:44 -05:00
brocade bna: fix list corruption 2016-03-01 15:19:43 -05:00
cadence net: macb: fix default configuration for GMAC on AT91 2016-03-13 22:16:22 -04:00
calxeda
cavium Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
chelsio cxgb4vf: Set number of queues in pci probe only 2016-03-10 16:12:25 -05:00
cirrus
cisco cisco: enic: Update logging macros and uses 2016-03-11 15:07:48 -05:00
davicom net: ethernet: davicom: fix devicetree irq resource 2016-02-21 22:40:49 -05:00
dec net: tulip: Use setup_timer() 2016-02-25 16:51:04 -05:00
dlink dl2k: Implement suspend 2015-11-20 14:48:27 -05:00
emulex Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
ezchip net: ezchip: adapt driver to little endian architecture 2016-03-03 17:20:08 -05:00
faraday net: ethernet: faraday: Use phy_find_first() instead of open coding it 2016-01-10 22:05:30 -05:00
freescale Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
fujitsu fmvj18x_cs: fix incorrect indexing of dev->dev_addr[] when copying the MAC address 2016-02-21 22:08:43 -05:00
hisilicon net: hns: fix the bug about loopback 2016-03-07 15:44:51 -05:00
hp net: hp100: remove unnecessary #ifdefs 2016-01-29 20:33:38 -08:00
i825xx
ibm ibmveth: check return of skb_linearize in ibmveth_start_xmit 2016-03-07 14:38:52 -05:00
intel net: relax setup_tc ndo op handle restriction 2016-03-03 16:25:15 -05:00
marvell net: mvneta: bm: add support for hardware buffer management 2016-03-14 12:19:46 -04:00
mediatek net-next: mediatek: add Kconfig and Makefile 2016-03-10 16:22:12 -05:00
mellanox mlx5: use napi_consume_skb API to get bulk free operations 2016-03-13 22:35:36 -04:00
micrel Merge remote-tracking branches 'spi/topic/omap-100k', 'spi/topic/omap-uwire', 'spi/topic/owner', 'spi/topic/pxa' and 'spi/topic/pxa2xx' into spi-next 2015-11-04 11:02:12 +00:00
microchip net: encx24j600: move rev announcement to probe function 2015-11-20 10:45:20 -05:00
moxa net: moxa: fix an error code 2016-03-03 17:17:14 -05:00
myricom net: provide generic busy polling to all NAPI drivers 2015-11-18 16:17:42 -05:00
natsemi natsemi: add checks for dma mapping errors 2015-12-19 12:58:46 -05:00
neterion net: vxge: avoid unused function warnings 2016-01-29 20:33:39 -08:00
netronome nfp: call netif_carrier_off() during init 2015-12-18 15:31:36 -05:00
nuvoton
nvidia forcedeth: Use setup_timer() 2016-02-25 16:51:05 -05:00
nxp net: lpc_eth: Remove unused variables 2016-01-10 22:50:14 -05:00
octeon
oki-semi net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK 2015-12-15 16:50:08 -05:00
packetengines
pasemi pasemi_mac: Replace LRO with GRO 2016-02-17 16:15:45 -05:00
qlogic qed: Enlrage the drain timeout 2016-03-11 15:20:20 -05:00
qualcomm net: qca_spi: clear IFF_TX_SKB_SHARING 2016-02-25 16:12:15 -05:00
rdc mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
realtek r8169:Remove unnecessary phy reset for pcie nic when setting link spped. 2016-03-13 22:32:44 -04:00
renesas sh_eth: advance 'rxdesc' later in sh_eth_ring_format() 2016-03-10 16:06:49 -05:00
rocker rocker: move ageing_time from struct rocker to struct ofdpa 2016-03-12 20:11:13 -05:00
samsung sxgbe: remove unused code 2016-02-10 06:10:17 -05:00
seeq
sfc net: relax setup_tc ndo op handle restriction 2016-03-03 16:25:15 -05:00
sgi
silan
sis
smsc net: smc91x: propagate irq return code 2016-02-16 15:02:23 -05:00
stmicro Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
sun sunvnet: perf tracepoint invocations to trace LDC state machine 2016-02-07 14:13:06 -05:00
synopsys dwc_eth_qos: do phy_start before resetting hardware 2016-03-02 14:57:15 -05:00
tehuti
ti net: relax setup_tc ndo op handle restriction 2016-03-03 16:25:15 -05:00
tile tilepro: use to_delayed_work 2016-01-04 16:07:16 -05:00
toshiba net: tc35815: Drop unused variable 2016-01-10 23:31:25 -05:00
tundra
via via-velocity: unconditionally drop frames with bad l2 length 2015-11-17 14:37:16 -05:00
wiznet
xilinx phy: Add an mdio_device structure 2016-01-07 14:31:26 -05:00
xircom
xscale
Kconfig net-next: mediatek: add Kconfig and Makefile 2016-03-10 16:22:12 -05:00
Makefile net-next: mediatek: add Kconfig and Makefile 2016-03-10 16:22:12 -05:00
dnet.c mdio: Move allocation of interrupts into core 2016-01-07 14:31:26 -05:00
dnet.h
ec_bhf.c
ethoc.c net/ethoc: do not free array priv->mdio->irq 2016-03-06 22:58:51 -05:00
fealnx.c
jme.c jme: Fix device PM wakeup API usage 2016-03-07 15:39:45 -05:00
jme.h
korina.c
lantiq_etop.c net: lantiq_etop.c: Use helper to find first phy 2016-01-10 18:03:47 -05:00
netx-eth.c