1
0
Fork 0
alistair23-linux/drivers/net
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
..
appletalk
arcnet
bonding net: bonding: use __ethtool_get_ksettings 2016-02-25 22:06:46 -05:00
caif
can can: rcar_can: Add r8a7795 support 2016-03-10 10:30:21 +01:00
cris
dsa net: dsa: mv88e6xxx: avoid writing the same mode 2016-03-10 16:10:31 -05:00
ethernet net: mvneta: bm: add support for hardware buffer management 2016-03-14 12:19:46 -04:00
fddi defxx: fix build warning 2016-01-25 10:51:52 -08:00
fjes
hamradio dmascc: Return correct error codes 2016-02-16 15:32:34 -05:00
hippi
hyperv hv_netvsc: Move subchannel waiting to rndis_filter_device_remove() 2016-03-07 15:37:50 -05:00
ieee802154 mrf24j40: add writeable missing reg 2016-02-23 20:29:40 +01:00
ipvlan net: ipvlan: use __ethtool_get_ksettings 2016-02-25 22:06:46 -05:00
irda net/irda: bfin_sir: remove duplicate defines 2016-01-21 10:45:45 -08:00
phy at803x: fix suspend/resume for SGMII link 2016-03-13 22:37:08 -04:00
plip net: plip: use new parport device model 2016-01-09 21:02:05 -05:00
ppp Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
slip
team net: team: use __ethtool_get_ksettings 2016-02-25 22:06:46 -05:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
vmxnet3 vmxnet3: avoid calling pskb_may_pull with interrupts disabled 2016-03-07 15:15:24 -05:00
wan wan: lmc: Switch to using managed resources 2016-03-02 13:43:03 -05:00
wimax
wireless rtl8xxxu: Temporarily disable 8192eu device init 2016-03-10 15:29:21 +02:00
xen-netback xen-netback: reduce log spam 2016-03-13 22:08:01 -04:00
Kconfig macsec: introduce IEEE 802.1AE driver 2016-03-13 22:40:24 -04:00
LICENSE.SRC
Makefile macsec: introduce IEEE 802.1AE driver 2016-03-13 22:40:24 -04:00
Space.c
dummy.c
eql.c
geneve.c gro: Defer clearing of flush bit in tunnel paths 2016-03-13 15:01:00 -04:00
ifb.c
loopback.c sctp: Rename NETIF_F_SCTP_CSUM to NETIF_F_SCTP_CRC 2015-12-15 16:49:58 -05:00
macsec.c macsec: introduce IEEE 802.1AE driver 2016-03-13 22:40:24 -04:00
macvlan.c net: macvlan: use __ethtool_get_ksettings 2016-02-25 22:06:46 -05:00
macvtap.c macvtap: always pass ethernet header in linear 2016-03-11 14:45:21 -05:00
mdio.c
mii.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tun.c net/tun: implement ndo_set_rx_headroom 2016-03-01 15:54:30 -05:00
veth.c veth: implement ndo_set_rx_headroom 2016-03-01 15:54:31 -05:00
virtio_net.c virtio_net: validate ethtool port setting and explain the user validation 2016-02-11 11:55:38 -05:00
vrf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2016-03-08 12:34:12 -05:00
vxlan.c gro: Defer clearing of flush bit in tunnel paths 2016-03-13 15:01:00 -04:00
xen-netfront.c xen-netfront: request Tx response events more often 2016-01-28 16:08:55 -08:00